Model Context Protocol (MCP) Server for QWED VerificationDocumentation Index
Fetch the complete documentation index at: https://docs.qwedai.com/llms.txt
Use this file to discover all available pages before exploring further.
Why QWED-MCP?
The problem
LLMs are powerful but unreliable for:- Mathematical calculations - They approximate, don’t compute
- Logical reasoning - They guess patterns, don’t prove
- Code security - They miss edge cases, don’t analyze
- SQL queries - They don’t validate, just generate
The solution
QWED-MCP gives AI assistants access to deterministic verification through a singleexecute_python_code tool. The LLM writes a Python script that imports the appropriate QWED SDK, and the MCP server runs it in a sandboxed subprocess.
| Without QWED-MCP | With QWED-MCP |
|---|---|
| Claude calculates → 95% correct | Executes Python script calling qwed_new math engine → 100% correct |
| Claude writes SQL → might inject | Script uses qwed_new SQL analyzer → injection detected |
| Claude reasons → might be wrong | Z3 solver executed via SDK → formally proven |
| Claude codes → might be unsafe | AST check script executed → security checked |
How it works
Available tools
| Tool | Description | Use case |
|---|---|---|
execute_python_code | Subprocess execution | The primary entry point for all QWED capabilities. Executes dynamically generated Python code with access to all QWED SDK libraries. Supports optional background=true for async execution. |
verification_status | Job status polling | Check the status and results of background verification jobs dispatched via execute_python_code with background=true. |
RiskBasedExecutionGateway before dispatch. The gateway validates arguments, runs code safety analysis, and enforces admin policy. Unknown tools are blocked by default.
In v0.1.x, QWED-MCP exposed individual tools like
verify_math, verify_logic, verify_code, and verify_sql. These were consolidated into execute_python_code in v0.2.0 to solve context bloat (RFC-9728 compatibility). See migration guide.Installation
From PyPI (recommended)
From source
Verify installation
Quick start
Claude Desktop setup
- Find your config file:
- Windows:
%APPDATA%\Claude\claude_desktop_config.json - macOS:
~/Library/Application Support/Claude/claude_desktop_config.json - Linux:
~/.config/Claude/claude_desktop_config.json
- Windows:
- Add QWED-MCP server:
- Restart Claude Desktop
- Test it! Ask Claude:
“Write a Python script that verifies a $10,000 investment at 7.5% for 5 years using the compound interest formula, and run it using execute_python_code.”
VS Code setup
- Install MCP extension (if not already)
- Add to settings.json:
- Restart VS Code
Python client
You can also use QWED-MCP programmatically:Configuration
Environment variables
| Variable | Description | Default |
|---|---|---|
QWED_MCP_TRUSTED_CODE_EXECUTION | Enable execute_python_code tool (true/false) | false |
QWED_LOG_LEVEL | Logging level (DEBUG, INFO, WARNING, ERROR) | INFO |
QWED_TIMEOUT | Tool execution timeout in seconds | 30 |
QWED_SKILL_MANIFEST | Path to a skill manifest JSON file. When set, the server validates the manifest at startup using SkillProvenanceGuard and refuses to start if verification fails | Not set |
Example with environment variables
Windows (PowerShell):Use cases
1. Financial calculations
Verify that AI-generated financial calculations are correct:2. Research validation
Ensure scientific claims are logically valid:3. Secure coding
Check AI-generated code for security issues:4. SQL security
Prevent SQL injection in generated queries:Links
- PyPI: pypi.org/project/qwed-mcp
- GitHub: github.com/QWED-AI/qwed-mcp
- Docker Hub (organization): hub.docker.com/orgs/qwedai/repositories
- Docker Hub (QWED Verification): qwedai/qwed-verification
- Docker Hub (QWED MCP): qwedai/qwed-mcp
- MCP Protocol: modelcontextprotocol.io
- QWED Core: QWED Verification Engine