MemNexus
AI Agents

MCP Integration

Connect AI agents to MemNexus via Model Context Protocol for native memory access.

The MemNexus MCP server gives AI agents direct access to memory tools. Agents can create, search, and manage memories without any custom code — the MCP protocol handles everything.

What is MCP?

Model Context Protocol (MCP) is an open standard for connecting AI agents to external tools and data sources. Instead of building custom integrations, you configure an MCP server and the agent gets native tool access.

MemNexus provides an MCP server that exposes 19 tools across memory management, conversations, topics, patterns, and graph-based retrieval.

Quick setup

1. Install

npm install -g @memnexus-ai/mcp-server

2. Configure your AI platform

Add MemNexus to your MCP configuration:

{
  "mcpServers": {
    "memnexus": {
      "command": "npx",
      "args": ["@memnexus-ai/mcp-server"],
      "env": {
        "MEMNEXUS_API_KEY": "cmk_live_xxx.yyy"
      }
    }
  }
}

Config file locations:

PlatformConfig path
Claude Desktop (macOS)~/.config/claude/claude_desktop_config.json
Claude Desktop (Windows)%APPDATA%/Claude/claude_desktop_config.json
Claude Code.claude/settings.json or via MCP settings
Cursor.cursor/mcp.json

3. Verify

Restart your AI platform. You should see MemNexus tools available. Try asking your agent:

"Search my memories for recent deployment notes"

Available tools

The MCP server exposes 19 tools organized into 5 categories:

Memory tools

ToolDescription
create_memoryCreate a new memory with content, topics, and importance
search_memoriesSemantic search across all memories
get_memoryRetrieve a specific memory by ID
list_memoriesList memories with pagination
update_memoryUpdate an existing memory
delete_memoryDelete a memory

Conversation tools

ToolDescription
list_conversationsList all conversations
get_conversation_summaryGet summary of a conversation
get_conversation_timelineChronological timeline of memories in a conversation

Topic tools

ToolDescription
search_topicsSearch for topics
discover_related_topicsFind topics related to a given topic
get_topic_summaryGet summary statistics for a topic

Pattern tools

ToolDescription
detect_patternsDetect behavioral patterns from memories
compile_patternsCompile detected patterns
get_patternsList detected patterns
update_patternUpdate pattern metadata

Advanced tools

ToolDescription
graphrag_queryGraph-based retrieval augmented generation
detect_memory_communitiesDetect communities in the memory graph
analyze_patternsAdvanced pattern analysis

Tool parameters

create_memory

{
  "content": "Deployed v1.26.2 with OpenAPI validation fixes.",
  "memoryType": "episodic",
  "topics": ["deployment", "core-api"],
  "importance": 0.8
}
ParameterTypeRequiredDescription
contentstringYesThe memory content
memoryTypestringYesepisodic, semantic, or procedural
topicsstring[]NoTags for categorization
importancenumberNo0-1 significance score
contextstringNoAdditional context

search_memories

{
  "query": "deployment issues last week",
  "limit": 10,
  "threshold": 0.7
}
ParameterTypeRequiredDescription
querystringYesNatural language search query
limitnumberNoMax results (default: 20)
thresholdnumberNoMinimum similarity score (default: 0.7)

graphrag_query

{
  "query": "What technical decisions were made this quarter?",
  "depth": 2,
  "limit": 10,
  "includeRelationships": true
}
ParameterTypeRequiredDescription
querystringYesNatural language query
depthnumberNoGraph traversal depth
limitnumberNoMax results
includeRelationshipsbooleanNoInclude graph relationships

Architecture

The MCP server is a stateless translation layer:

AI Agent (Claude, Cursor)

    ▼ MCP Protocol
┌────────────────┐
│  MCP Server    │
│  (Port 3001)   │
│  Translates    │
│  MCP → REST    │
└───────┬────────┘
        │ HTTP

┌────────────────┐
│  API Gateway   │
│  Auth + Rate   │
│  Limiting      │
└───────┬────────┘


┌────────────────┐
│  Core API      │
└────────────────┘

The MCP server has no direct database access. All requests flow through the API Gateway, which handles authentication and rate limiting.

Environment variables

VariableDescriptionDefault
MEMNEXUS_API_KEYYour MemNexus API keyRequired
API_GATEWAY_URLAPI Gateway URLhttps://api.memnexus.ai
MCP_PORTServer port3001
LOG_LEVELLogging levelinfo

Troubleshooting

Agent doesn't see MemNexus tools

  1. Check that the config file path is correct for your platform
  2. Restart the AI platform after changing config
  3. Verify the API key is valid: mx auth status

Tools fail with authentication error

  1. Check that MEMNEXUS_API_KEY is set correctly in the MCP config
  2. Verify the key format: cmk_live_<id>.<secret>
  3. Test the key directly: curl -H "Authorization: Bearer $MEMNEXUS_API_KEY" https://api.memnexus.ai/health

Connection timeout

  1. Check your internet connection
  2. Verify the API is reachable: mx system health
  3. Check if a firewall is blocking outbound connections on port 443

Next steps