QWED-MCP
Enables deterministic verification for AI assistants by executing Python code that uses symbolic engines like SymPy and Z3 for math, logic, and code analysis.
README
<div align="center"> <img src="assets/logo.svg" alt="QWED Logo - AI Verification Engine" width="80" height="80"> <h1>QWED-MCP 🔌</h1> <h3>Deterministic Verification for Claude Desktop & VS Code</h3>
</div>
MCP Server for QWED Verification — Bring deterministic verification to Claude Desktop, VS Code, and any MCP-compatible AI assistant.
📚 Full Documentation: docs.qwedai.com/mcp
⚡ Quick Install
pip install qwed-mcp
🚀 Setup with Claude Desktop
Step 1: Find your config file
| OS | Path |
|---|---|
| Windows | %APPDATA%\Claude\claude_desktop_config.json |
| macOS | ~/Library/Application Support/Claude/claude_desktop_config.json |
| Linux | ~/.config/Claude/claude_desktop_config.json |
Step 2: Add QWED-MCP
macOS/Linux:
{
"mcpServers": {
"qwed-verification": {
"command": "qwed-mcp"
}
}
}
Windows (use python -m):
{
"mcpServers": {
"qwed-verification": {
"command": "python",
"args": ["-m", "qwed_mcp.server"]
}
}
}
Step 3: Restart Claude Desktop
Quit completely (system tray → Quit) and reopen.
Step 4: Test it!
Ask Claude:
"Write a python script that verifies a 10,000 investment at 7.5% for 5 years using the
qwed_newmath engine, and run it usingexecute_python_code."
⚠️ Migration Note: Deprecation of verify_* Tools
To solve "context bloat" and align with the new MCP standard (RFC-9728), all 1:1 functional tools (e.g., verify_math, verify_sql, verify_code) have been removed as of v0.2.0.
They have been replaced with a single, highly capable tool:
👉 execute_python_code
Before:
"Use
verify_mathto check this formula." (Claude loads 14 different tool schemas into context)
After:
"Use
execute_python_codeto write and run a script that importsqwed_new.engines.math_engineto verify..." (Claude loads 1 tool schema into context)
If you see an "Unknown tool" error, it means Claude is trying to use a legacy tool. Simply tell Claude: "The verify_* tools are removed. Use execute_python_code to natively write and run a Python verification script."
🔧 Available Tools
| Tool | Description | Use Case |
|---|---|---|
execute_python_code |
Subprocess Execution | The single entrypoint for all QWED capabilities. Executes dynamically generated Python code in a subprocess with restricted environment variables. Note: Runs with server privileges; ensure inputs are trusted. |
💡 Example Prompts for Claude
Note: Claude already knows how to use QWED natively via standard Python imports.
Financial Calculations
A bank says: "Invest $10,000 at 7.5% compounded quarterly for 5 years = $14,356.29"
Please write a short Python script using the standard compound interest formula to verify this, and run it with execute_python_code.
Loan EMI Verification
Verify: ₹10,00,000 loan at 9% for 5 years = EMI of ₹20,758
Write a python script importing necessary tools to verify this EMI calculation, and execute it using execute_python_code.
Complex Reasoning Workflows (The Power of Python)
Read the user terms in the attached document.
1. Use execute_python_code to extract and verify the legal clauses using qwed_legal.
2. In the same script, verify if the referenced financial penalties align with the allowed boundaries.
🏗️ How It Works
┌───────────────────────────────────────────┐
│ Claude Desktop / VS Code │
│ (MCP Client) │
└─────────────────┬─────────────────────────┘
│ MCP Protocol (JSON-RPC)
▼
┌───────────────────────────────────────────┐
│ QWED-MCP Server │
├───────────────────────────────────────────┤
│ execute_python_code() │
│ └─► Subprocess Execution (Restricted Env)│
│ └─► Native QWED library execution │
└───────────────────────────────────────────┘
🎯 Why QWED-MCP?
Note: Subprocess execution provides answers/checks purely based on what QWED SDK methods are invoked inside the executed scripts. Execution itself does not guarantee injection detection without specific SDK calls.
| Without QWED-MCP | With QWED-MCP |
|---|---|
| LLM calculates → 95% correct | Executes Python script calling qwed_finance → 100% correct |
| LLM writes SQL → might inject | Script uses qwed_new analyzer → injection detected |
| LLM reasons → might be wrong | Z3 solver executed via SDK → formally proven |
| LLM codes → might be unsafe | AST check script executed → security checked |
💡 What QWED-MCP Is (and Isn't)
✅ QWED-MCP IS:
- MCP Server that adds verification tools to Claude Desktop and VS Code
- Deterministic — uses SymPy (math), Z3 (logic), AST (code) for exact verification
- Open source — works with any MCP-compatible AI assistant
- A safety layer — catches LLM hallucinations in real-time
❌ QWED-MCP is NOT:
A replacement for Claude— it enhances Claude with verification toolsA chatbot— it's a backend server that Claude callsInternet-connected— all verification happens locallyA fine-tuned model— uses symbolic engines, not ML
Think of QWED-MCP as giving Claude a "calculator" for math and a "theorem prover" for logic.
Claude reasons. QWED-MCP verifies.
🆚 How We're Different from Other MCP Servers
| Aspect | Other MCP Servers | QWED-MCP |
|---|---|---|
| Purpose | Connect to APIs, databases, files | Verify LLM outputs |
| Approach | Fetch external data | Compute deterministic proofs |
| Engines | API wrappers | SymPy, Z3, AST analyzers |
| Accuracy | Depends on data source | 100% mathematically proven |
| Offline | Often need internet | Fully local, no APIs |
With Claude Desktop
┌───────────────────┐ ┌───────────────────────┐ ┌───────────────────┐
│ Claude │ │ QWED-MCP │ │ Verified Answer │
│ "What's d/dx x³?" │ ──► │ execute_python_code() │ ──► │ "3x²" ✓ │
│ "Write script to │ │ Runs SymPy natively │ │ (STDOUT Captured) │
│ check." │ └───────────────────────┘ └───────────────────┘
└───────────────────┘
🔒 Security & Privacy
All verification happens locally. Nothing is sent to external servers.
| Concern | QWED-MCP Approach |
|---|---|
| Data Transmission | ❌ No external API calls |
| Storage | ❌ Nothing logged or stored |
| Dependencies | ✅ Local engines (SymPy, Z3) |
| Code Analysis | ✅ Your code never leaves your machine |
Perfect for:
- Enterprises with strict security policies
- Air-gapped development environments
- Sensitive code review workflows
❓ FAQ
<details> <summary><b>Is QWED-MCP free?</b></summary>
Yes! Open source under Apache 2.0. Use it commercially, modify it, distribute it. </details>
<details> <summary><b>Does it work with VS Code Copilot?</b></summary>
QWED-MCP works with any MCP-compatible client. VS Code with Claude extension supports MCP, so yes! </details>
<details> <summary><b>Do I need an API key?</b></summary>
No. QWED-MCP runs entirely locally. No API keys, no cloud calls. </details>
<details> <summary><b>What's the difference between this and QWED-Core?</b></summary>
QWED-Core is the Python library. QWED-MCP wraps it as an MCP server so Claude can use it as a tool. </details>
<details> <summary><b>Can I add my own verification tools?</b></summary>
Yes! The server is extensible. Fork it and add your custom @mcp.tool() functions.
</details>
🗺️ Roadmap
✅ Released (v0.2.0)
- [x] Context bloat resolution (RFC-9728 compatibility)
- [x] Unified
execute_python_codeenvironment - [x] Secure process isolation (env-restricted) and robust timeouts
- [x] Claude Desktop integration
- [x] Windows/macOS/Linux support
🚧 In Progress
- [ ]
verify_json— JSON Schema validation tool - [ ]
verify_finance— NPV/IRR/amortization tool - [ ] Cursor IDE integration guide
🔮 Planned
- [ ]
verify_legal— Deadline and liability verification - [ ]
verify_statistics— Hypothesis test validation - [ ] SSE (Server-Sent Events) transport for web UIs
- [ ] TypeScript implementation
📁 Examples
See the examples/ folder for:
- Python client usage
- Sample verification scripts
- Integration examples
🛠️ Development
# Clone
git clone https://github.com/QWED-AI/qwed-mcp.git
cd qwed-mcp
# Install with dev dependencies
pip install -e ".[dev]"
# Run tests
pytest tests/ -v
# Format code
black src/
📖 Documentation
| Resource | Link |
|---|---|
| Full Docs | docs.qwedai.com/mcp |
| Tools Reference | docs.qwedai.com/mcp/tools |
| Examples | docs.qwedai.com/mcp/examples |
| Troubleshooting | docs.qwedai.com/mcp/troubleshooting |
| MCP Protocol | modelcontextprotocol.io |
🔗 Related Projects
- QWED Core — github.com/QWED-AI/qwed-verification
- QWED-UCP — github.com/QWED-AI/qwed-ucp
- QWED Open Responses — github.com/QWED-AI/qwed-open-responses
📄 License
Apache 2.0 — See LICENSE
<p align="center"> <b>Built by <a href="https://qwedai.com">QWED AI</a></b><br> <i>Making AI outputs trustworthy through formal verification</i> </p>
推荐服务器
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 模型以安全和受控的方式获取实时的网络信息。