mcp-gate
mcp-gate
경로는 곧 요청이다. 루트 경계가 그 보증이다.
MCP 파일 액세스 서버는 모델이 루트— 즉 인가된 디렉터리 집합 — 를 통해 접근할 수 있는 파일을 강제한다. mcp-gate는 서버에게 루트 안에 머물라고 지시하는 것과 강제하는 것의 차이를 보여준다. 동일한 공격 묶음(attack suite)을 지시만 주어진 버전과, 모든 경로를 정규화하고 읽기 전에 경계를 기준으로 검사하는 버전 양쪽에 실행한다. 하나는 유출되고 다른 하나는 방어한다. 이 두 방향은 모두 CI에서 강제된다.
이것은 Anthropic의 고급 MCP 자료에 나오는 개념을 직접 구현한 것으로, 명시적으로 다음 세 가지를 보여주기 위해 작성되었다.
기능 | 어디에서 드러나는가 |
고급 MCP 서버 |
|
로그 및 진행 상황 | 모든 도구는 실행될 때마다 MCP 로깅 알림( |
액세스 제어 |
|
두 가지 모드
모드 | 판단 방식 | 결과 |
| 시스템 프롬프트 지시가 "루트 아래의 파일만 읽으라"고 하지만, 경로는 주어진 그대로 열린다. | 유출 — 순진한 경로 처리기는 의도적으로 최악의 대조군이다. |
| 각 경로는 디코딩되고, | 방어 — 경계를 벗어난 요청은 어떤 파일도 열리기 전에 거부된다. |
공격 묶음
공격 |
|
|
| 제공됨 ✓ | 제공됨 ✓ |
| 유출 | 차단됨 |
| 유출 | 차단됨 |
| 유출 | 차단됨 |
| 유출 | 차단됨 |
direct_ask가 두 모드 모두에서 성공하는 점이 기만적인 부분이다. 프롬프트 계층 보안에 대한 빠른 수동 테스트는 안전해 보이지만, 시도하지 않은 공격에서는 실패한다.
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 attack캡처된 출력은 RESULTS.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