T
trailofbits/mcp-context-protector
MCP security wrapper
在 GitHub 查看 ↗链接已于 2026-11-12 核查 · HTTP 200 · 打开的是厂商自己的官网
我们没有从该仓库取到可核对的安装命令,也没有公开的远端端点。这两样都没有时,我们不出配置——编一条出来比不给更糟。 各客户端的接法 →
- 来源明细
- 收录自 abordage/awesome-mcp 榜单(我们从中收集的条目之一) · 条目类型:MCP 服务
- 收录与活跃
- 收录于 2026-11-05 · 最近见到 2026-11-14 · 共见到 10 次 · 被 3 个来源列出
- 评分构成
- 综合分 303 · 3 个来源 · mcp
常见问题(答案都来自我们的记录)
它适合谁 / 用来做什么?
我们把它归在这些标签下: MCP 服务。标签来自条目自身,不是我们强加的分类。
谁维护它、还在更新吗?
我们收录于 2026-11-05;最近见到 2026-11-14。这里没有"官方认证"或"质量评级"——我们只记录来源与时间。
# mcp-context-protector
以下摘录自该仓库的 README(片段) · 在 GitHub 读完整 README →
## 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.json files
## 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 |
| Line jumping | Server configuration blocking, approval and pinning; guardrail evaluation of server instructions and tool descriptions |
| Server configuration changes/rug pulls | Server configuration pinning |
| User deception through ANSI control characters | ANSI control character sanitization |
| Other prompt injection attacks | Tool response guardrails and quarantining |
## Server configuration pinning
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.json files
## 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 |
| Line jumping | Server configuration blocking, approval and pinning; guardrail evaluation of server instructions and tool descriptions |
| Server configuration changes/rug pulls | Server configuration pinning |
| User deception through ANSI control characters | ANSI control character sanitization |
| Other prompt injection attacks | Tool response guardrails and quarantining |
## Server configuration pinning
收录徽章(可选)
想把收录标记放进 README 就复制这行,可选,不影响收录。
[](https://anclum.com/zh/s/trailofbits-mcp-context-protector/)
- 来源
- awesome · https://github.com/trailofbits/mcp-context-protector
- 按领域浏览
- MCP 服务
- 收录来源
- 3 个独立来源
- 收录于
- 今天
同类推荐
所属领域与标签
每个标签都能点进去看同类的全部条目。数字是当前库里的真实条数。