MCP Clients

Connect Model Context Protocol clients over SSE or stdio.

The MemexAI service exposes the same core tool engine over Model Context Protocol. REST and MCP share path validation, tool execution, revisions, and access logs.

SSE transport

http://localhost:8080/v1/mcp/sse?userId=user_123&actor=claude&apiKey=dev-agent-key

userId defaults to default, and actor defaults to mcp-client.

The API key can be sent as:

  • Authorization: Bearer ...
  • apiKey query parameter
  • token query parameter

Query auth exists for MCP clients that cannot set headers on SSE GET requests.

Messages for SSE sessions are posted back to:

http://localhost:8080/v1/mcp/messages?connectionId=...

Stdio transport

Build the service first:

bun run build:service

Then run the compiled service in stdio mode:

DATABASE_URL=postgresql://memexai:memexai@localhost:5433/memexai \
MEMEX_API_KEY=dev-agent-key \
node apps/service/dist/index.js --stdio --user-id user_123 --actor claude-desktop

Exposed tools

MCP clients can call the same memory tools as the REST and direct-mode APIs:

  • memory_memorize
  • memory_search
  • memory_list
  • memory_read
  • memory_write
  • memory_patch
  • memory_smart_read

On this page