tooltrust-mcp
Scans MCP servers for prompt injection, supply chain attacks, excessive permissions, and code execution risks. Includes an offline blacklist that catches known-compromised packages like LiteLLM 1.82.7/1.82.8 and Trivy with zero latency.
README
ToolTrust Scanner
Scan MCP servers for prompt injection, data exfiltration, and privilege escalation before your AI agent blindly trusts them.
🚨 Urgent Security Update (March 24, 2026) ToolTrust now detects and blocks the LiteLLM / TeamPCP supply chain exploit. If you are adding MCP servers that rely on litellm (v1.82.7/8), ToolTrust will trigger a CRITICAL Grade F warning and block installation to protect your SSH/AWS keys.

🤖 Let your AI agent scan its own tools
Add ToolTrust as an MCP server in your .mcp.json and your agent can audit every tool it has access to:
{
"mcpServers": {
"tooltrust": {
"command": "npx",
"args": ["-y", "tooltrust-mcp"]
}
}
}
Then ask your agent to run tooltrust_scan_config — it reads your MCP config and scans all servers in parallel.
| Tool | Description |
|---|---|
tooltrust_scan_config |
Scan all servers in your .mcp.json or ~/.claude.json in parallel |
tooltrust_scan_server |
Launch and scan a specific MCP server |
tooltrust_scanner_scan |
Scan a JSON blob of tool definitions |
tooltrust_lookup |
Look up a server's trust grade from the ToolTrust Directory |
tooltrust_list_rules |
List all 12 security rules with IDs and descriptions |
💻 CLI
# Install
curl -sfL https://raw.githubusercontent.com/AgentSafe-AI/tooltrust-scanner/main/install.sh | bash
# Scan any MCP server
tooltrust-scanner scan --server "npx -y @modelcontextprotocol/server-filesystem /tmp"
# Scan-then-install: gate checks a server before adding it to your config
tooltrust-scanner gate @modelcontextprotocol/server-memory -- /tmp
<details> <summary>Other install methods</summary>
# Go install
go install github.com/AgentSafe-AI/tooltrust-scanner/cmd/tooltrust-scanner@latest
# Homebrew
brew install AgentSafe-AI/tap/tooltrust-scanner
# Specific version
curl -sfL https://raw.githubusercontent.com/AgentSafe-AI/tooltrust-scanner/main/install.sh | VERSION=vX.Y.Z bash
</details>
🚪 Gate: scan-before-install
tooltrust-scanner gate scans an MCP server before installing it. Grade A/B auto-installs, C/D prompts for confirmation, F blocks entirely.
# Scan and install if safe (writes .mcp.json)
tooltrust-scanner gate @modelcontextprotocol/server-memory -- /tmp
# Dry run — scan only, don't install
tooltrust-scanner gate --dry-run @modelcontextprotocol/server-filesystem -- /tmp
# Block anything below grade B
tooltrust-scanner gate --block-on B @some/package
# Install to user config (~/.claude.json) instead of project
tooltrust-scanner gate --scope user @some/package
# Override the server name in config
tooltrust-scanner gate --name my-server @some/package
# Force install regardless of grade (with warning)
tooltrust-scanner gate --force @some/package
| Flag | Default | Description |
|---|---|---|
--name |
derived from package | Server name in config |
--dry-run |
false |
Scan only, don't install |
--block-on |
F |
Minimum grade that blocks: F, D, C, B |
--scope |
project |
project (.mcp.json) or user (~/.claude.json) |
--force |
false |
Bypass grade check |
--deep-scan |
false |
Enable AI-based semantic analysis |
--rules-dir |
built-in | Custom YAML rules directory |
Exit codes: 0 = installed (or dry-run), 1 = blocked by policy, 2 = error.
🔗 Pre-Hook Integration
Shell alias
Replace claude mcp add with tooltrust-scanner gate so every install is scanned first:
alias mcp-add='tooltrust-scanner gate'
# mcp-add @modelcontextprotocol/server-memory -- /tmp
Git pre-commit hook
If .mcp.json is checked into your repo, scan it on every commit:
# .git/hooks/pre-commit
#!/bin/sh
if git diff --cached --name-only | grep -q '\.mcp\.json'; then
tooltrust-scanner scan --input .mcp.json --fail-on block || exit 1
fi
🔍 What it catches
| ID | Severity | Detects |
|---|---|---|
| AS-001 | Critical | Prompt poisoning / injection in tool descriptions |
| AS-002 | High/Low | Excessive permissions (exec, network, db, fs) |
| AS-003 | High | Scope mismatch (name contradicts permissions) |
| AS-004 | High/Crit | Supply chain CVEs via OSV |
| AS-005 | High | Privilege escalation (admin scopes, sudo) |
| AS-006 | Critical | Arbitrary code execution |
| AS-007 | Info | Missing description or schema |
| AS-008 | Critical | Known-compromised package versions — offline blacklist (TeamPCP/litellm, trivy, langflow) with zero latency |
| AS-009 | Medium | Typosquatting (edit-distance impersonation) |
| AS-010 | Medium | Insecure secret handling in params |
| AS-011 | Low | Missing rate-limits or timeouts |
| AS-013 | High/Med | Tool shadowing (duplicate name hijacking) |
🤝 GitHub Actions
- name: Audit MCP Server
uses: AgentSafe-AI/tooltrust-scanner@main
with:
server: "npx -y @modelcontextprotocol/server-filesystem /tmp"
fail-on: "approval"
Developer guide · Contributing · Changelog · Security · License: MIT © 2026 AgentSafe-AI
推荐服务器
Baidu Map
百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。
Playwright MCP Server
一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。
Magic Component Platform (MCP)
一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。
Audiense Insights MCP Server
通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。
VeyraX
一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。
graphlit-mcp-server
模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。
Kagi MCP Server
一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。
e2b-mcp-server
使用 MCP 通过 e2b 运行代码。
Neon MCP Server
用于与 Neon 管理 API 和数据库交互的 MCP 服务器
Exa MCP Server
模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。