MCP Server

Model Context Protocol integration for AI agents. Query signed oracle data natively from Claude, GPT, and other LLMs.

What is MCP?

The Model Context Protocol is an open standard that lets AI agents call external tools during conversations. Mycelia Signal's MCP server exposes all 176 oracle endpoints as callable tools across four layers — the AI pays for each query automatically and receives cryptographically signed data that it can verify and reason about.

Why This Matters

AI agents making financial decisions need trusted price data. A language model can hallucinate a price. An MCP tool call to Mycelia Signal returns a cryptographically signed attestation from 5–9 independent sources that the agent (or any downstream system) can verify. The agent doesn't have to trust the oracle — it can verify the signature itself.

The pay-per-query model means an agent can query price data autonomously without API keys, accounts, or human approval — it just pays 10 sats or $0.001 per query.

Architecture

The MCP server is a Python process using FastMCP that exposes oracle tools over the MCP protocol. It includes both payment rails in a single server:

architecture
AI Agent (Claude, GPT, etc.)
    │
    ▼
MCP Server (FastMCP — Python)
    │
    ├── L402 tools → lnget binary → Lightning invoice → Oracle backends (secp256k1)
    │
    ├── x402 tools → HTTP + X-PAYMENT → x402 proxy → Oracle backends (Ed25519)
    │
    └── DLC tools → Free endpoints + L402 attestations (Schnorr)

Protocol-specific MCP server variants (L402-only or x402-only) are available on request.

Installation

Prerequisites

Python 3.10+ and the following dependencies:

bash
pip install fastmcp ecdsa pynacl

For L402 (Lightning) tools, you also need lnget — a command-line tool that handles L402 payment flows automatically:

bash
# Install lnget (Go binary)
go install github.com/getAlby/lnget@latest

# Or download a pre-built binary from:
# https://github.com/getAlby/lnget/releases
lnget configuration

lnget needs access to a funded Lightning wallet. It can connect to LND, CLN, or use an Alby account. See the lnget documentation for wallet setup. Update the LNGET_PATH variable in the MCP server to point to your lnget binary.

Configuration

Update these constants at the top of oracle_mcp.py:

python
# L402 proxy (Lightning payments via lnget)
L402_BASE = "http://104.197.109.246:8080"

# x402 / SHO proxy (USDC payments on Base)
SHO_BASE = "http://104.197.109.246:8402"

# Path to lnget binary (required for L402 tools)
LNGET_PATH = "/usr/local/bin/lnget"  # adjust to your system
Why direct IP?

The MCP server connects to the oracle via direct IP rather than the api.myceliasignal.com domain. This bypasses Cloudflare, which rejects Go-based TLS clients (like lnget) with 400 Bad Request. The HTTPS domain works fine for all non-lnget traffic.

Running the Server

bash
python oracle_mcp.py

Connecting to Claude Desktop

Add the server to your Claude Desktop configuration file:

json — claude_desktop_config.json
{
  "mcpServers": {
    "mycelia-signal": {
      "command": "python",
      "args": ["/path/to/oracle_mcp.py"]
    }
  }
}

On macOS, this file is at ~/Library/Application Support/Claude/claude_desktop_config.json. On Windows, it's at %APPDATA%\Claude\claude_desktop_config.json.

Available Tools

Tools are organized by layer. Each tool call pays automatically via x402 (USDC on Base).

Layer 1 — Oracle Data

ToolDescriptionCost
get_priceSpot price for any supported pair (BTC/USD, ETH/USD, EUR/USD, XAU/USD, SOL/USD…)$0.01
get_price_vwap5-minute VWAP for BTC and ETH pairs$0.02
get_volatility_indexMSVI volatility index — BTC or ETH, 0–100$0.05
get_sentiment_indexMSXI sentiment index — BTC or ETH$0.05
get_stress_indexMSSI market stress index — 0–100$0.05
get_contagion_indexMSTI crypto-TradFi contagion index$0.05
get_funding_rateComposite funding rate — BTC, ETH, or SOL$0.05
get_gas_priceGas price for Ethereum, Base, Arbitrum, Polygon, Optimism, Solana$0.01
get_econ_indicatorEconomic indicator — CPI, NFP, Fed Funds, GDP…$0.10
get_defi_yieldDeFi yield rates across 15+ protocols$0.05

