2026-12-06 ~6 min read MCP · Rust · Cloudflare · x402scan RSS

One Namespace, Three MCP Shapes: Rust stdio, Base x402, and Solana x402 v2 on the Official Registry

Notes from publishing three structurally different MCP servers under io.github.xgbtxy/* via GitHub OIDC and getting 10/10 Base and Solana endpoints to zero warnings on x402scan.

Shipping a single MCP server usually teaches you one happy path: either you bundle a local stdio binary for desktop coding agents, or you put a stateless streamable-http endpoint behind a Worker.

Putting three very different servers under the same io.github.xgbtxy/* namespace in the Official MCP Registry — and getting both remote Workers to 10/10 registered resources (6/6 + 4/4) with zero errors and zero warnings on x402scan — forced every hidden schema assumption into the open.

Here are the three live entries currently active under io.github.xgbtxy/*:

  1. xgbtxy/ap (io.github.xgbtxy/ap, v2.98.0, also on Glama) — a zero-dependency pure-Rust 37-tool local stdio MCP server and CLI (AST symbol read/edit, SQLite FTS5 log sieve, headless CDP checks, and Win32 process isolation), distributed as five platform .mcpb bundles.
  2. xgbtxy/cf-x402-mcp (io.github.xgbtxy/cf-x402-mcp, v0.3.0, /llms.txt, Glama) — a stateless streamable-http MCP server on Cloudflare Workers settling per-call Base USDC (eip155:8453) via x402 v2, with 6/6 endpoints registered on x402scan.
  3. xgbtxy/coingecko-longtail-agent (io.github.xgbtxy/coingecko-longtail-agent, v0.2.0, live Worker) — a Cloudflare Worker combining free Solana token discovery/risk MCP tools (Data by CoinGecko API + Solana JSON-RPC mint/holder checks) with a Solana USDC (solana:5eykt4UsFv8P8NJdTREpY1vzqKqZKvdp) x402 v2 paywall for Jupiter exit-slippage simulation and unsigned Solana Memo v2 attestations, with 4/4 resources registered on x402scan.

In an earlier note I covered discovery surfaces around cf-x402-mcp alone. Below is a side-by-side look at what actually differed across local Rust stdio, Base x402, and Solana x402 v2 — and the concrete schema pitfalls that broke CI or scanner checks along the way.

1. Three MCP shapes under one namespace

All three repositories validate against the same 2025-12-11 Registry schema (https://static.modelcontextprotocol.io/schemas/2025-12-11/server.schema.json) and publish via passwordless GitHub Actions OIDC (./mcp-publisher login github-oidc), yet almost everything underneath differs:

Dimension io.github.xgbtxy/ap (v2.98.0) io.github.xgbtxy/cf-x402-mcp (v0.3.0) io.github.xgbtxy/coingecko-longtail-agent (v0.2.0)
Runtime Native single binary (pure Rust) Cloudflare Workers (TypeScript) Cloudflare Workers (TypeScript)
MCP transport stdio streamable-http (POST /mcp) streamable-http (POST /mcp)
server.json shape packages (5 .mcpb archives + fileSha256) remotes (1 HTTPS URL) remotes (1 HTTPS URL)
Payment rail Free / MIT local binary x402 v2 · Base USDC (eip155:8453, $0.01–$0.02) x402 v2 · Solana USDC (solana:5eykt4UsFv8P8NJdTREpY1vzqKqZKvdp, $0.02)
$0 inspection path Local CLI / --help / MCP tools/list {"sample": true} / ?sample=true + /api/poly-signals/preview Free /scan, /analyze, /mcp + ?demo=1 offline fixtures
x402scan status N/A (local stdio) 6/6 endpoints (0 errors, 0 warnings) 4/4 endpoints (0 errors, 0 warnings)

2. server.json and GitHub OIDC: packages vs. remotes

Using GitHub OIDC (permissions: id-token: write) was the cleanest part of the setup. Because the repository owner matches the reversed namespace (io.github.xgbtxy/*), mcp-publisher exchanges GitHub's short-lived OIDC token directly with the Registry — zero long-lived registry credentials stored in repository secrets.

Where the workflows diverged was artifact verification:

  • Local stdio (packages + .mcpb) has a release-CDN timing trap. In xgbtxy/ap, server.json declares five registryType: "mcpb" entries (windows-x64, darwin-arm64, darwin-x64, linux-x64, linux-arm64), each requiring an exact fileSha256. Keeping real hashes committed in main guarantees stale metadata on the next tag, so the repo keeps zeroed placeholders and stamps computed SHA-256 digests during release.yml. Even then, running mcp-publisher publish immediately after uploading GitHub Release assets can race GitHub's release CDN. Adding a bounded curl -IL readiness loop until all five .mcpb download URLs return HTTP 200 — plus verifying the mcp-publisher tarball with Sigstore cosign verify-blob before validate and publish — eliminated flaky release runs.
  • Remote Workers (remotes + streamable-http) are simpler, until metadata limits bite. Both cf-x402-mcp and coingecko-longtail-agent omit packages entirely and declare a single remotes entry:
{
  "$schema": "https://static.modelcontextprotocol.io/schemas/2025-12-11/server.schema.json",
  "name": "io.github.xgbtxy/coingecko-longtail-agent",
  "description": "Solana long-tail token due-diligence & exit-liquidity MCP server (Data by CoinGecko API).",
  "version": "0.2.0",
  "repository": { "url": "https://github.com/xgbtxy/coingecko-longtail-agent", "source": "github" },
  "remotes": [
    { "type": "streamable-http", "url": "https://coingecko-longtail-agent.yan8925298.workers.dev/mcp" }
  ]
}

Two small traps showed up across all three repos:

  1. The <= 100-character description ceiling. Registry validation rejects verbose repository taglines (cf-x402-mcp failed publish until v0.2.1 trimmed description down; the three live descriptions now sit at 96, 97, and 89 characters).
  2. Immutable published versions. You cannot overwrite 0.2.0 in place after noticing a typo; every server.json fix requires bumping semver and pushing a fresh v* tag. Running ./mcp-publisher validate in CI before tagging saves burning patch numbers on schema mistakes.

3. Getting 10/10 (6/6 + 4/4) clean on x402scan across Base and Solana

cf-x402-mcp (6 POST tool/signal routes on Base) and coingecko-longtail-agent (GET /scan, GET /analyze, GET /premium/analyze, and POST /mcp on Solana) look similar from 10,000 feet, yet coingecko-longtail-agent initially failed x402scan compatibility because its paywall started with x402 v1 habits.

Reaching 10/10 registered endpoints with zero errors and zero warnings came down to three groups of fixes:

A. Upgrading from informal v1 fields to strict x402 v2 + CAIP-2

In x402 v1 examples, it was common to see x402Version: 1, "network": "solana", "maxAmountRequired": "20000", and "error": "X-PAYMENT header is required". Strict v2 indexers reject or downgrade that shape. Moving coingecko-longtail-agent to match cf-x402-mcp required:

  • Setting x402Version: 2, error: "payment required", and a top-level resource: { url, description, mimeType: "application/json" } block.
  • Using amount (atomic USDC units: "10000" for $0.01, "20000" for $0.02) inside accepts[] rather than maxAmountRequired.
  • Using CAIP-2 chain identifiers paired with canonical USDC mint/contract addresses:
    • Base mainnet: network: "eip155:8453", asset: "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913" (/.well-known/x402).
    • Solana mainnet: network: "solana:5eykt4UsFv8P8NJdTREpY1vzqKqZKvdp", asset: "EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v" (/.well-known/x402).

B. HTTP 402 headers and CORS exposure

Returning JSON in the 402 response body is not enough. Both Workers encode the v2 challenge JSON as Base64 in the PAYMENT-REQUIRED header and include Access-Control-Expose-Headers: PAYMENT-REQUIRED, PAYMENT-RESPONSE (plus Mcp-Session-Id on cf-x402-mcp). Without Access-Control-Expose-Headers, curl -i looks completely fine in your terminal while browser-based inspectors and web agents see an empty header map.

C. OpenAPI 3.1 lint details that silently trip scanners

Directory scanners read /openapi.json literally:

  • Query parameter drift: in coingecko-longtail-agent, the Worker parsed ?q=<mint> on /analyze and /premium/analyze, while the early OpenAPI spec still named the query parameter mint. Aligning both routes to q fixed automated probe mismatches.
  • Mixed free and paid routes: unlike cf-x402-mcp (where all six REST routes in openapi.json are paid POST endpoints), coingecko-longtail-agent's openapi.json mixes three free routes (/scan, /analyze, /mcp) with one paid route (/premium/analyze). Explicitly marking free operations with security: [], adding typed 200 application/json schemas, and including info.contact metadata cleared the last scanner warnings across all four Solana resources.

4. $0 trial paths and keyless CI keep you honest

A paywall makes cold-start testing painful for both external callers and your own CI pipeline. Two patterns kept iteration fast without holding any wallet keys in Worker secrets or GitHub Actions:

  1. Deterministic $0 inspection modes:
    • Every tool on cf-x402-mcp advertises "sampleArguments": { "sample": true } in /.well-known/x402, returning a deterministic response at $0 via MCP or ?sample=true over REST.
    • coingecko-longtail-agent keeps /scan, /analyze, and /mcp (scan_longtail, analyze_token) free, and supports ?demo=1 (plus --offline on the CLI) backed by deterministic RUGGY and SOLID token fixtures so anyone — or CI — can exercise the full risk scorer, Jupiter $500/$2,500 exit-slippage check, and SHA-256 Solana Memo v2 instruction builder with zero API keys or funds.
  2. Contract tests on the unpaid 402 boundary:
    • cf-x402-mcp (51/51 Vitest tests) and coingecko-longtail-agent assert x402Version === 2, exact CAIP-2 network strings, atomic amount values, Base64 PAYMENT-REQUIRED headers, and OpenAPI schema parity on every push before deployment.
    • Neither Worker ever holds a wallet signing key: payments verify via facilitator, and Solana audit trails are emitted as unsigned Memo Program v2 instructions for the caller's own wallet to sign if they choose.

5. Honest limits and what is still rough

Having 3/3 active entries on the Official MCP Registry and 10/10 zero-warning endpoints on x402scan feels tidy, though I want to be candid about what it does not solve:

  • Schema compliance is not settlement load-testing. Zero warnings on x402scan proves that discovery manifests, OpenAPI 3.1 specs, and unpaid 402 headers match the v2 contract. It does not prove facilitator latency, RPC rate-limit resilience, or wallet UX when real Base or Solana transactions hit concurrently.
  • Discovery surfaces still drift across repos. cf-x402-mcp serves /llms.txt, /.well-known/x402, and /openapi.json; coingecko-longtail-agent currently ships /.well-known/x402, /openapi.json, and an interactive browser terminal at /, without /llms.txt yet. Every extra repo multiplies metadata maintenance.
  • Client tooling is still split down the middle. Desktop coding agents make local stdio (ap) effortless, whereas very few general-purpose MCP clients automatically negotiate streamable-http and retry HTTP 402 challenges across both EVM (eip155:8453) and Solana (solana:5eykt4UsFv8P8NJdTREpY1vzqKqZKvdp) without custom client glue.

If you are maintaining multiple MCP servers under one namespace — or shipping x402 v2 endpoints on either Base or Solana — I would love to compare notes: which schema check or client quirk cost you the most debugging time?

Links

我觉得技术没有壁垒,在合适的时间做合适的事情就好,hhh