Thoughtproof-mcp
Adversarial multi-model reasoning verification for AI agents. Claude, Grok, and DeepSeek challenge each decision — returns ALLOW or HOLD with JWKS-signed attestation. x402-gated on Base.
README
@pot-sdk2/x402
Decision verification hook for x402 payments — verifies whether an agent's payment decision is well-justified before settlement executes.
The Problem
x402 enables AI agents to pay for services autonomously. The facilitator verifies that the payment is valid (correct signature, sufficient balance, right network).
But nobody verifies whether the decision to pay was well-justified.
An agent can authorize a perfectly valid payment for a service it doesn't need, at a price it shouldn't accept, based on reasoning that wouldn't survive scrutiny.
The Solution
@pot-sdk2/x402 adds a beforeSettle hook to the x402 facilitator that runs ThoughtProof decision verification before settlement executes.
- Payment valid + decision strong → settle
- Payment valid + decision weak → hold
Install
npm install @pot-sdk2/x402 pot-sdk @x402/core
Quick Start
import { createThoughtProofHook } from '@pot-sdk2/x402';
import { x402Facilitator } from '@x402/core/facilitator';
import { registerExactEvmScheme } from '@x402/evm/exact/facilitator';
const facilitator = new x402Facilitator();
// Register your payment scheme
registerExactEvmScheme(facilitator, {
signer: evmSigner,
networks: 'eip155:8453', // Base
});
// Add ThoughtProof decision verification before settlement
facilitator.onBeforeSettle(createThoughtProofHook({
providers: [
{ name: 'anthropic', model: 'claude-sonnet-4-20250514', apiKey: process.env.ANTHROPIC_API_KEY! },
{ name: 'deepseek', model: 'deepseek-chat', apiKey: process.env.DEEPSEEK_API_KEY! },
],
stakeLevel: 'medium', // micro | low | medium | high | critical
classifyMateriality: true, // only block on material defects
debug: true,
}));
// Now settlement includes decision verification
const verifyResult = await facilitator.verify(paymentPayload, requirements);
if (verifyResult.isValid) {
// This will run ThoughtProof verification before settling
const settleResult = await facilitator.settle(paymentPayload, requirements);
}
Auto-Stake Detection
Don't want to set stake levels manually? Use createAutoStakeHook — it detects the payment amount and adjusts skepticism automatically:
import { createAutoStakeHook } from '@pot-sdk2/x402';
facilitator.onBeforeSettle(createAutoStakeHook({
providers: [...],
classifyMateriality: true,
}));
// $2.50 → micro (threshold 0.40, only material defects block)
// $149 → medium (threshold 0.60, proportional review)
// $5000 → critical (threshold 0.85, full adversarial)
Stake Levels
| Level | Threshold | Critic Mode | Example |
|---|---|---|---|
micro |
0.40 | Proportional — material defects only | $2.50 API batch |
low |
0.50 | Proportional — material defects + basic logic | $50 data purchase |
medium |
0.60 | Proportional — reasoning quality + evidence | $500 vendor selection |
high |
0.75 | Adversarial — full skepticism | $5K settlement |
critical |
0.85 | Adversarial — maximum scrutiny | $50K+ / regulated |
How It Works
Agent decides to pay
↓
x402 facilitator.verify() — payment valid?
↓
x402 facilitator.settle() — execute payment
↓
[beforeSettle hook]
↓
ThoughtProof runs multi-model adversarial verification:
- Is the payment amount proportional to the service?
- Is there a material defect in the decision reasoning?
- Would a competent reviewer change this decision?
↓
confidence >= threshold → SETTLE (payment executes)
confidence < threshold → HOLD (payment blocked with reason)
Monitoring
facilitator.onBeforeSettle(createThoughtProofHook({
providers: [...],
onVerification: (result) => {
console.log(`Decision: ${result.allowed ? 'ALLOW' : 'HOLD'}`);
console.log(`Confidence: ${result.confidence}`);
console.log(`Duration: ${result.durationMs}ms`);
if (result.materiality) {
console.log(`Material defects: ${result.materiality.materialCount}`);
}
// Send to your monitoring / analytics
},
}));
The Payment Trust Stack
Identity → Visa TAP / ERC-8004
Authorization → Mastercard Verifiable Intent
Risk → t54 / fraud scoring
Decision → ThoughtProof (@pot-sdk2/x402) ← you are here
Execution → x402 facilitator / settlement
Requirements
@x402/core>= 2.0.0pot-sdk>= 1.1.0- At least 2 LLM provider API keys (for multi-model verification)
License
MIT — ThoughtProof Protocol
Recommended Servers
playwright-mcp
A Model Context Protocol server that enables LLMs to interact with web pages through structured accessibility snapshots without requiring vision models or screenshots.
Magic Component Platform (MCP)
An AI-powered tool that generates modern UI components from natural language descriptions, integrating with popular IDEs to streamline UI development workflow.
Audiense Insights MCP Server
Enables interaction with Audiense Insights accounts via the Model Context Protocol, facilitating the extraction and analysis of marketing insights and audience data including demographics, behavior, and influencer engagement.
VeyraX MCP
Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.
graphlit-mcp-server
The Model Context Protocol (MCP) Server enables integration between MCP clients and the Graphlit service. Ingest anything from Slack to Gmail to podcast feeds, in addition to web crawling, into a Graphlit project - and then retrieve relevant contents from the MCP client.
Kagi MCP Server
An MCP server that integrates Kagi search capabilities with Claude AI, enabling Claude to perform real-time web searches when answering questions that require up-to-date information.
E2B
Using MCP to run code via e2b.
Neon Database
MCP server for interacting with Neon Management API and databases
Exa Search
A Model Context Protocol (MCP) server lets AI assistants like Claude use the Exa AI Search API for web searches. This setup allows AI models to get real-time web information in a safe and controlled way.
Qdrant Server
This repository is an example of how to create a MCP server for Qdrant, a vector search engine.