modelcontextprotocol / modelcontextprotocol/python-sdk
Document and provide hooks for sandboxing file and network access in MCP tools
オープン
まだ誰も着手していません。
documentation
enhancement
needs confirmation
- 主要言語
- Python
- スター
- 24.3k
- フォーク
- 4k
- 平均マージ
- 1日 1時間
- マージ済み PR(30日)
- 31
説明
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
-
Document security considerations
- Add a “Security considerations” section explicitly calling out:
- file system access,
- network access,
- environment variables and credentials.
- Add a “Security considerations” section explicitly calling out:
-
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.
- Offer configuration points or helper utilities to:
-
Encourage process-level sandboxing
- Provide guidance on running MCP servers in:
- containers with minimal privileges,
- separate processes with limited OS capabilities.
- Provide guidance on running MCP servers in:
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
コントリビューションガイド
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
調査の方向性
ファイルやテストは指定されていません。まず SDK の既存のドキュメントと、MCP サーバーおよびツールの設定または拡張ポイントを確認し、そのうえで、OS レベルの強制適用を前提とせずに capability controls を追加できるかどうかを判断してください。セキュリティガイダンス、ファイルおよびネットワークの制限例、実現可能なフックまたは設定ポイントが文書化され、適切な検証でカバーされていれば完了です。
索引モデルが issue の本文から書いたものです。
評価
- 技術スタック
- python
- 領域
- documentation, security
- issue の種類
- 機能追加
- 難易度
- 5/5
- 見積もり時間
- 1週間以上
- 活発さ
- 活発
- 明瞭さ
- おおむね明確
- 初心者へのやさしさ
- 35/100