Skip to main content

MCP Server

The SharedMemory MCP server lets any MCP-compatible AI assistant (Claude Desktop, Cursor, Windsurf, VS Code Copilot) access persistent memory.

Use any valid Bearer sm_… secret. Examples assume sm_org_rw_… / sm_proj_rw_… from Settings → API Keys; sm_agent_… and sm_live_… (sm login) equally work.

The fastest way to get started — one command, no JSON editing:

# Interactive — picks your client, asks for your API key
npx -y @sharedmemory/mcp-server install

# Or specify everything inline
npx -y @sharedmemory/mcp-server install --cursor --api-key sm_org_rw_... --volume your-volume-id

# Install for all supported clients at once
npx -y @sharedmemory/mcp-server install --all --api-key sm_org_rw_...

Supported clients: --claude-code, --claude, --cursor, --vscode, --windsurf, --all

Manual Setup

Edit ~/Library/Application Support/Claude/claude_desktop_config.json:

{
"mcpServers": {
"sharedmemory": {
"command": "npx",
"args": ["-y", "@sharedmemory/mcp-server"],
"env": {
"SHAREDMEMORY_API_KEY": "sm_org_rw_...",
"SHAREDMEMORY_API_URL": "https://api.sharedmemory.ai",
"SHAREDMEMORY_VOLUME_ID": "your-volume-id"
}
}
}
}

Environment Variables

VariableRequiredDescription
SHAREDMEMORY_API_KEYYesBearer sm_… secret (sm_org_rw_… from API Keys by default)
SHAREDMEMORY_API_URLNoAPI base URL (default: https://api.sharedmemory.ai)
SHAREDMEMORY_VOLUME_IDNoDefault project (volume) ID for all operations

Tools

The MCP server exposes 15 tools to the AI assistant:

remember

Store a fact, note, or piece of information. The memory pipeline handles classification, conflict checking, entity extraction, and graph building automatically.

Parameters:

NameTypeRequiredDescription
contentstringYesThe information to remember
volume_idstringNoVolume ID (uses default)
memory_typeenumNofactual, preference, event, relationship, technical

query

Retrieve context BEFORE answering. Searches memories by semantic similarity. Returns matching memories plus knowledge graph facts.

Parameters:

NameTypeRequiredDescription
querystringYesWhat to search for
volume_idstringNoVolume ID
limitnumberNoMax results (1–50, default: 10)

get_entity

Get everything known about a specific entity (person, project, concept). Returns summary, facts, and relationships.

Parameters:

NameTypeRequiredDescription
namestringYesName of the entity
volume_idstringNoVolume ID

search_entities

Search for entities in the knowledge graph by name.

Parameters:

NameTypeRequiredDescription
querystringYesSearch term
volume_idstringNoVolume ID
limitnumberNoMax results (1–50, default: 20)

get_graph

Overview of the entire knowledge graph — all entities and relationships.

Parameters:

NameTypeRequiredDescription
volume_idstringNoVolume ID
limitnumberNoMax entities (1–200, default: 50)

list_volumes

List all memory projects (volumes) accessible to this agent. No parameters.

delete_memory

Delete a memory by ID.

Parameters:

NameTypeRequiredDescription
memory_idstringYesUUID of the memory to delete
volume_idstringNoVolume ID (uses default)

update_memory

Update an existing memory's content.

Parameters:

NameTypeRequiredDescription
memory_idstringYesUUID of the memory to update
contentstringYesNew content for the memory
volume_idstringNoVolume ID (uses default)

feedback

Submit feedback on a memory's relevance or quality.

Parameters:

NameTypeRequiredDescription
memory_idstringYesUUID of the memory
feedbackenumYespositive or negative
reasonstringNoReason for the feedback
volume_idstringNoVolume ID (uses default)

batch_remember

Store multiple facts at once. More efficient than calling remember in a loop.

Parameters:

NameTypeRequiredDescription
memoriesarrayYesArray of { content, memory_type? } objects (1–100)
volume_idstringNoVolume ID (uses default)

get_memory

Retrieve a specific memory by its ID. Useful for viewing full details of a memory found via query.

Parameters:

NameTypeRequiredDescription
memory_idstringYesUUID of the memory

get_profile

Get an auto-generated user profile based on stored memories. Returns stable facts, recent activity, relationships, and a summary.

Parameters:

NameTypeRequiredDescription
user_idstringYesThe user ID to generate a profile for
volume_idstringNoVolume ID (uses default)

get_context

Get a context block from stored memories. Returns a pre-formatted context string ready to inject into system prompts.

Parameters:

NameTypeRequiredDescription
volume_idstringNoVolume ID (uses default)
user_idstringNoUser ID for personalized context
max_tokensnumberNoMax tokens for context block (default: 2000)

list_documents

List all documents that have been uploaded and processed for a volume.

Parameters:

NameTypeRequiredDescription
volume_idstringNoVolume ID (uses default)

Resources

URIDescription
memory://graphJSON representation of the knowledge graph for the default volume

Prompts

summarize-knowledge

Generates a comprehensive summary of all knowledge in a volume. Useful as a conversation starter.

what-do-you-know-about

Asks the AI to synthesize everything SharedMemory knows about a specific topic, combining entity data, memories, and graph facts.

Usage Examples

Once configured, just talk to your AI naturally:

"Remember that our quarterly meeting is on March 15th"

"What do you know about the React migration project?"

"Show me everyone who works on the backend team"

"What did I tell you about deployment procedures?"

The MCP server handles the API calls behind the scenes.