modelcontextprotocol / modelcontextprotocol/python-sdk

Document and provide hooks for sandboxing file and network access in MCP tools

Đang mở
#1,705 28 bình luận 0 reaction 0 người được giao Xem trên GitHub

Chưa có ai nhận issue này.

documentation enhancement needs confirmation
Ngôn ngữ chính
Python
Star
24.3k
Fork
4k
Merge trung bình
1 ngày 1 giờ
Pull request đã merge (30 ngày)
31

Mô tả

Description

Summary

MCP tools and resources built with the Python SDK can, by default, access the full file system, network, and environment of the host process. This is powerful but risky, especially when:

  • servers are installed from third parties, or
  • LLM agents can call tools based on prompt-injected instructions.

The SDK should clearly document this and provide hooks/patterns for limiting capabilities.

Proposal

  1. Document security considerations

    • Add a “Security considerations” section explicitly calling out:
      • file system access,
      • network access,
      • environment variables and credentials.
  2. Provide capability hooks

    • Offer configuration points or helper utilities to:
      • restrict file access to specific directories (allowlist),
      • restrict outbound network calls to certain hosts/domains,
      • prevent access to environment variables by default.
  3. Encourage process-level sandboxing

    • Provide guidance on running MCP servers in:
      • containers with minimal privileges,
      • separate processes with limited OS capabilities.

Why this matters

  • Defense in depth: Even if application code is careful, configuration mistakes or third-party code can introduce risk.
  • Prompt-injection mitigation: Restricting what tools can do reduces the impact of malicious prompts.
  • Operational guidance: Many users are new to MCP and benefit from clear security best practices.

Acceptance criteria

  • Documentation clearly describes the security implications of running MCP servers and tools.
  • There are example patterns for restricting file and network access.
  • Where feasible, the SDK exposes hooks or configuration points for capability control.
References

No response

Hướng dẫn đóng góp

Mở hướng dẫn đóng góp

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Hướng nghiên cứu

Không có tệp hoặc kiểm thử nào được nêu. Hãy bắt đầu bằng cách xem xét tài liệu hiện có của SDK và các điểm cấu hình hoặc mở rộng cho các máy chủ và công cụ MCP, sau đó xác định liệu có thể thêm các cơ chế kiểm soát capability mà không giả định việc thực thi ở cấp hệ điều hành hay không. Công việc được xem là hoàn tất khi hướng dẫn bảo mật, các ví dụ về hạn chế tệp và mạng, cùng các hook hoặc điểm cấu hình khả thi được ghi lại và được bao phủ bởi hoạt động xác thực phù hợp.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Đánh giá

Công nghệ
python
Lĩnh vực
documentation, security
Loại issue
Tính năng
Độ khó
5/5
Thời gian dự kiến
Hơn một tuần
Mức độ hoạt động
Sôi nổi
Độ rõ ràng
Khá rõ ràng
Mức phù hợp với người mới
35/100

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.