Layer 2 — Oracle Information

ToolDescriptionCost
get_market_synopsis15-signal market state snapshot — all indices, funding, OI, liq flow, price$0.25
get_perp_regimePerp trading regime for BTC, ETH, or SOL — regime classification, confidence, risk$0.15

Layer 3 — Oracle Intelligence

ToolDescriptionCost
get_macro_riskCross-domain macro risk score 0–100 — MSSI + MSTI + econ calendar. Disclaimer included.$1.00
get_perp_setupBest perp setup across BTC/ETH/SOL — signal alignment, edge, invalidation conditions. Disclaimer included.$1.00
get_defi_opportunityRisk-adjusted DeFi yield — stress + contagion penalized APR ranking. Disclaimer included.$0.75

Response Format

Every paid tool returns a standardized result with signature verification built in:

json — tool response
{
  "price": "84231.50",
  "currency": "USD",
  "timestamp": "2026-02-28T07:51:00Z",
  "sources": ["binance", "bitstamp", "coinbase", "..."],
  "method": "median",
  "signing_scheme": "secp256k1",
  "signature_valid": true,
  "canonical": "v1|BTCUSD|84231.50|USD|2|2026-02-28T07:51:00Z|890123|binance,...|median",
  "pubkey": "02a1b2c3d4..."
}

The signature_valid field indicates whether the MCP server successfully verified the cryptographic signature. The AI agent can reference this field to confirm data integrity before using the price in any reasoning or decision-making.

Built-in verification

The MCP server verifies every signature automatically before returning data to the AI agent. You get both the verification result and the raw cryptographic materials (canonical string, signature, public key) so you can re-verify independently if needed.

Example Conversation

Once connected, an AI agent can query oracle data naturally:

conversation
User:  What's the current BTC/USD price?

Agent: [calls get_btcusd_spot tool]

       The current BTC/USD price is $84,231.50, based on the median of
       9 exchange sources (Binance, Bitstamp, Coinbase, Gemini, Bitfinex,
       Binance US, OKX, Gate.io, Kraken). The price was attested at
       2026-02-28T07:51:00Z and the cryptographic signature verified
       successfully (secp256k1). This query cost 10 sats via Lightning.

How the Agent Pays

L402 (Lightning)

The MCP server uses lnget to handle the full L402 flow automatically. When a tool is called, lnget makes the request, receives the 402 challenge, pays the Lightning invoice from its configured wallet, and retries with the macaroon + preimage. The oracle response is then verified and returned to the agent. The agent never sees the payment flow — it just gets signed data.

x402 (USDC on Base)

The x402 tools currently return the 402 payment requirements when called without an integrated wallet. The response includes the USDC amount, recipient address, and payment schema — enough for an x402-compatible agent or SDK to complete the payment and retry. Full automatic x402 payment integration is on the roadmap.

x402 auto-payment

Automatic USDC payment in the MCP server requires a Coinbase CDP wallet or equivalent EIP-3009-capable signer. This is being integrated. In the meantime, L402 tools handle automatic payment end-to-end.

Security Considerations

Wallet access. The MCP server has access to your Lightning wallet (via lnget) and will spend sats automatically when tools are called. Ensure the wallet has appropriate spending limits.

Signature verification. The server verifies all signatures before returning data. If verification fails, the signature_valid field will be false. Agents should treat unverified data as untrusted.

Direct IP access. The server connects via direct IP to bypass Cloudflare. This means traffic is not encrypted by Cloudflare's TLS proxy. For production deployments, consider running the MCP server on the same network as the oracle or establishing a VPN tunnel.

Source Code

The MCP server source is available in the GitHub repository.

Protocol-specific MCP server variants (L402-only or x402-only) are available on request. Contact info@myceliasignal.com.