modelcontextprotocol / modelcontextprotocol/python-sdk

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

オープン
#1,705 コメント 28 件 リアクション 0 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

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

  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

コントリビューションガイド

コントリビューションガイドを開く

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

調査の方向性

ファイルやテストは指定されていません。まず SDK の既存のドキュメントと、MCP サーバーおよびツールの設定または拡張ポイントを確認し、そのうえで、OS レベルの強制適用を前提とせずに capability controls を追加できるかどうかを判断してください。セキュリティガイダンス、ファイルおよびネットワークの制限例、実現可能なフックまたは設定ポイントが文書化され、適切な検証でカバーされていれば完了です。

索引モデルが issue の本文から書いたものです。

評価

技術スタック
python
領域
documentation, security
issue の種類
機能追加
難易度
5/5
見積もり時間
1週間以上
活発さ
活発
明瞭さ
おおむね明確
初心者へのやさしさ
35/100

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。