MCP Server
Model Context Protocol integration for AI agents. Query signed oracle data natively from Claude, GPT, and other LLMs.
The Model Context Protocol is an open standard that lets AI agents call external tools during conversations. Mycelia Signal's MCP server exposes all 11 oracle pairs as callable tools — the AI pays for each query automatically and receives cryptographically signed price 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:
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:
pip install fastmcp ecdsa pynacl
For L402 (Lightning) tools, you also need lnget — a command-line tool that handles L402 payment flows automatically:
# 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 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:
# 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
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
python oracle_mcp.py
Connecting to Claude Desktop
Add the server to your Claude Desktop configuration file:
{
"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
L402 Tools (Lightning — secp256k1 signatures)
These tools pay automatically via Lightning using lnget. Each call costs 10 sats (spot) or 20 sats (VWAP).
| Tool | Pair | Cost |
|---|---|---|
get_btcusd_spot | BTC/USD | 10 sats |
get_btcusd_vwap | BTC/USD VWAP | 20 sats |
get_ethusd_spot | ETH/USD | 10 sats |
get_eurusd_spot | EUR/USD | 10 sats |
get_xauusd_spot | XAU/USD | 10 sats |
get_solusd_spot | SOL/USD | 10 sats |
get_btceur_spot | BTC/EUR | 10 sats |
get_etheur_spot | ETH/EUR | 10 sats |
get_soleur_spot | SOL/EUR | 10 sats |
get_xaueur_spot | XAU/EUR | 10 sats |
get_btceur_vwap | BTC/EUR VWAP | 20 sats |
x402 Tools (USDC on Base — Ed25519 signatures)
These tools interact with the x402 proxy. Currently returns payment instructions (402 response) for the agent to process. Each query costs $0.001 USDC (spot) or $0.002 USDC (VWAP).
| Tool | Pair | Cost |
|---|---|---|
sho_get_btcusd_spot | BTC/USD | $0.001 |
sho_get_btcusd_vwap | BTC/USD VWAP | $0.002 |
sho_get_ethusd_spot | ETH/USD | $0.001 |
sho_get_eurusd_spot | EUR/USD | $0.001 |
sho_get_xauusd_spot | XAU/USD | $0.001 |
sho_get_solusd_spot | SOL/USD | $0.001 |
sho_get_btceur_spot | BTC/EUR | $0.001 |
sho_get_etheur_spot | ETH/EUR | $0.001 |
sho_get_soleur_spot | SOL/EUR | $0.001 |
sho_get_xaueur_spot | XAU/EUR | $0.001 |
sho_get_btceur_vwap | BTC/EUR VWAP | $0.002 |
Free Tools (no payment required)
| Tool | Description |
|---|---|
sho_get_info | x402 protocol details, Ed25519 public key, payment address, endpoint pricing |
sho_get_health | x402 proxy health status |
sho_get_enforcement | Check enforcement status for a Base wallet address |
get_dlc_pubkey | DLC oracle Schnorr public key (BIP-340) |
get_dlc_status | DLC oracle status, announcement and attestation counts |
get_dlc_announcements | All DLC announcements with pre-committed R-point nonces |
DLC Tools (Lightning-paid)
| Tool | Description | Cost |
|---|---|---|
get_dlc_attestation | Schnorr-signed 5-digit price attestation by event ID | 1000 sats |
Response Format
Every paid tool returns a standardized result with signature verification built in:
{
"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.
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:
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.
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.