Tool of Truth
MITM proxy MCP server that intercepts and verifies AI agent tool calls, detecting fabrication, tracking costs, verifying outcomes, and inferring user satisfaction.
README
Tool of Truth
Every tool call, proven.
Verification sentinel for AI agent tool usage. MITM proxy that intercepts all MCP tool calls, detects fabrication, tracks costs, verifies outcomes, and infers user satisfaction.
Features
| Feature | Status | Description |
|---|---|---|
| MITM Proxy | ✅ | Transparently intercepts all MCP tool calls |
| Fabrication Detection | ✅ | 7-signal deep analysis: trace, doc-similarity, timing, placeholders, contradictions |
| Trust Scoring | ✅ | Weighted 0-100 with fabrication cap |
| Cost Tracking | ✅ | Per-call cost for 8 providers |
| Token Counting | ✅ | Input/output tokens per call |
| Outcome Verification | ✅ | Compares tool result against user's original prompt |
| Skill Adherence | ✅ | Verifies workflow via manifests |
| User Satisfaction | ✅ | Infers satisfaction from follow-up messages |
| Receipts | ✅ | SHA-256 hashed, JSON + human-readable |
| Local Storage | ✅ | JSONL daily files + indexed lookup |
| Tool Transparency | ✅ | Shows what downstream tools actually do |
Quick Start
1. Install
npm install -g tooloftruth-mcp
2. Connect (Option A: Direct)
// Your agent's MCP config
{
"tooloftruth": {
"command": "tooloftruth-mcp"
}
}
3. Connect (Option B: Proxy — MITM mode)
// Your agent's MCP config — proxy a single downstream server
{
"firecrawl": { "command": "npx", "args": ["tooloftruth-mcp", "firecrawl"] }
}
Or proxy every local MCP server via ~/.tooloftruth/proxy.json:
// ~/.tooloftruth/proxy.json
{
"servers": {
"firecrawl": { "command": "npx", "args": ["firecrawl-mcp"] },
"github": { "command": "npx", "args": ["@modelcontextprotocol/server-github"] }
}
}
Skill Manifests (enforced)
Manifests in ~/.tooloftruth/manifests/<skill>.json gate tool calls:
{
"skill": "echo",
"version": "1.0.0",
"requires": {
"echo": { "tool": "echo", "must_be_called": true, "expected_args": { "message": "" } }
},
"outputRules": ["Output must contain \"Echo:\""],
"max_cost": 1.0
}
Undeclared tools are blocked (BLOCKED_BY_MANIFEST); arg/pattern/cost/output-rule violations are recorded and downgrade the verdict.
4. Use
You: Did you actually use firecrawl?
Agent: [calls tooloftruth_verify]
Agent: VERIFIED — firecrawl was called at 10:30:02, trust score 98/100, cost $0.03
You: How much did I spend on tools today?
Agent: [calls tooloftruth_cost]
Agent: Total: $0.47 across 12 tool calls
You: Was that result what I asked for?
Agent: [calls tooloftruth_outcome]
Agent: ALIGNED — tool result matches your request
You: That's wrong, try again
Agent: [calls tooloftruth_satisfaction]
Agent: User appears dissatisfied — result may be wrong
CLI
# Intercept and monitor non-MCP commands
tooloftruth -- gh api repos/user/repo
# One-shot status report (daemon health, receipts, cost, top tools)
tooloftruth status
Daemon
A launchd daemon watches .tooloftruth/receipts/, aggregates daily stats, and alerts on fabrications.
# Install the daemon (macOS)
launchctl load ~/Library/LaunchAgents/com.tooloftruth.daemon.plist
Stats are written to .tooloftruth/stats/YYYY-MM-DD.json.
Truth Scan
tooloftruth_truth_scan does real web verification of claims: Bing search (curl) → crawl4ai fetch → evidence extraction → verdict.
Sensitive-Data Detection
The daemon scans every new message and tool call for leaks, writing alerts with exact proof:
- Secrets: 24 gitleaks-style rules + entropy — AWS keys, GitHub/OpenAI/Google/Anthropic tokens, JWTs, private keys, DB connection strings, generic API keys, passwords
- PII: email, phone, SSN, credit card (Luhn-validated), IP, IBAN
- Prompt injection: ignore-previous-instructions, system-prompt reveal, jailbreak (DAN), XML tag injection
- Dangerous commands:
rm -rf /,curl | sh,ddto disk, base64-decode-to-shell, etc.
Alerts land in ~/.tooloftruth/alerts/ with redacted match, source, confidence, and surrounding context.
Deep scans: tooloftruth_gitleaks <repo> runs gitleaks (200+ rules) over a repo's git history with exact file:line proof.
Behavior Ledger
The daemon tracks per-session model, message/tool-call counts, error rate, token usage, and cost → ~/.tooloftruth/ledger/. Query via tooloftruth_ledger.
MCP Tools
| Tool | Description |
|---|---|
tooloftruth_verify |
Verify a specific tool was used |
tooloftruth_check |
Pre-flight: is tool installed/configured? |
tooloftruth_receipt |
Generate/view verification receipt |
tooloftruth_cost |
Cost breakdown by tool |
tooloftruth_history |
Search historical receipts |
tooloftruth_truth |
Full session truth report |
tooloftruth_satisfaction |
Infer user satisfaction from message |
tooloftruth_outcome |
Verify result matches user prompt |
tooloftruth_audit |
Cross-reference agent claims against actual tool calls |
tooloftruth_conversation |
View conversation log |
tooloftruth_truth_scan |
Web research + fact-check a claim |
tooloftruth_alerts |
List sensitive-data alerts (PII/secrets/injection/commands) |
tooloftruth_gitleaks |
Deep-scan a git repo for secrets |
tooloftruth_ledger |
Per-session behavior (model, errors, tokens, cost) |
How the MITM Proxy Works
Agent ←→ Tool of Truth ←→ MCP Server (downstream)
↓
Records everything
Runs deep fabrication checks
Verifies outcome alignment
Infers satisfaction
Generates receipts
Returns result unchanged
Storage
All data stays in your machine's home directory:
~/.tooloftruth/
├── config.json ← settings
├── index.json ← fast lookup index
├── proxy.json ← downstream server config
├── receipts/
│ ├── 2026-08-17.jsonl ← today's calls
│ └── ...
├── conversations/
│ └── 2026-08-17.jsonl ← claim/action conversations
└── stats/ ← daemon aggregations
├── 2026-08-17.json
└── ...
## Skill Manifests
Skills can attach verification manifests:
```json
{
"skill": "last-30-days",
"version": "2.1.0",
"requires": {
"github_mcp": {
"tool": "get_repo_stats",
"mustBeCalled": true
}
}
}
Development
git clone https://github.com/adigoel07/tooloftruth.git
cd tooloftruth
pnpm install
pnpm build
npx vitest run
License
MIT — use it, fork it, build on it.
Author
Built by adigoel07.
推荐服务器
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 模型以安全和受控的方式获取实时的网络信息。