{"data":{"@kind":"guide","slug":"wire-into-claude-code","title":"Wire Cambridge TCG into Claude Code (or any MCP client)","subtitle":"Two requests, your agent has TCG tools.","intro":"If you're using Claude Code (or any MCP-compatible client) and want Cambridge TCG as a typed tool, you can wire it in with two HTTP requests: fetch our config snippet, paste into your MCP config, restart. The no-auth read-tools work immediately; the authenticated tools (your own agents, your own portfolio) require a bearer token.","audiences":["agent","hobbyist_coder"],"prerequisites":["Claude Code installed (or any MCP-compatible client)","Optional: a Cambridge TCG account to provision a bearer token at /account/agents"],"estimated_minutes":10,"step_count":3,"steps":[{"step_number":1,"title":"Fetch the paste-and-go config snippet","instruction":"We publish a ready-made MCP config block. Fetch it; the response includes both the server-entry shape (for token-authenticated access) and a list of no-auth direct-API tools (universal/card, federation/identify, catalog walks, etc.).","curl":"curl https://cambridgetcg.com/.well-known/mcp-config.json","expected_response_shape":"{ \"mcp_server_entry\": { \"cambridge-tcg\": { \"url\": \"...\", \"transport\": \"https\", \"auth\": {...} } }, \"no_auth_alternative_tools\": [{ \"tool_name\": \"ctcg_get_card\", \"url_template\": \"...\", ... }], \"recommended_user_agent\": \"...\", \"first_request_guide\": \"...\" }","what_to_do_with_it":"Save the response. Decide: do you want full server-mediated access (bearer token; tools that touch your account / agents / portfolio) or are no-auth read-tools enough? For public reads, the direct-API approach skips the bearer-token provisioning."},{"step_number":2,"title":"Add the server to your MCP config","instruction":"Merge `mcp_server_entry.cambridge-tcg` into your client's MCP config file. For Claude Code, that's `~/.config/claude-code/mcp.json` under the `mcpServers` block. Restart your client to reload.","curl":"# Approximate (your client may differ):\ncurl https://cambridgetcg.com/.well-known/mcp-config.json \\\n  | jq '.mcp_server_entry' \\\n  > /tmp/ctcg-mcp.json\n# Then manually merge into ~/.config/claude-code/mcp.json under mcpServers.","what_to_do_with_it":"Your client should now expose Cambridge TCG tools. Try asking: \"Look up the One Piece card op-op01-001-ja\". The tool call should succeed and return the math-mirror representation."},{"step_number":3,"title":"Provision a bearer token (optional — for authenticated tools)","instruction":"If you want the authenticated tools (your own agents, portfolio operations, your cardrush-history view), sign in at /account/agents and provision a bearer token. Add it to your MCP server's `auth` block as a bearer header.","what_to_do_with_it":"Test with a tool call that requires auth. The response will name your operated_by_user_id — substrate-honest about who the operator is upstream-responsible to.","links":[{"label":"Agent methodology","href":"/methodology/agents"},{"label":"Account agents","href":"/account/agents"}]}],"gotchas":[{"title":"Set User-Agent in MCP server config too","description":"Even when going through the MCP gate, our backend reads the User-Agent of the request. Set `User-Agent: <your-client>/<version> (<contact>) ctcg-mcp` so we can email you about breakage before firewalling."},{"title":"Bearer tokens expire","description":"Provisioned tokens have an expiry (declared at /methodology/agents). When a tool call returns 401 with `error.code: TOKEN_EXPIRED`, re-provision at /account/agents."},{"title":"No-auth tools have looser rate limits","description":"The direct-API no-auth tools are bounded by the public freshness budget per endpoint. Authenticated tools have per-agent tiers — see /methodology/agents."}],"next_guide":{"slug":"build-a-discord-bot","title":"Build a Discord bot using Cambridge TCG data","url":"/api/v1/guides/build-a-discord-bot","html_url":"/agents/guides/build-a-discord-bot"},"see_also":[{"label":"MCP discovery","href":"/.well-known/mcp.json"},{"label":"MCP server config","href":"/.well-known/mcp-config.json"},{"label":"Agent methodology","href":"/methodology/agents"}],"last_verified":"2026-05-14","feedback":{"kind":"guide-feedback","endpoint":"/api/v1/feedback","body_template":{"kind":"guide-feedback","guide_slug":"wire-into-claude-code","step_number":"<which step had the issue, or null for whole-guide feedback>","observation":"<what you observed>","expected":"<what you expected>","reporter_contact":"<your email>"}},"html_sibling":"/agents/guides/wire-into-claude-code"},"_meta":{"spec_version":"1","endpoint":"/api/v1/guides/[slug]","retrieved_at":"2026-05-13T18:56:03.778Z","as_of":"2026-05-13T18:56:03.778Z","sources":["ctcg-derived"],"freshness_seconds":86400,"license":"CC0-1.0","request_id":"req_6df9789e-f5a","deprecation":null,"next_link":null,"self_reference":{"this_endpoint":"/api/v1/guides/[slug]","contains_self":true},"source_license":["CC0-1.0"]}}