VerifierMCP
An MCP server that gives any LLM the power to check its own work. Instead of trusting a model's arithmetic, regex, JSON or "the code prints X", the model can call a tool and verify it. Six verification tools over the Model Context Protocol: symbolic math, sandboxed code execution, SQL checking, JSON-Schema validation, dimensional analysis, and regex testing.
Built with the official MCP Python SDK (FastMCP). Works in Claude Desktop and any MCP client over stdio, or remotely over streamable HTTP (e.g. behind Amazon Bedrock AgentCore Gateway).
Install
| Where | How |
|---|---|
| PyPI | pip install verifier-mcp → run verifier-mcp (pypi.org/project/verifier-mcp) |
| uv (no install) | uvx verifier-mcp |
| Official MCP Registry | listed as io.github.Arashomranpour/verifier-mcp, so registry-aware MCP clients can discover it |
Why it matters
LLMs are confidently wrong about exactly the things that are mechanically checkable:
(x+1)² = x²+1, a regex that doesn't quite match, a SQL query with the wrong JOIN, JSON that violates its schema, a unit
slip, "this function returns 5050". VerifierMCP turns each of those into a tool call, so an
agent can replace an assertion with a verified fact.
The tools
| Tool | Checks | Engine |
|---|---|---|
verify_math |
Is an equation an identity? Does a claimed result hold? | SymPy |
run_code |
What does this Python snippet actually output? | sandboxed subprocess |
validate_schema |
Does this JSON conform to its JSON Schema? | jsonschema (Draft 2020-12) |
check_units |
Is this quantity/equation dimensionally correct? | Pint |
test_regex |
Does this regex match/reject the right cases? | re |
verify_sql |
Is this SQL valid for my dialect? What does it return on sample data? Does it match the expected rows? | sqlglot + in-memory SQLite |
Each tool body lives in src/verifier_mcp/tools/ as a pure
function, so it is unit-tested without the protocol and reused by the web playground.
Quickstart
pip install verifier-mcp # or: pip install "verifier-mcp[web]" for the playground
# Run the MCP server over stdio (what Claude Desktop launches)
verifier-mcp
# Or serve it over HTTP (MCP streamable transport on :8000/mcp)
verifier-mcp --http
# See it in action — the visual playground (needs the [web] extra)
uvicorn verifier_mcp.playground:app --port 8080 # http://localhost:8080
Connect to Claude Desktop
Add to claude_desktop_config.json:
{
"mcpServers": {
"verifier": {
"command": "uvx",
"args": ["verifier-mcp"]
}
}
}
Works on Windows, macOS and Linux (CI tests all three). On Windows, if uvx isn't installed,
pip install verifier-mcp and use "command": "python", "args": ["-m", "verifier_mcp.server"]
(with the full path to python.exe if needed).
Restart Claude Desktop and ask it something like "Is (x+1)² equal to x²+1? Use the verifier."
— it will call verify_math and come back with the checked answer.
Self-checking agent demo (Groq + MCP)
examples/self_checking_agent.py connects a Groq LLM to
this server over real MCP (via langchain-mcp-adapters), instructs it to verify before
asserting, and watches it catch its own mistake:
pip install -r requirements-demo.txt
export GROQ_API_KEY=gsk_... # real Groq agent
python examples/self_checking_agent.py
python examples/self_checking_agent.py --offline # no key: scripted LLM, REAL MCP verification
[offline] Question: Is (x+1)^2 equal to x^2 + 1? If not, what is the correct expansion?
[Assistant] draft answer: "(x+1)^2 = x**2 + 1"
→ verify_math((x+1)**2, claimed_result=x**2 + 1) [real MCP call]
MCP result: verified=False — expression simplifies to (x + 1)**2, not x**2 + 1
→ verify_math((x+1)**2, claimed_result=x**2 + 2*x + 1) [real MCP call]
MCP result: verified=True
[Assistant] Corrected: (x+1)^2 = x^2 + 2x + 1 — verified, not x^2 + 1.
Deploy remotely (Amazon Bedrock AgentCore Gateway)
The HTTP transport (--http, container in Dockerfile) exposes a standard MCP
endpoint at /mcp. Point AgentCore Gateway at it to turn these verifiers into tools any
Bedrock agent can call:
docker build -t verifier-mcp .
docker run -p 8000:8000 verifier-mcp # MCP over HTTP at http://localhost:8000/mcp
SQL verification
verify_sql checks syntax with sqlglot for many dialects
(sqlite, postgres, mysql, bigquery, snowflake, tsql, duckdb, ...). It then transpiles
the query to SQLite and runs it, after your setup_sql (CREATE TABLE / INSERT), in a throwaway
in-memory database. ATTACH, extension loading and file-touching PRAGMAs are blocked and
execution is time-limited. Pass expected_rows to get matches_expected plus a diff of missing
and unexpected rows (order-insensitive unless ordered=true).
{"query": "SELECT name FROM users WHERE name ILIKE 'a%'", "dialect": "postgres",
"setup_sql": "CREATE TABLE users (id INT, name TEXT); INSERT INTO users VALUES (1,'Ana'),(2,'Bo');",
"expected_rows": [["Ana"]]}
Execution is SQLite, so dialect-specific features that can't be transpiled are reported as errors; syntax checking still covers the original dialect.
The sandbox
run_code executes snippets in a fresh python -I -S subprocess with no inherited
environment, a temp working dir, and POSIX resource limits (CPU, memory, no forking,
no file writes) plus a wall-clock timeout. That is appropriate for a local dev tool. For
untrusted, multi-tenant use, run the whole server inside a container / gVisor / Firecracker —
the subprocess limits are defense-in-depth, not a complete jail. On Windows the
CPU/memory/fork limits are not applied (only the timeout), so prefer running it in a container there.
Releasing
Bump the version in pyproject.toml, src/verifier_mcp/__init__.py and server.json, then
publish a GitHub release. publish.yml builds the package,
publishes it to PyPI with Trusted Publishing (no tokens) and then to the Official MCP Registry
via GitHub OIDC.
Tests
pip install -e ".[dev]"
pytest -q # all pass — tool logic + MCP protocol registration/dispatch
Tech stack
Model Context Protocol (FastMCP) · SymPy · sqlglot · SQLite · jsonschema · Pint · FastAPI · Docker · GitHub Actions · Amazon Bedrock AgentCore Gateway–ready
License
MIT © Arash Omranpour
Metadata
Release files for verifier-mcp 0.2.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| verifier_mcp-0.2.0.tar.gz | 139.6 kB | With provenance | Details for verifier_mcp-0.2.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| verifier_mcp-0.2.0-py3-none-any.whl | Python 3 | none | any | Details for verifier_mcp-0.2.0-py3-none-any.whl |
Total release size: 163.3 kB
Release files / verifier_mcp-0.2.0.tar.gz
| Download URL | verifier_mcp-0.2.0.tar.gz |
|---|---|
| Size | 139.6 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
9846225ee9e426eb588eab7177a31e8e11065b125012ef6607f2585479f9ad53
|
|
BLAKE2b-256 checksum How to use checksums |
0e98d1165ac3d2a7f5e224c467cfa96b13c4ce237cacc8c90ec17a35ac300c6e
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Dec 4, 2026.
Transparency logRelease files / verifier_mcp-0.2.0-py3-none-any.whl
| Download URL | verifier_mcp-0.2.0-py3-none-any.whl |
|---|---|
| Size | 23.7 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
724f772708953118608a40f6abd150eaefb9292ba895769f5d3022e2ff92e53d
|
|
BLAKE2b-256 checksum How to use checksums |
23b06a375595b48e9c5b39af489af31596663fcea465f9d5078e74fc50d4c8d5
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Dec 4, 2026.
Transparency logSecurity for verifier-mcp 0.2.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
Full provenance
Both files in this release have been uploaded with provenance metadata.
Attestation for verifier_mcp-0.2.0.tar.gz
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Dec 4, 2026.
Transparency logA note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.