Docs/MCP Integration

MCP Integration

Agentverse Memory is MCP-native. Connect any JSON-RPC 2.0 client — Claude Desktop, Cursor, Windsurf, LangChain, CrewAI — without installing any SDK.

Published as io.github.fetchai/agentverse-memory on the MCP Registry.

What is MCP?

The Model Context Protocol (MCP) is an open standard for exposing tools and resources to AI agents over JSON-RPC 2.0. Rather than building a bespoke SDK for every framework, MCP lets any compatible client — Claude Desktop, Cursor, LangChain, a custom agent loop — discover and call tools via a single HTTPS endpoint.

Agentverse Memory exposes all 35 memory tools over a single MCP endpoint. No SDK required — the MCP endpoint plus cURL is the working path today (first-party Python and TypeScript SDKs are coming soon).

Connection Details

PropertyValue
Endpointhttps://am-server-jbneh74b5q-uc.a.run.app/mcp
ProtocolJSON-RPC 2.0 over HTTPS (POST)
Auth headerX-API-Key: am_... (or Authorization: Bearer am_...)
Agent scopingX-Agent-Id: <agent> (optional; overrides key default)
Content-Typeapplication/json
Tool discoveryPOST /mcp with method tools/list

Give Claude Persistent Memory in 5 Minutes

This walkthrough gives Claude Desktop access to all 35 Agentverse Memory tools — episodic, semantic, graph, procedural, working, and shared — with zero code.

1

Get your API key

Mint a free Explorer key with one HTTP call — no credit card, graph memory included. The key is the key field in the response and looks like am_...

curl -X POST https://am-server-jbneh74b5q-uc.a.run.app/v1/keys \
-H "Content-Type: application/json" \
-d '{"agent_id":"my-agent","tier":"explorer"}'
# → {"key":"am_...","key_id":"...","agent_id":"my-agent",
# "tier":"explorer","monthly_op_limit":50000}
2

Find your Claude Desktop config file

OSConfig file path
macOS~/Library/Application Support/Claude/claude_desktop_config.json
Windows%APPDATA%\Claude\claude_desktop_config.json
Linux~/.config/Claude/claude_desktop_config.json

If the file does not exist, create it.

3

Add the MCP server

Connect directly over HTTP — no install needed. Agent identity is bound to your API key; add an optional X-Agent-Id header to scope to a specific agent.

claude_desktop_config.json
{
"mcpServers": {
"agentverse-memory": {
"url": "https://am-server-jbneh74b5q-uc.a.run.app/mcp",
"headers": {
"X-API-Key": "am_your_key_here"
}
}
}
}
4

Restart Claude Desktop

Fully quit and relaunch Claude Desktop (Cmd+Q / Alt+F4 — not just close the window). The config is loaded at startup.

5

Verify it's working

Open a new conversation and ask Claude:

“What memory tools do you have available? Call memory_get_stats and tell me the result.”

Claude will list all 35 tools and return your usage stats. You can also check service health directly:

curl https://am-server-jbneh74b5q-uc.a.run.app/health
# → {"service":"am-server","status":"ok","version":"0.1.0"}
6

Store your first memory

“Remember that I prefer concise bullet-point responses. Store that as a procedural memory.”

Claude calls memory_store_procedure automatically. From this point forward, every conversation can reference this preference — across sessions and across restarts.

Client Configurations

Claude Desktop

Edit ~/Library/Application Support/Claude/claude_desktop_config.json (macOS) or equivalent Windows/Linux path:

claude_desktop_config.json
{
"mcpServers": {
"agentverse-memory": {
"url": "https://am-server-jbneh74b5q-uc.a.run.app/mcp",
"headers": {
"Authorization": "Bearer am_your_key_here"
}
}
}
}

Restart Claude Desktop after saving. All 35 tools appear automatically in Claude's tool list.

Cursor IDE

Create or edit .cursor/mcp.json in your project root:

.cursor/mcp.json
{
"mcpServers": {
"agentverse-memory": {
"url": "https://am-server-jbneh74b5q-uc.a.run.app/mcp",
"headers": {
"Authorization": "Bearer am_your_key_here"
}
}
}
}

Cursor hot-reloads the config — no restart needed.

For a project-scoped agent_id shared by all team members, add "X-Agent-Id": "project-myapp-dev" to the headers object.

Windsurf / Codeium

Add via Settings → MCP Servers:

{
"agentverse-memory": {
"serverUrl": "https://am-server-jbneh74b5q-uc.a.run.app/mcp",
"headers": {
"Authorization": "Bearer am_your_key_here"
}
}
}

Generic MCP Client (cURL)

Any client implementing JSON-RPC 2.0 can connect. Discover all tools with tools/list:

curl -X POST https://am-server-jbneh74b5q-uc.a.run.app/mcp \
-H "Authorization: Bearer am_your_key_here" \
-H "Content-Type: application/json" \
-d '{
"jsonrpc": "2.0",
"id": 1,
"method": "tools/list",
"params": {}
}'

Call a tool:

curl -X POST https://am-server-jbneh74b5q-uc.a.run.app/mcp \
-H "Authorization: Bearer am_your_key_here" \
-H "Content-Type: application/json" \
-d '{
"jsonrpc": "2.0",
"id": 2,
"method": "tools/call",
"params": {
"name": "memory_store_episode",
"arguments": {
"content": "Completed Q1 analysis for user_42."
}
}
}'

All 35 MCP Tools

All tools are available at every plan tier unless noted. memory_traverse_graph (BFS/DFS) is available on all tiers including Explorer (free); memory_find_path (A* pathfinding) and the 5 shared-space tools require Builder+. See the API Reference for full parameter schemas.

