
trailofbits/mcp-context-protector
Developer tools이 페이지는 AI로 자동 번역되었습니다. 기술적인 세부 사항은 원문을 확인하세요. 원문 보기
trailofbits/mcp-context-protector는 [[T0]에서 가져온 MCP 서버 후보입니다.
개요
trailofbits/mcp-context-protector는 [[T0]에서 가져온 MCP 서버 후보입니다.
개요(AI 번역)
개요
MCP-Context-Protector는 신뢰할 수 없는 MCP 서버 실행과 관련된 위험, 예를 들어 라인 점프, 예상치 못한 서버 구성 변경, 기타 프롬프트 인젝션 공격을 해결하는 보안 래퍼입니다. 이러한 보안 통제를 래퍼를 통해 구현하면(도구 설치 전에 실행되는 스캐너나 MCP 호스트 앱에 보안 기능을 추가하는 방식이 아닌) 집행이 간소화되고 모든 MCP 앱과의 보편적 호환성을 보장합니다.
특징
- 서버 구성의 신뢰 우선 핀
- 승인되지 않은 구성 변경 자동 차단
- 가드레일 스캔 및 도구 응답 격리
- ANSI 제어 문자 소독
mcp.json파일 편집 보조
퀵스타트
설치:
mcp-context-protector를 더 쉽게 실행하기 위해 mcp-context-protector.sh를 업데이트하여 uv로 가는 전체 경로를 포함하는 것을 권장합니다. 일부 MCP 클라이언트, 특히 Claude Desktop은 MCP 서버를 실행할 때 PATH 환경 변수를 최소한의 경로로 대체하여 claude_desktop_config.json 파일이 다루기 어렵고 유지보수가 어려워질 수 있습니다.
이 페이지는 AI로 자동 번역되었습니다. 기술적인 세부 사항은 원문을 확인하세요.
README
원문 README의 일부입니다. 원문 보기.
mcp-context-protector
Overview
mcp-context-protector is a security wrapper for MCP servers that addresses risks associated with running untrusted MCP servers, including line jumping, unexpected server configuration changes, and other prompt injection attacks. Implementing these security controls through a wrapper (rather than through a scanner that runs before a tool is installed or by adding security features to an MCP host app) streamlines enforcement and ensures universal compatibility with all MCP apps.
Features
- Trust-on-first-use pinning of server configurations
- Automatic blocking of unapproved configuration changes
- Guardrail scanning and quarantining of tool responses
- ANSI control character sanitization
- Assisted editing of
mcp.jsonfiles
Quickstart
Installation:
# Install uv
curl -LsSf https://astral.sh/uv/install.sh | sh
# Download mcp-context-protector
git clone https://github.com/trailofbits/mcp-context-protector
# Install dependencies
cd mcp-context-protector
uv sync
To make it easier to launch mcp-context-protector, we recommend updating mcp-context-protector.sh to contain the full path to uv. Some MCP clients, including Claude Desktop, replace the PATH environment variable with a minimal set of paths when launching MCP servers, which can make your claude_desktop_config.json file unwieldy and hard to maintain. Including a full path to uv in the launcher helps mitigate this problem.
Now configure your client to run your MCP servers through mcp-context-protector, and tool configuration pinning will automatically be enabled. Here’s a sample Claude Desktop config:
{
"mcpServers": {
"wrapped_acme_server": {
"command": "/path/to/mcp-context-protector/mcp-context-protector.sh",
"args": ["--command", "/path/to/node /path/to/acme/server.js"]
}
}
}
Alternatively, use --command-args to have mcp-context-protector concatenate all arguments that follow into one command string:
{
"mcpServers": {
"wrapped_acme_server": {
"command": "/path/to/mcp-context-protector/mcp-context-protector.sh",
"args": ["--command-args", "/path/to/node", "/path/to/acme/server.js", "--acme-enhanced"]
}
}
}
TL;DR: use --command-args if your MCP client mangles your stdio server command, but be careful with escaping of shell metacharacters.
Longer explanation: Some clients (including, as of this writing, Cursor) will construct their MCP server commands by concatenating the arguments together into a space-delimited string. That is, mcp-context-protector.sh --command "cmd arg1 arg2 --arg3" will become mcp-context-protector.sh --command cmd arg1 arg2 --arg3, and mcp-context-protector will think arg1 through --arg3 are meant as arguments to the wrapper, not to the child command. The --command-args option addresses this issue.
Security risks and controls
| Risk | Relevant control |
|---|
설치
docker run --rm -i)