Skeptical MCP Tools: Server-Side Override for Zero-Knowledge Verification

arXiv:2611.36609 introduces the Skeptical Tools pattern for FastMCP servers wrapping CoSMeTIC zkSNARK provers, using 20 server-side validation, identity-stripping, and Redis state-override decisions to raise Qwen3-32B task completion from 70.2% to 93.0% across 6,000+ queries.
Skeptical MCP Tools: Server-Side Override for Zero-Knowledge Verification: arXiv:2611.36609 introduces the Skeptical Tools pattern for FastMCP servers wrapping CoSMeTIC zkSNARK provers, using 20 server-side validation, identity-stripping, and Redis state-override decisions to raise Qwen3-32B task completion from 70.2% to 93.0% across 6,000+ queries. Designed as a zero-dependency, open-source TypeScript architecture under the MIT License with native Model Context Protocol (MCP) support and deterministic phase state machines.
- Eliminates Identity Spoofing (`A3`): Interceptor strips any `user_id` supplied by the LLM and injects the authenticated session identity from Redis/Postgres.
- Corrects Wrong Proof Types (`B5`): `download_proof` and `verify_proof` discard model-supplied proof types and override them with the true prover type stored per `job_id` in Redis.
- +22.8pp Task Completion Lift: Raises Qwen3-32B completion from 70.2% (Config A) to 93.0% (Config D) with 100.0% response faithfulness across 6,000+ query executions.
- Tamper-Proof Trust Labels (`C1`): Backend appends deterministic tier badges (`[Cryptographically verified]`, `[Backed by CoSMeTIC prover]`) outside the LLM's generation control.
import { createAgent } from '@smoke-monkey/harness';const zkpAuditorAgent = createAgent({agentId: 'skeptical-zksnark-mcp-auditor',provider: 'openai-compatible',model: 'Qwen/Qwen3-32B',workspacePath: process.cwd(),permissions: {read_file: 'allow',write_file: 'allow',run_command: 'ask',},mcpServers: {cosmeticZkp: {command: 'python3',args: ['-m', 'cosmetic_skeptical_fastmcp', '--redis-ttl', '604800', '--enforce-trust-labels'],},},});async function verifyClinicalTrialInclusion() {const result = await zkpAuditorAgent.run('Prove my dataset hash was included in the Kolmogorov-Smirnov (KS) test, check prover job status, download the proof artifact, and verify the zkSNARK proof.');console.log('Verified zkSNARK Audit:', result.summary);}verifyClinicalTrialInclusion().catch(console.error);
Watch: Related Video Guides
Model Context Protocol Clearly Explained | MCP Beyond the Hype
Model Context Protocol (MCP) Explained for Beginners: AI Flight Booking Demo!
What Are Skeptical MCP Tools? Treating the LLM Strictly as an Intent Router
When an LLM agent calls a Model Context Protocol (MCP) tool that operates on cryptographic pipelines—such as CoSMeTIC multi-circuit zkSNARK clinical provers (Kolmogorov-Smirnov KS, Likelihood Ratio Test LRT, and logistic regression accuracy logistic_accuracy)—a single wrong parameter is fatal. Supplying the wrong proof type produces a cryptographically valid proof for the *wrong* statistical test, while hallucinating a user_id or job_id binds patient commitments to the wrong dataset.
Skeptical MCP Tools (arXiv:2611.36609) resolves this by treating the LLM strictly as a natural-language intent classifier, enforcing 20 deterministic server-side decisions across four layers inside a containerized Flask + FastMCP (8 tools) + Redis (7-day TTL) + PostgreSQL stack:
| Layer | Key Skeptical Decisions | Runtime Behavior |
|---|---|---|
| A. Input Skepticism | A1 normalize spellings, A2 server nonce, `A3` identity stripping, A4 code-built payloads | Discards model-supplied user_id; injects authenticated session ID |
| B. State Independence | B1 stateless per-request, B2 Redis 7d TTL, B4 job fallback, `B5` proof-type override, B6 prover auto-probe | download_proof & verify_proof override model proof types with Redis truth |
| C. Output Integrity | `C1` code-enforced trust labels, C4 structured errors, C5 artifact validation | Appends immutable [Cryptographically verified] or [Not backed...] tags |
| D. Security Boundaries | D1 session lock, D2 admin-only hash sync, D3 masked display, D4 path traversal check | Blocks directory escapes and chat-initiated hash overwrites |
Ablation Results Across 6,000+ Queries (Qwen 3 32B, Mistral 24B, Llama 3 8B)
Evaluated over 82 annotated queries (5 runs per query at temperature=0.0, totaling 6,000+ executions across Qwen 3 32B, Mistral Small 3.2 24B, and Llama 3 8B), turning on server-side skepticism transforms brittle multi-step proof lifecycles into reliable workflows without changing the underlying model.
| Configuration (Qwen 3 32B) | Tool Selection | Param Correctness | Overall Task Completion | Normal Ops (Source 1) | Multi-Step (Source 6) | Faithfulness |
|---|---|---|---|---|---|---|
| Config A (Naive Baseline) | 86.3% | 100.0% | 70.2% | 56.5% | 20.0% | 100.0% |
Config B (+A3, B1, B4 ID & Redis) | 89.0% | 100.0% | 84.5% | 87.8% | 70.8% | 100.0% |
Config C (+B5, B6 Proof Override) | 88.4% | 100.0% | 90.3% | 97.4% | 87.5% | 100.0% |
| Config D (Deterministic Templates) | 88.6% | 100.0% | 93.0% | 99.1% | 93.8% | 100.0% |
Even after excluding the 21 queries requiring a pre-seeded reference job, task completion rises by +23.1 percentage points (65.2% to 88.3%), proving that multi-step stateful verification belongs in the MCP server rather than in LLM context history.
Chat-Path Metadata Boundary Warning
While zkSNARK provers protect underlying patient records, dataset hashes, `job_id`s, and proof types returned in tool outputs still pass through the LLM's context window—exposing execution metadata to external inference providers unless hosted locally.
Implementing a Skeptical FastMCP Security Interceptor in Python
Apply the skeptical pattern to any high-stakes MCP server (payments, SQL, crypto, or infrastructure) by stripping identity parameters before tool execution and overriding mutable workflow metadata from Redis.
from fastmcp import FastMCP
mcp = FastMCP("cosmetic-skeptical-zkp")
@mcp.tool()
def verify_proof(job_id: str | None = None, proof_type: str | None = None, _session: dict = None) -> dict:
# A3: Never trust LLM-supplied user_id; bind strictly from authenticated server session
verified_uid = _session["authenticated_user_id"]
# B4: Fall back to latest job_id in Redis when omitted
resolved_job = job_id or redis.get(f"latest_job:{verified_uid}")
# B5: Skeptical override — discard model-supplied proof_type, read truth from Redis
true_proof_type = redis.hget(f"job:{resolved_job}", "proof_type")
# B6: Auto-probe KS, LRT, and logistic_accuracy provers
result = cosmetic_client.verify(job_id=resolved_job, proof_type=true_proof_type)
result["trust_label"] = "[Cryptographically verified]" if result["valid"] else "[Backed by CoSMeTIC prover]"
return resultDeploying Skeptical MCP Tools Inside Smoke Monkey Harness
Smoke Monkey Harness enforces strict workspace and command permission boundaries on the client side (read_file: 'allow', write_file: 'allow', run_command: 'ask'). Pairing that harness gating with Skeptical MCP servers on the backend creates defense-in-depth: even if an open-weight 8B–32B model omits job IDs or guesses wrong cryptographic schemas, deterministic server interceptors preserve 100% tool faithfulness.
Frequently Asked Questions
Q:What is the Skeptical MCP Tools pattern?
Introduced in arXiv:2611.36609, it treats the LLM strictly as an intent interpreter while MCP servers strip LLM-supplied user IDs, normalize spellings, inject nonces, and override mutable job or proof types from Redis/Postgres state.
Q:Why did Config D outperform Config C even with the same Qwen 3 32B model?
Config D replaced LLM-authored summaries on tool-backed turns with deterministic formatted templates, raising task completion from 90.3% to 93.0% (and multi-step Source 6 from 87.5% to 93.8%) by eliminating phrasing drift.
Q:Does Skeptical MCP protect metadata from cloud LLM providers?
No. CoSMeTIC zkSNARKs hide underlying clinical data inside the prover, but dataset hashes, job IDs, and proof types returned in MCP tool outputs still enter the LLM context—so sensitive workloads should run local weights.
Q:What happens if an LLM omits `job_id` or supplies the wrong `proof_type`?
Decision `B4` falls back to the user's latest Redis `job_id`, `B5` overrides the model's `proof_type` with the stored job metadata during download/verify, and `B6` probes all three provers automatically.
Related Alternatives & Comparisons
Related Architecture Guides
View all guidesBest Open Source Coding Agents in 2026: Free, Local & Fully Hackable Harnesses
MCP Server Security Best Practices: Hardening Model Context Protocol Agents in 2026
Open Source Coding Agent Harness: Build a Forkable, Local AI Engineering Runtime
Build with Smoke Monkey Harness
Zero dependencies. 24 built-in tools. Human-in-the-loop safety. 100% open source under the MIT License.