QWED-MCP
Officialby QWED-AI
README.md
<div align="center">
<img src="assets/logo.png" alt="QWED Logo - AI Verification Engine" width="80" height="80">
<h1>QWED-MCP š</h1>
<h3>Deterministic Verification for Claude Desktop & VS Code</h3>
[](https://pypi.org/project/qwed-mcp/)
[](https://hub.docker.com/r/qwedai/qwed-verification)
[](https://hub.docker.com/r/qwedai/qwed-verification/tags)
[](https://www.cloudflare.com/)
[](https://snyk.io/test/github/QWED-AI/qwed-mcp)
[](https://docs.qwedai.com)
[](https://www.netlify.com)
[](https://opensource.org/licenses/Apache-2.0)
[](https://modelcontextprotocol.io)
[](https://github.com/QWED-AI/qwed-mcp)
[](https://github.com/QWED-AI/qwed-verification#%EF%B8%8F-what-does-verified-by-qwed-mean)
</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](https://docs.qwedai.com/docs/mcp/overview)
---
## ā” Quick Install
```bash
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:**
```json
{
"mcpServers": {
"qwed-verification": {
"command": "qwed-mcp"
}
}
}
```
**Windows (use python -m):**
```json
{
"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_new` math engine, and run it using `execute_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.1`.
They have been replaced with a single, highly capable tool:
**š `execute_python_code`**
**Before:**
> "Use `verify_math` to check this formula." (Claude loads 14 different tool schemas into context)
**After:**
> "Use `execute_python_code` to write and run a script that imports `qwed_new.engines.math_engine` to 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
```text
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
```text
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)
```text
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 tools
- ~~A chatbot~~ ā it's a backend server that Claude calls
- ~~Internet-connected~~ ā all verification happens locally
- ~~A 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.2)
- [x] Context bloat resolution (RFC-9728 compatibility)
- [x] Unified `execute_python_code` environment
- [x] Secure process isolation (env-restricted) and robust timeouts
- [x] Claude Desktop integration
- [x] Windows/macOS/Linux support
- [x] Hardened math sandbox: AST allowlist for expression evaluation (GHSA-2p69-jpm6-jrxh)
### š§ 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/`](./examples) folder for:
- Python client usage
- Sample verification scripts
- Integration examples
---
## š ļø Development
```bash
# 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](https://docs.qwedai.com/docs/mcp/overview) |
| Tools Reference | [docs.qwedai.com/mcp/tools](https://docs.qwedai.com/docs/mcp/tools) |
| Examples | [docs.qwedai.com/mcp/examples](https://docs.qwedai.com/docs/mcp/examples) |
| Troubleshooting | [docs.qwedai.com/mcp/troubleshooting](https://docs.qwedai.com/docs/mcp/troubleshooting) |
| MCP Protocol | [modelcontextprotocol.io](https://modelcontextprotocol.io) |
---
## š Related Projects
- **QWED Core** ā [github.com/QWED-AI/qwed-verification](https://github.com/QWED-AI/qwed-verification)
- **QWED-UCP** ā [github.com/QWED-AI/qwed-ucp](https://github.com/QWED-AI/qwed-ucp)
- **QWED Open Responses** ā [github.com/QWED-AI/qwed-open-responses](https://github.com/QWED-AI/qwed-open-responses)
---
## š License
Apache 2.0 ā See [LICENSE](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>
TDQS
B3.4/5.0
Scored across 2 tools
Disambiguation5/5
The two tools have clearly distinct purposes: one executes Python code, the other checks the status of a background task. There is no overlap in functionality.
Naming Consistency4/5
Both tools use snake_case, but one follows a verb_noun pattern (execute_python_code) while the other is noun_noun (verification_status). Slight inconsistency but still readable.
Tool Count2/5
With only 2 tools, the server feels very sparse for any meaningful functionality. A code execution server would typically need more tools for environment management, file I/O, etc.
Completeness2/5
The tool set lacks essential operations for a code execution server, such as managing environments, reading files, or handling dependencies. Only bare minimum provided.
Maintenance
ActivityMaintained
ResponsivenessSlow