Truth Anchor Agent MCP Server

A verifiable grounding layer for AI agents using on-chain micro-payments.

README.md

⚓️ Truth Anchor Agent

Truth Anchor Agent is an MCP (Model Context Protocol) server that provides a verifiable grounding layer for AI agents. It verifies URL status and content accessibility, gated by on-chain USDC micro-payments on Base via the x402 protocol.

The Problem: AI agents often reference dead links or hallucinate sources. The Solution: A trustless, pay-per-verification service that requires agents to commit a micro-payment before confirming a source's validity.


🛠 Model Context Protocol (MCP) Integration

This server exposes a verify tool that any MCP-compliant LLM (Claude Desktop, ChatGPT, IDEs) can use autonomously.

Registration in Claude Desktop

Add this to your claude_desktop_config.json:

{
  "mcpServers": {
    "truth-anchor": {
      "command": "npx",
      "args": ["-y", "truth-anchor-agent"],
      "env": {
        "MY_WALLET_ADDRESS": "0x367B9193D4F9cb4877Ca58E6F3ce944d761d8009"
      }
    }
  }
}

💳 The x402 Flow

The agent implements the HTTP 402 Payment Required standard, enabling seamless AI-to-AI economic transactions.

  1. Request: Agent calls /verify with a URL.
  2. Challenge: Server returns 402 Payment Required with payment instructions.
  3. Payment: Agent executes a 0.005 USDC transfer on Base Mainnet.
  4. Verification: Agent retries with the transaction hash in the X-402-Payment-Token header.
  5. Truth: Server validates the hash on-chain (preventing replays) and returns the status.

⚡️ API Reference

`POST /verify`

Verifies a URL's status. Requires a valid Base transaction hash.

Headers:

Header Description
X-402-Payment-Token The transaction hash of the 0.005 USDC payment on Base

Request Body:

{ "url": "https://base.org" }

Success Response (200 OK):

{
  "url": "https://base.org",
  "is_live": true,
  "status_code": 200,
  "payment_verified": true
}

🏗 Tech Stack

  • FastAPI — High-performance Python API framework.
  • Web3.py — Real-time on-chain verification (Base RPC).
  • SQLite — Replay attack prevention and transaction indexing.
  • Fly.io — Global edge deployment.
  • Base — L2 Ethereum for fast, low-cost USDC payments.

🛠 Local Development

# 1. Clone and Install
git clone https://github.com/cristiano-c1/truth-anchor-agent
cd truth-anchor-agent
pip install -r requirements.txt

# 2. Configure
echo "MY_WALLET_ADDRESS=0x367B9193D4F9cb4877Ca58E6F3ce944d761d8009" > .env

# 3. Run
uvicorn main:app --reload

📜 License

Distributed under the MIT License. See LICENSE for more information.

Tools 1

verifyVerifies a URL's status and content accessibility.

Environment Variables

MY_WALLET_ADDRESSrequiredThe wallet address used for on-chain verification.

Try it

Verify if the URL https://base.org is currently live and accessible.
Check the status of this source: https://example.com and confirm it is a valid reference.
Can you verify the accessibility of this link before I include it in my report?

Frequently Asked Questions

What are the key features of Truth Anchor Agent?

Verifies URL status and content accessibility. Implements x402 protocol for AI-to-AI economic transactions. Requires on-chain USDC micro-payments on Base Mainnet. Prevents replay attacks using SQLite transaction indexing. Provides a trustless grounding layer for AI agents.

What can I use Truth Anchor Agent for?

Preventing AI agents from hallucinating sources or referencing dead links. Enabling pay-per-verification services for automated research agents. Ensuring high-integrity citations in AI-generated reports. Facilitating secure, verifiable data retrieval for on-chain applications.

How do I install Truth Anchor Agent?

Install Truth Anchor Agent by running: npx -y truth-anchor-agent

What MCP clients work with Truth Anchor Agent?

Truth Anchor Agent works with any MCP-compatible client including Claude Desktop, Claude Code, Cursor, and other editors with MCP support.

Turn this server into reusable context

Keep Truth Anchor Agent docs, env vars, and workflow notes in Conare so your agent carries them across sessions.

Open Conare