Episodic Memory5 tools
ToolDescription
memory_store_episodeStore a time-stamped event — what happened, when, and to whom. No LLM at write time — sub-ms in-process engine write op.
memory_get_episodesRetrieve episodes for an agent, with filtering by time range, metadata, or pagination.
memory_search_episodesSearch episodes by natural language — hybrid retrieval (TF-IDF ∪ dense embeddings, RRF-fused), default-on. Optional pheromone re-ranking via use_pheromone.
memory_search_timelineSearch episodes within a bounded time window — useful for "what happened last Tuesday?" queries.
memory_consolidate_episodesMerge two or more related episodes into a single consolidated record, preserving provenance.
Semantic Memory5 tools
ToolDescription
memory_store_entityStore a named entity with type and metadata. Automatically linked in the knowledge graph.
memory_get_entityRetrieve a specific entity by name or ID.
memory_list_entitiesList all entities for an agent, with optional type/metadata filters.
memory_store_relationStore a directed relationship (subject → predicate → object) between entities. No LLM at write — sub-ms in-process engine write op.
memory_get_relationsGet all relations for a given entity — inbound, outbound, or both.
Graph6 tools
ToolDescription
memory_query_graphRun a structured query over the knowledge graph — filter by entity types, relations, and metadata.
memory_semantic_searchTF-IDF similarity search across stored entities.
memory_get_neighborsGet immediate neighbors of a node — entities directly connected by one edge.
memory_graph_add_tripleAdd a (subject, predicate, object) triple directly to the graph. Batch-friendly.
memory_graph_neighborsExtended neighbor query with depth, direction, and relation-type filters.
memory_graph_shortest_pathFind the shortest path between two entities in the knowledge graph.
Procedural Memory4 tools
ToolDescription
memory_store_procedureStore a skill definition: goal description → ordered steps → expected outcome.
memory_get_procedureRetrieve a specific procedure by its ID (proc_...).
memory_match_procedureSearch procedures by goal — returns the most relevant skill for a given objective.
memory_update_procedureUpdate a procedure's steps (versioned) or record an execution outcome (success/failure rate).
Working Memory4 tools
ToolDescription
memory_set_workingSet a key-value pair in the agent's working memory, with optional TTL for auto-expiry.
memory_get_workingGet the current value for a working memory key. Returns null if key doesn't exist or has expired.
memory_list_workingList all active working memory keys for the agent — useful for state inspection.
memory_clear_workingClear all working memory for the agent. Called at task completion or session teardown.
Pheromones2 tools
ToolDescription
memory_deposit_pheromoneManually deposit a pheromone trace on a node or edge — boost retrieval weight for specific memories.
memory_get_pheromoneRead the current pheromone weight on a node or edge, including decay-adjusted value.
Shared Spaces5 tools — Builder+ · require a JWT

Shared-space tools use a short-lived server-side JWT (not just an API key). A Builder+ key self-mints one via POST /v1/space-token.

ToolDescription
memory_create_shared_spaceCreate a shared memory space — a multi-agent knowledge pool with JWT/DID-based access control.
memory_join_shared_spaceJoin an existing shared space by space_id (your JWT must grant access to it).
memory_shared_store_entityStore an entity into a shared space — visible to all agents that have joined.
memory_shared_queryQuery facts and episodes in a shared space — all agents in the space see the same graph.
memory_list_shared_spacesList all shared spaces the agent belongs to, with member counts and metadata.
System2 tools
ToolDescription
memory_get_statsGet usage statistics: memory counts by type, storage size, op counts, rate limit status, pheromone summary.
memory_delete_agentPermanently delete all memories for an agent. Irreversible — use with caution.
Graph Traversal2 tools — traverse_graph all tiers · find_path Builder+
ToolDescription
memory_find_pathA* pathfinding between two concepts (pheromone/shortest/semantic strategies). Builder+ tier — free tier returns -32002; use memory_traverse_graph instead.
memory_traverse_graphBFS/DFS multi-hop traversal from a start node up to max_depth — available on every tier including Explorer (free).

Authentication

All requests must include an Authorization header:

Authorization: Bearer am_your_key_here
⚠️ Security: Never commit API keys to source control. Use environment variables:
export AM_API_KEY="am_your_key_here"

API keys are scoped to your account. You can issue multiple keys (one per agent, one per environment) and revoke individual keys without affecting others.

Rate Limits

Applied per API key (not per agent_id).

PlanMonthly opsBurst (req/min)
Explorer(Free)50,00060
Builder($19/mo)500,000300
Pro($99/mo)5,000,0001,200
Enterprise(Custom)CustomCustom

"Ops" are counted per MCP tool call. A memory_traverse_graph call counts as one op regardless of how many edges it traverses. When you exceed rate limits, the server returns HTTP 429 with a Retry-After header (rolling 30-day window).

Error Codes

HTTPJSON-RPC codeMeaningAction
401-32001Unauthorized — invalid API keyCheck Authorization header
403-32002Forbidden — feature not on your planUpgrade at /pricing
404-32004Not Found — resource ID missingCheck the ID in request
422-32602Invalid params — malformed argsCheck parameter types
429-32029Rate Limited — ops limit exceededRespect Retry-After; upgrade
500-32000Internal error — server faultRetry with backoff; report if persistent
503-32007Service config unavailable (e.g. shared-space JWT not configured)Retry; contact support if persistent

Example 429 error response:

{
"jsonrpc": "2.0",
"id": 3,
"error": {
"code": -32029,
"message": "Rate limit exceeded",
"data": {
"limit": 50000,
"used": 50001,
"reset_at": "2026-07-01T00:00:00Z",
"retry_after": 1814400
}
}
}