Skip to content
AGNT
All guides
Ecosystem workflowbeginner

Wire AGNT memory into Claude Code as an MCP server

Three lines of config gets Claude Code structured access to AGNT's memory, wiki, and knowledge graph.

This is the reference walkthrough for composing AGNT with Claude Code. By the end, your Claude Code sessions will have structured tool access to AGNT user memory, venue search, and the knowledge graph — without writing any adapter code.

AGNT Developer Experience10 minverified 2026-04-10

Prerequisites

  • An AGNT developer API key (get one at /developers).
  • Claude Code installed locally.
  • Basic comfort editing JSON config files.

What you're building

By the end of this walkthrough, Claude Code will have four new tools available in every session: `search_venues`, `list_venues`, `read_user_memory`, and `query_knowledge_graph`. These come from AGNT's MCP server — a single HTTP endpoint that speaks the Model Context Protocol.

There's no plugin to install and no adapter to maintain. Claude Code reads the MCP server definition from your config, negotiates the tool schemas at startup, and exposes them to the model. When the model calls a tool, Claude Code proxies the call to AGNT and returns the structured response.

Step 1 — Get an AGNT API key

Head to [/developers](/developers) and generate a developer key. Give it read scopes for `memory.read`, `venues.read`, and `graph.read`. The key starts with `ag_` and is shown exactly once — store it in your password manager immediately.

If you plan to write memory from Claude Code as well (see the `write_user_memory` tool), add `memory.write` to the key's scopes. Be deliberate about this — write access means the agent can mutate user memory, and you want to be sure the session is trusted before you grant it.

Step 2 — Add AGNT to your Claude Code MCP config

Claude Code's MCP server config lives at `~/.claude/mcp.json` (or your project's local `.claude/mcp.json` if you want per-project scoping). Add a new server entry:

{
  "mcpServers": {
    "agnt": {
      "url": "https://api.agntdot.com/mcp/sse",
      "headers": {
        "Authorization": "Bearer ${AGNT_API_KEY}"
      }
    }
  }
}

Export `AGNT_API_KEY` in your shell environment (never commit it). Claude Code substitutes the env var at startup so the key never hits disk.

Step 3 — Verify the handshake

Start a fresh Claude Code session and ask: "what MCP tools are available from the agnt server?" Claude Code will enumerate the tools it discovered during the handshake. You should see `search_venues`, `list_venues`, `read_user_memory`, and `query_knowledge_graph`.

If the handshake fails, the most common causes are a wrong endpoint URL, a missing or malformed Authorization header, and a scope mismatch between the key and the tools. AGNT's MCP server returns specific 4xx codes for each of these — Claude Code will surface the error in its startup log.

Step 4 — Call a tool

Ask Claude Code: "find me sunset-facing restaurants in Canggu". Under the hood, Claude Code will invoke `search_venues` with `{intent: "sunset", location: "canggu"}` and receive a structured list of venues. The model then composes a natural-language response grounded in the real data.

The important property here: there's no prompt engineering on your side. Claude Code figured out to use the tool because MCP gives it a structured description + input schema. Compare this to the old world where you'd write a system prompt saying "if the user asks about venues, call this REST endpoint" — all of that machinery is now protocol-level.

Step 5 — Set scope guardrails

Before you start shipping memory writes from Claude Code, set scope guardrails on the API key. In AGNT's developer dashboard, you can restrict a key to specific users, specific memory key prefixes, or specific rate limits. This is the single most important step for keeping a rogue session from nuking user memory.

Recommended setup for a personal Claude Code session: scope the key to your own user ID only, allow only the `diet`, `interests`, `favorite_areas` memory keys, and cap writes at 20/day. You can tighten later as you learn what your workflows actually need.

Why this matters

Before MCP, wiring external data into a coding agent meant writing a custom adapter per provider, per tool, per project. With MCP, the adapter is the protocol. AGNT's `/mcp/sse` endpoint works identically for Claude Code, any other MCP-capable client, and anything that lands later — no vendor lock-in, no schema translation.

The higher-leverage play: once AGNT is an MCP server in your Claude Code setup, every session inherits your AGNT context automatically. Your personal preferences, your venue graph, your project's knowledge base — they become first-class data the coding agent can reason over without you copying and pasting.

Next steps