QWED-MCP
OfficialThis MCP server lets an AI client execute trusted Python verification code and monitor longer background verification jobs.
Run Python code in a subprocess with restricted environment variables, e.g. QWED verification scripts using math, logic, finance, legal, SQL, or AST analysis libraries.
Execute code asynchronously with
execute_python_codeby settingbackground: true, which returns a job ID for long-running checks.Check the status and output of an asynchronous job using
execute_python_code's companion toolverify_status(schema name:verification_status) with the returnedjob_id.Supports deterministic verification workflows locally via Python rather than relying on removed
verify_*tools.Caution: code runs with server privileges, so inputs must be trusted.
Click on "Deploy 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-MCP Verify 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.tech/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.3)
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)
qwedai.comremoved from the trusted skill source domains (#71)Requires
mcp>=1.30.0,<2. MCP SDK 1.30.0 patches GHSA-84m7-p3x7-pcfv, GHSA-rwrf-2pqf-9j8j and GHSA-5h93-6whr-6q8j; for GHSA-w4fh-qvv9-3v23, HTTP servers that use the SDK's bearer authentication must also setvalidate_token_resource=True. qwed-mcp runs over stdio and uses neither the HTTP transports nor bearer authentication. MCP SDK 2.x removed the server API qwed-mcp usesReports its own version to MCP clients during initialisation
š§ 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.
Inputs: code (required), background.
verification_statusB
Check the execution status and output of a background verification task.
Inputs: job_id (required).
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelogā¦
TDQS
Scored across 2 tools
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
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.
Paid deterministic data-quality and execution-verification tools for AI agents.
Jailbreak-proof AI guardrails. Automated Reasoning SMT solver, not an LLM. ZK proofs included.
Related MCP Servers
- AlicenseAqualityBmaintenanceDeterministic AI safety policy engine with Z3 formal verification. Write, verify, simulate, and enforce machine-verifiable safety constraints for AI agents. Completely outside the LLM.1198 PyPI27Apache 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 gradedqualityCmaintenanceEnables safe execution of Python code with AI assistance and integration with Model Context Protocol tools.1-
- AlicenseNot gradedqualityDmaintenanceEnables AI agents to execute arbitrary Python code securely in a sandboxed environment with resource limits and security constraints via MCP protocol.MIT