QWED-MCP 🔌
Deterministic Verification for Claude Desktop & VS Code
 ](https://hub.docker.com/r/qwedai/qwed-verification) ](https://hub.docker.com/r/qwedai/qwed-verification/tags)       ](https://github.com/QWED-AI/qwed-mcp) 
QWED验证的MCP服务器 --为Claude Desktop、VS Code和任何兼容MCP的AI助手带来确定性验证。
📚 完整文档: docs.qwedai.com/mcp
______________________________________________________________________
⚡ 快速安装
pip install qwed-mcp______________________________________________________________________
🚀 使用Claude Desktop进行设置
步骤1:查找配置文件
| 操作系统 | 路径 |
|---|---|
| 视窗 | %APPDATA%\Claude\claude_desktop_config.json |
| macOS | ~/Library/Application Support/Claude/claude_desktop_config.json |
| Linux | ~/.config/Claude/claude_desktop_config.json |
步骤2:添加QWED-MCP
macOS/Linux:
{
"mcpServers": {
"qwed-verification": {
"command": "qwed-mcp"
}
}
}Windows(使用python-m):
{
"mcpServers": {
"qwed-verification": {
"command": "python",
"args": ["-m", "qwed_mcp.server"]
}
}
}步骤3:重新启动克劳德桌面
完全退出(系统托盘→ 退出)并重新打开。
第四步:测试一下!
问克劳德:
“编写一个python脚本,使用qwed_new数学引擎,并使用execute_python_code."
______________________________________________________________________
⚠️ 迁移说明:弃用 verify_* 工具
为了解决“上下文膨胀”问题并与新的MCP标准(RFC-9728)保持一致。, verify_math, verify_sql, verify_code) 已删除 截至 v0.2.0.
它们已被一个功能强大的工具所取代: 👉 execute_python_code
之前:
“使用 verify_math 检查这个公式。“(Claude将14种不同的工具模式加载到上下文中)之后:
“使用execute_python_code编写并运行导入的脚本qwed_new.engines.math_engine以验证。..“(Claude将1个工具模式加载到上下文中)
如果你看到 "Unknown tool" 错误,这意味着克劳德正在尝试使用旧工具。告诉克劳德: *“The verify_* 工具被移除。使用 execute_python_code 本机编写和运行Python验证脚本。"*
______________________________________________________________________
🔧 可用工具
| 工具 | 描述 | 用例 |
|---|---|---|
execute_python_code | 子流程执行 | 所有QWED功能的单一入口点。在具有受限环境变量的子流程中执行动态生成的Python代码。注意:以服务器权限运行;确保输入可信。 |
______________________________________________________________________
💡 克劳德提示示例
注: Claude已经知道如何通过标准的Python导入原生使用QWED。
财务计算
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.贷款EMI验证
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.复杂推理工作流(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.______________________________________________________________________
🏗️ 运作原理
┌───────────────────────────────────────────┐
│ Claude Desktop / VS Code │
│ (MCP Client) │
└─────────────────┬─────────────────────────┘
│ MCP Protocol (JSON-RPC)
▼
┌───────────────────────────────────────────┐
│ QWED-MCP Server │
├───────────────────────────────────────────┤
│ execute_python_code() │
│ └─► Subprocess Execution (Restricted Env)│
│ └─► Native QWED library execution │
└───────────────────────────────────────────┘______________________________________________________________________
🎯 为什么选择QWED-MCP?
*注意:子进程执行纯粹基于在执行的脚本中调用的QWED SDK方法来提供答案/检查。在没有特定SDK调用的情况下,执行本身并不能保证注入检测。*
| 不带QWED-MCP | 带QWED-MCP |
|---|---|
| LLM计算→ 95% correct | 执行Python脚本调用 qwed_finance → 100%正确 |
| LLM编写SQL→ 可能会注入 | 脚本使用 qwed_new 分析器→ 检测到注射 |
| LLM原因→ 可能有误 | 通过SDK执行Z3求解器→ 正式证明 |
| LLM代码→ 可能不安全 | AST检查脚本已执行→ 安全检查 |
______________________________________________________________________
💡 什么是QWED-MCP(和不是)
✅ QWED-MCP为:
- MCP 服务器 为Claude Desktop和VS Code添加了验证工具
- 确定性的 --使用SymPy(数学)、Z3(逻辑)、AST(代码)进行精确验证
- 开源 --可与任何兼容MCP的AI助手配合使用
- 安全层 --实时捕捉LLM幻觉
❌ QWED-MCP不是:
- ~~克劳德的替代品~~——它用验证工具增强了克劳德的能力
- ~~聊天机器人~~--这是克劳德调用的后端服务器
- ~~已连接互联网~~--所有验证都在本地进行
- ~~微调模型~~--使用符号引擎,而不是ML
把QWED-MCP想象成给克劳德一个数学的“计算器”和一个逻辑的“定理证明器”。 克劳德的理由。QWED-MCP验证。
______________________________________________________________________
🆚 我们与其他MCP服务器有何不同
| 方面 | 其他MCP服务器 | QWED-MCP |
|---|---|---|
| 目的 | 连接到API、数据库、文件 | 验证LLM输出 |
| 方法 | 获取外部数据 | 计算确定性证明 |
| 发动机 | API包装器 | SymPy、Z3、AST分析仪 |
| 准确度 | 取决于数据来源 | 100%经过数学证明 |
| 离线 | 经常需要互联网 | 完全本地,没有API |
使用克劳德桌面
┌───────────────────┐ ┌───────────────────────┐ ┌───────────────────┐
│ Claude │ │ QWED-MCP │ │ Verified Answer │
│ "What's d/dx x³?" │ ──► │ execute_python_code() │ ──► │ "3x²" ✓ │
│ "Write script to │ │ Runs SymPy natively │ │ (STDOUT Captured) │
│ check." │ └───────────────────────┘ └───────────────────┘
└───────────────────┘______________________________________________________________________
🔒 安全与隐私
所有验证都在本地进行。不会向外部服务器发送任何内容。
| 关注 | QWED-MCP方法 |
|---|---|
| 数据传输 | ❌ 没有外部API调用 |
| 存储 | ❌ 未记录或存储任何内容 |
| 依赖项 | ✅ 本地引擎(SymPy、Z3) |
| 代码分析 | ✅ 你的代码永远不会离开你的机器 |
非常适合:
- 实施严格安全政策的企业
- 气隙开发环境
- 敏感代码审查工作流程
______________________________________________________________________
❓ 常见问题解答
Is QWED-MCP free?
对!Apache 2.0下的开源。在商业上使用它,修改它,分发它。
Does it work with VS Code Copilot?
QWED-MCP适用于任何兼容MCP的客户端。带Claude扩展的VS Code支持MCP,所以是的!
Do I need an API key?
否。QWED-MCP完全在本地运行。没有API密钥,没有云调用。
What's the difference between this and QWED-Core?
QWED Core是Python库。QWED-MCP将其包装为MCP服务器,以便Claude可以将其用作工具。
Can I add my own verification tools?
对!服务器是可扩展的。分叉并添加您的自定义 @mcp.tool() 功能。
______________________________________________________________________
🗺️ 路线图
✅ 发布(v0.2.0)
- \[x\] 上下文膨胀解决方案(兼容RFC-9728)
- \[x\] 统一
execute_python_code环境 - \[x\] 安全的进程隔离(环境限制)和健壮的超时
- \[x\] Claude桌面集成
- \[x\] Windows/macOS/Linux支持
🚧 进行中
- \[ \]
verify_json--JSON模式验证工具 - \[ \]
verify_finance--NPV/IRR/摊销工具 - \[\]光标IDE集成指南
🔮 计划的
- \[ \]
verify_legal--截止日期和责任验证 - \[ \]
verify_statistics--假设检验验证 - \[\]web UI的SSE(服务器发送事件)传输
- \[\]TypeScript实现
______________________________________________________________________
📁 示例
看 examples/ 文件夹用于:
- Python客户端使用
- 示例验证脚本
- 集成示例
______________________________________________________________________
🛠️ 发展
# 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/______________________________________________________________________
📖 文档
| 资源 | 链接 |
|---|---|
| 完整文档 | docs.qwedai.com/mcp |
| 工具参考 | docs.qwedai.com/mcp/tools |
| 示例 | docs.qwedai.com/mcp/examples |
| 故障排除 | docs.qwedai.com/mcp/troubleshooting |
| MCP协议 | 模型上下文协议.io |
______________________________________________________________________
🔗 相关项目
- QWED核心 —
- QWED-UCP —
- QWED开放式回答 —
______________________________________________________________________
📄 许可证
Apache 2.0——请参阅 许可证
______________________________________________________________________
Built by QWED AI
Making AI outputs trustworthy through formal verification
