mcp-gate
mcp-gate
パスはリクエストである。ルートの境界が保証である。
MCP ファイルアクセスサーバーは、モデルが触れてよいファイルを roots(許可されたディレクトリの集合)によって強制します。mcp-gate は、サーバーに「ルート内に留まる」と指示することと、強制することの違いを示します。同じ攻撃スイートを、指示しか持たないバージョンと、読み取り前にすべてのパスを正規化して境界と照合するバージョンの両方に対して実行します。一方は漏えいし、もう一方は守ります。両方向が CI で強制されます。
これは、Anthropic の高度な MCP 教材の概念を独立して実装したもので、次の 3 点を明示的に示すために書かれています。
機能 | 確認できる場所 |
高度な MCP サーバー |
|
ログと進捗 | すべてのツールは、実行時に MCP のログ通知( |
アクセス制御 |
|
2つのモード
モード | 判定方法 | 結果 |
| システムプロンプトの指示は「roots 配下のファイルのみを読み取る」と言うが、パスは渡されたとおりに開かれます。 | 漏れる — 素朴なパスハンドラーは、意図的に最悪のケースの対照となっています。 |
| 各パスはデコードされ、 | 漏れない — 範囲外のリクエストは、ファイルを開く前に拒否されます。 |
攻撃スイート
攻撃 |
|
|
| 配信 ✓ | 配信 ✓ |
| 漏れる | ブロック |
| 漏れる | ブロック |
| 漏れる | ブロック |
| 漏れる | ブロック |
プロンプト層のセキュリティを手短に手動テストすると安全そうに見えるが、試していない攻撃で破綻してしまうためです。
Related MCP server: personal-mcp-bridge
ゲート(CIによる双方向強制)
python -m mcp_gate gate boundary # exit 0 only if 0 escapes
python -m mcp_gate gate prompt # exit 0 only if the leak is still demonstrated
python -m mcp_gate suite # both halves must holdgate prompt が漏れないということは、デモが空虚になったことを意味します(安全でない側も通ってしまうならば、「安全」な結果は無意味だからです)。そのため CI は それ もビルド失敗として扱います。
クイックスタート
python -m venv .venv && source .venv/bin/activate
pip install -e ".[dev]"
pytest -q
python -m mcp_gate gate boundary
python -m mcp_gate gate prompt
python -m mcp_gate suiteライブの MCP サーバーとクライアントのデモを実行します(サンプリングツールには pip install -e ".[demo]" と、環境内の ANTHROPIC_API_KEY が必要です):
python -m mcp_gate serve ./data/sandbox # start the server over stdio
python -m mcp_gate.client ./data/sandbox # drive it: logs, progress, sampling, a blocked attackRESULTS.md にキャプチャされた出力があります。そこにあるすべてのブロックは実際のコマンド出力であり、scripts/make_results.py によって再生成され、手動編集されたものではありません。
注意
data/配下のデータはすべて架空です。data/out_of_bounds/secret.txtは「サーバーが決して供給してはならないファイル」を示すラベルの付いた代役です。この
-gateシリーズの一部: 自作のゲートを通過するまで何も出すことはありません。
This server cannot be installed
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Related MCP Servers
- FlicenseAqualityDmaintenanceProvides safe local file operations through MCP, including reading, writing, searching, organizing, and protected deletion with configurable path restrictions.122
- AlicenseNot gradedqualityBmaintenanceEnables safe, read-only browsing of allowlisted local directories through MCP, providing tools to list roots, read files, and search text.MIT
- AlicenseNot gradedqualityCmaintenanceA drop-in replacement for the blocked Filesystem MCP server that provides standard file operations with symlink hardening, enabling tools like read, write, and directory listing.MIT
- FlicenseNot gradedqualityBmaintenanceProvides safe, allowlisted local filesystem access for MCP-compatible AI clients, enabling directory listing, file reading/writing (with byte limits), and text search while blocking paths outside approved roots and symlink escapes.
Related MCP Connectors
Static MCP manifest and tool-policy security preflight with signed input-redacted receipts
Fail-closed action authorization, MCP risk scanning, x402 checks, and signed receipts.
Agent-native MCP server over the public saagarpatel.dev corpus. Read-only, stateless.
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/jbisaccia-9/mcp-gate'
If you have feedback or need assistance with the MCP directory API, please join our Discord server