QWED-MCP
OfficialThe QWED-MCP server provides deterministic verification capabilities to AI assistants (e.g., Claude Desktop, VS Code) by executing Python code locally in a controlled subprocess environment.
Core Tools:
execute_python_code: Run arbitrary Python scripts in a subprocess with restricted environment variables. Supports synchronous execution (returns output directly) and asynchronous/background execution (setbackground=Trueto receive ajob_idfor long-running tasks).verification_status: Poll the status and retrieve the output of a previously submitted background job using itsjob_id.
Key Capabilities:
Deterministic Verification: Uses symbolic engines — SymPy (math), Z3 (formal logic), and AST analyzers (code security) — to provide 100% mathematically proven verification of LLM outputs, catching hallucinations reliably.
Financial Calculations: Verify compound interest, loan EMI, NPV, IRR, and other financial computations with full accuracy.
Code & Security Analysis: Run AST-based checks to detect security issues and SQL injection vulnerabilities.
Formal Logic Proofs: Use Z3 to formally prove or disprove logical assertions.
Fully Local & Private: All processing happens on the user's machine — no external API calls, no data sent to external servers, no logging or storage — making it suitable for sensitive or air-gapped environments.
Click on "Install Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@QWED-MCPVerify the Pythagorean theorem using Z3 solver"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
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-mcpRelated MCP server: SymPy Sandbox MCP
🚀 Setup with Claude Desktop
Step 1: Find your config file
OS | Path |
Windows |
|
macOS |
|
Linux |
|
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.1.
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 |
| 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 |
LLM writes SQL → might inject | Script uses |
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
Yes! Open source under Apache 2.0. Use it commercially, modify it, distribute it.
QWED-MCP works with any MCP-compatible client. VS Code with Claude extension supports MCP, so yes!
No. QWED-MCP runs entirely locally. No API keys, no cloud calls.
QWED-Core is the Python library. QWED-MCP wraps it as an MCP server so Claude can use it as a tool.
Yes! The server is extensible. Fork it and add your custom @mcp.tool() functions.
🗺️ Roadmap
✅ Released (v0.2.2)
Context bloat resolution (RFC-9728 compatibility)
Unified
execute_python_codeenvironmentSecure process isolation (env-restricted) and robust timeouts
Claude Desktop integration
Windows/macOS/Linux support
Hardened math sandbox: AST allowlist for expression evaluation (GHSA-2p69-jpm6-jrxh)
🚧 In Progress
verify_json— JSON Schema validation toolverify_finance— NPV/IRR/amortization toolCursor IDE integration guide
🔮 Planned
verify_legal— Deadline and liability verificationverify_statistics— Hypothesis test validationSSE (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 | |
Tools Reference | |
Examples | |
Troubleshooting | |
MCP Protocol |
🔗 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
Available Tools
2 toolsexecute_python_codeA
Executes Python code in a subprocess with restricted environment variables. Note: This runs with server privileges; ensure inputs are trusted.
| Name | Required | Description | Default |
|---|---|---|---|
| code | Yes | The Python code to execute. | |
| background | No | Execute asynchronously in the background and return a tracking job_id. Set to True for heavy logic verifications. |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
Discloses restricted environment and server privileges, which are important for safety. However, without annotations, it lacks details on specific restrictions, side effects, or error handling.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
Two concise sentences: one for core action, one for important caution. No extraneous information.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Lacks description of return values or output format, especially important since no output schema is provided. Does not explain error behavior or what happens in synchronous vs asynchronous execution.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Both parameters are fully described in the schema (100% coverage). The tool description does not add much beyond the schema, but it reinforces the background parameter's purpose for async tasks.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states the tool executes Python code in a subprocess with restricted environment variables. It distinguishes itself from the sibling tool 'verification_status' by implying that background execution returns a job_id for status checking.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
Provides a security caution about server privileges and trusted inputs. The background parameter description advises using it for heavy logic verifications, linking to the sibling tool for status checks.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
verification_statusB
Check the execution status and output of a background verification task.
| Name | Required | Description | Default |
|---|---|---|---|
| job_id | Yes | The UUID returned by execute_python_code when background=True. |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
No annotations provided, and the description only states a read operation without detailing behavior on invalid job_id, output format, or safety of repeated calls.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
Single sentence with zero waste, directly stating the tool's purpose.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
The description lacks details on output structure, possible status values, error handling, or pagination, leaving the agent underinformed for a status check tool with no output schema.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema description covers the job_id parameter fully; tool description adds no additional meaning beyond the schema, so baseline of 3 applies.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description 'Check the execution status and output of a background verification task' uses a specific verb ('check') and resource ('execution status and output of a background verification task'), clearly distinguishing it from sibling tool execute_python_code.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description implies use after executing a background task, but lacks explicit guidance on when to use vs alternatives, scenarios to avoid, or prerequisites.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections. Dates show when Glama detected each change.
2 tool updates
v0.2.0- First observed
execute_python_code - First observed
verification_status
TDQS
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.
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.
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.
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
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Related MCP Connectors
Deterministic reasoning stack for AI agents: simulate, decide & compute, plus cross-domain tools.
Proves AI-generated Python does what you asked: lint, types, security, sandbox run, exact fixes.
Precision math engine for AI agents. 203 exact methods. Zero hallucination.
Jailbreak-proof AI guardrails. Automated Reasoning SMT solver, not an LLM. ZK proofs included.
Related MCP Servers
- AlicenseAqualityAmaintenanceDeterministic AI safety policy engine with Z3 formal verification. Write, verify, simulate, and enforce machine-verifiable safety constraints for AI agents. Completely outside the LLM.616Apache 2.0
- AlicenseAqualityDmaintenanceA secure mathematical computation sandbox that enables LLMs to perform symbolic math operations like algebra, calculus, and equation solving via SymPy. It features low-latency execution through pre-warmed process pools and provides standardized JSON outputs for reliable agent integration.12MIT
- FlicenseNot gradedqualityDmaintenanceEnables safe execution of Python code with AI assistance and integration with Model Context Protocol tools.1-
- AlicenseNot gradedqualityCmaintenanceEnables AI agents to execute arbitrary Python code securely in a sandboxed environment with resource limits and security constraints via MCP protocol.MIT
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/QWED-AI/qwed-mcp'
If you have feedback or need assistance with the MCP directory API, please join our Discord server