MCP Integration Guide
Anura Memory exposes a Model Context Protocol (MCP) endpoint that AI agents can connect to for persistent memory.
The MCP server provides 12 tools across two products:
- GraphRag (7 tools) — Knowledge graph with triple extraction and hybrid retrieval
- FilesRag (5 tools) — Markdown file storage with semantic search
Prerequisites
- An Anura Memory account at anuramemory.com
- An API key — create one in the dashboard at Settings > API Keys
Setup
Claude Desktop
Edit your Claude Desktop config file:
- macOS:
~/Library/Application Support/Claude/claude_desktop_config.json - Windows:
%APPDATA%\Claude\claude_desktop_config.json
{
"mcpServers": {
"anura-memory": {
"url": "https://anuramemory.com/api/mcp",
"headers": {
"X-API-KEY": "gm_your_key_here"
}
}
}
}
Restart Claude Desktop after saving. You should see "anura-memory" appear in the tools list.
Claude Code
Add to your project's .mcp.json:
{
"mcpServers": {
"anura-memory": {
"type": "url",
"url": "https://anuramemory.com/api/mcp",
"headers": {
"X-API-KEY": "gm_your_key_here"
}
}
}
}
Cursor
Open Settings > MCP Servers and add:
{
"mcpServers": {
"anura-memory": {
"url": "https://anuramemory.com/api/mcp",
"headers": {
"X-API-KEY": "gm_your_key_here"
}
}
}
}
Windsurf
Add to your Windsurf MCP configuration:
{
"mcpServers": {
"anura-memory": {
"serverUrl": "https://anuramemory.com/api/mcp",
"headers": {
"X-API-KEY": "gm_your_key_here"
}
}
}
}
Any MCP Client (programmatic)
import { Client } from "@modelcontextprotocol/sdk/client/index.js";
import { StreamableHTTPClientTransport } from "@modelcontextprotocol/sdk/client/streamableHttp.js";
const client = new Client({ name: "my-agent", version: "1.0" });
await client.connect(
new StreamableHTTPClientTransport(
new URL("https://anuramemory.com/api/mcp"),
{ requestInit: { headers: { "X-API-KEY": "gm_your_key_here" } } }
)
);
// Call any tool
const result = await client.callTool({
name: "remember",
arguments: { text: "Alice works at Acme Corp" }
});
GraphRag Tools
remember
Extract and store knowledge triples from text into the knowledge graph.
| Parameter | Type | Required | Description |
|---|---|---|---|
text | string | Yes | Text to extract knowledge from |
requireApproval | boolean | No | If true, route facts to the pending queue for human review (default: false) |
The text is analyzed by an LLM to identify factual relationships (Subject-Predicate-Object triples), which are deduplicated and merged into the knowledge graph with provenance tracking. The LLM also automatically classifies each entity with a type (person, organization, place, concept, event, technology, product, or other). Types are first-write-wins -- existing entity types are never overwritten.
Contradiction detection: If a new triple conflicts with an existing one on a single-valued predicate (e.g., LIVES_IN, WORKS_AT), the old value is automatically replaced and the resolution is returned in the conflicts field.
search
Search for an entity and its direct connections.
| Parameter | Type | Required | Description |
|---|---|---|---|
entity | string | Yes | Entity name (case-insensitive) |
Returns all incoming and outgoing relationships for the entity. The entity object in the response includes a type field (person, organization, place, concept, event, technology, product, other, or null if unclassified).
get_context
Retrieve context from the knowledge graph for a natural language query.
| Parameter | Type | Required | Description |
|---|---|---|---|
query | string | Yes | Natural language query |
format | string | No | "json", "markdown", or "text" (default: "markdown") |
Uses hybrid search (graph traversal + vector similarity + community summaries) when available, falling back to 2-hop graph traversal. Returns a traceId for debugging.
ingest_tool_output
Passively ingest output from another tool for background knowledge extraction.
| Parameter | Type | Required | Description |
|---|---|---|---|
tool_name | string | Yes | Source tool name (e.g., "web_search", "code_interpreter") |
output | string | Yes | Tool output text (max 10,000 chars) |
Returns immediately — extraction happens asynchronously in the background. Extracted facts go to the pending queue for human review. Each fact is tagged with provenance (source tool name) for auditability.
sever_edge
Delete a specific relationship from the knowledge graph.
| Parameter | Type | Required | Description |
|---|---|---|---|
subject | string | Yes | Source entity name |
predicate | string | Yes | Relationship type |
object | string | Yes | Target entity name |
blacklist | boolean | No | Also blacklist to prevent re-creation (default: false) |
strengthen_edge
Increase the weight of a relationship to prioritize it as ground truth.
| Parameter | Type | Required | Description |
|---|---|---|---|
subject | string | Yes | Source entity name |
predicate | string | Yes | Relationship type |
object | string | Yes | Target entity name |
weight | number | No | Amount to increase by (default: 1) |
detect_communities
Run community detection (Louvain algorithm) on the knowledge graph to identify topical clusters, then generate LLM summaries for each community. No parameters.
FilesRag Tools
write_file
Create or update a markdown memory file. If a file already exists at the given path, its content is replaced. Automatically chunked by ## headings and indexed for semantic search.
| Parameter | Type | Required | Description |
|---|---|---|---|
path | string | Yes | Virtual file path (e.g., "/notes/architecture.md") |
content | string | Yes | Markdown content |
Example:
{
"path": "/docs/preferences.md",
"content": "# Preferences\n\n## Code Style\nPrefers functional programming...\n\n## Tools\nUses VSCode with vim bindings..."
}
read_file
Read the content of a memory file by its path or ID.
| Parameter | Type | Required | Description |
|---|---|---|---|
path | string | Yes | File path (e.g., "/notes/architecture.md") or file ID |
search_files
Semantic search across memory files. Returns the most relevant chunks ranked by similarity. Optionally scope to a single file.
| Parameter | Type | Required | Description |
|---|---|---|---|
query | string | Yes | Natural language search query |
limit | number | No | Max results to return (default: 10) |
fileId | string | No | File ID to search within a single file |
Examples:
{ "query": "what are the user's code style preferences?", "limit": 5 }
{ "query": "auth flow", "fileId": "clx_abc123" }
list_files
List all memory files in the current project with metadata. No parameters.
delete_file
Delete a memory file and all its indexed chunks.
| Parameter | Type | Required | Description |
|---|---|---|---|
path | string | Yes | File path or file ID |
How It Works
GraphRag
- Remember: Text is sent to an LLM that extracts Subject-Predicate-Object triples
- Deduplicate: Triples are fuzzy-matched against existing graph data to prevent duplicates
- Store: New triples are merged into a per-project knowledge graph
- Retrieve: Queries use 2-hop graph traversal + vector similarity + community summaries to find relevant context
FilesRag
- Write: Markdown content is stored in S3 and chunked by
##headings - Embed: Each chunk is embedded using OpenAI text-embedding-3-small (1536-dim)
- Search: Queries are embedded and compared against chunk embeddings via cosine similarity
- Retrieve: Top-matching chunks are returned with file context and similarity scores
When to Use Which
| Use Case | Product |
|---|---|
| Structured facts ("Alice works at Acme") | GraphRag |
| Preferences, workflows, procedures | FilesRag |
| Quick factual lookups | GraphRag |
| Long-form notes, documentation | FilesRag |
| Relationship discovery (who knows who) | GraphRag |
| Searchable memory across topics | FilesRag |
Both products share the same API key, project scope, and billing. You can use them together.
Authentication
The MCP endpoint requires an API key via the X-API-KEY header. Each key is scoped to a specific project — all operations through that key operate on that project's data.
Create API keys in the dashboard at Settings > API Keys.
Rate Limits
| Tool | FREE | PRO | MAX |
|---|---|---|---|
remember | 5/min | 30/min | 100/min |
get_context / search | 20/min | 120/min | 400/min |
write_file | 10/min | 60/min | 200/min |
read_file / list_files | 30/min | 200/min | 600/min |
search_files | 20/min | 120/min | 400/min |
Tier Limits
| Resource | FREE | PRO | MAX |
|---|---|---|---|
| Graph facts | 100 | 5,000 | 100,000 |
| File storage | 50 MB | 1 GB | 50 GB |
| File count | 20 | Unlimited | Unlimited |
Notes
- The MCP server is stateless (HTTP transport). Each request is independent — no session management or SSE.
- The
ingest_tool_outputtool is designed for the "Sniffer" pattern: intercept tool outputs from other MCP tools and feed them to Anura Memory for passive learning. - Use
sever_edgewithblacklist: truewhen the agent has learned something incorrect — this prevents the LLM from re-extracting the same bad fact. - After making graph changes, you can view the results in the Brain visualization at
/brain.