Skip to main content

MCP server for Recollect

Project description

recollect-mcp

MCP server exposing cognitive memory via the Recollect SDK. 5 tools, 3 resources, server-managed sessions.

Install

pip install recollect-mcp

Usage

# stdio (default)
recollect-mcp

# streamable-http
recollect-mcp --transport streamable-http

Environment Variables

Variable Required Default Description
MEMORY_USER_ID Yes -- Scopes all operations to this user. Server refuses to start without it.
DATABASE_URL Yes postgresql://localhost:5432/memory_sdk PostgreSQL connection string.
MEMORY_LLM_PROVIDER No (auto) LLM provider: anthropic, openai, openai-compat. Empty = auto-fallback (Anthropic -> OpenAI-compat).
ANTHROPIC_API_KEY For default provider -- Anthropic API key for LLM extraction.
OPENAI_API_KEY For OpenAI provider -- OpenAI API key.
ANTHROPIC_MODEL No claude-haiku-4-5-20251001 Override Anthropic extraction model.
OPENAI_MODEL No gpt-5-mini Override OpenAI extraction model.
OLLAMA_MODEL No qwen3.5 Override Ollama extraction model.
OLLAMA_BASE_URL No http://localhost:11434/v1 Ollama API endpoint.
MEMORY_CONFIG No -- Path to custom TOML config file.
HF_HUB_OFFLINE No -- Set to 1 to skip HuggingFace HTTP checks on startup. Use after the embedding model has been cached locally.
SERVER_HOST No localhost Server bind host (streamable-http transport).
SERVER_PORT No 8000 Server bind port (streamable-http transport).

Client configuration

Add to .mcp.json (Claude Code) or claude_desktop_config.json (Claude Desktop):

{
  "mcpServers": {
    "memory": {
      "command": "uvx",
      "args": ["recollect-mcp"],
      "env": {
        "MEMORY_USER_ID": "your-user-id",
        "DATABASE_URL": "postgresql://user@localhost:5432/dbname",
        "ANTHROPIC_API_KEY": "sk-ant-..."
      }
    }
  }
}

Providers

The server requires an LLM provider for concept extraction (entities, tags, persona facts). Set MEMORY_LLM_PROVIDER to select explicitly, or omit it for auto-fallback (Anthropic -> OpenAI-compat -> fail).

MEMORY_LLM_PROVIDER Provider class Required env vars
anthropic AnthropicProvider ANTHROPIC_API_KEY
openai OpenAIProvider OPENAI_API_KEY
openai-compat OpenAICompatProvider OLLAMA_MODEL + OLLAMA_BASE_URL
(empty/unset) Auto-fallback Tries Anthropic, then OpenAI-compat

Anthropic (default)

"env": {
  "MEMORY_USER_ID": "your-user-id",
  "MEMORY_LLM_PROVIDER": "anthropic",
  "DATABASE_URL": "postgresql://user@localhost:5432/dbname",
  "ANTHROPIC_API_KEY": "sk-ant-...",
  "HF_HUB_OFFLINE": "1"
}

OpenAI

"env": {
  "MEMORY_USER_ID": "your-user-id",
  "MEMORY_LLM_PROVIDER": "openai",
  "DATABASE_URL": "postgresql://user@localhost:5432/dbname",
  "OPENAI_API_KEY": "sk-...",
  "OPENAI_MODEL": "gpt-5-mini",
  "HF_HUB_OFFLINE": "1"
}

Ollama / OpenAI-compatible

"env": {
  "MEMORY_USER_ID": "your-user-id",
  "MEMORY_LLM_PROVIDER": "openai-compat",
  "DATABASE_URL": "postgresql://user@localhost:5432/dbname",
  "OLLAMA_MODEL": "qwen3:8b",
  "OLLAMA_BASE_URL": "http://localhost:11434/v1",
  "HF_HUB_OFFLINE": "1"
}

Reasoning models (Qwen3, DeepSeek-R1) use thinking tokens that count against the extraction budget. If remember returns extraction errors, increase max_tokens via a custom config file:

# memory.toml
[extraction]
max_tokens = 8192

Custom configuration

Mount a memory.toml in the server's working directory, or set MEMORY_CONFIG:

"env": {
  "MEMORY_USER_ID": "your-user-id",
  "DATABASE_URL": "postgresql://user@localhost:5432/dbname",
  "ANTHROPIC_API_KEY": "sk-ant-...",
  "MEMORY_CONFIG": "/path/to/memory.toml"
}

Tools

Tool Parameters Description
remember content: str Store an experience. LLM extracts entities, concepts, significance, and persona facts.
recall query: str Retrieve relevant memories. Returns persona facts as context followed by matching traces.
pin content: str Promote a statement to a permanent persona fact (allergies, preferences, relationships).
unpin fact_id: str Remove a persona fact.
forget trace_id: str Delete a memory trace.

Resources

URI Description
memory://primer Relational graph of persona facts. Read at conversation start for user context.
memory://facts All active persona facts with confidence scores and timestamps.
memory://health Server and database health status.

Requirements

  • Python 3.12+
  • PostgreSQL 17 with pgvector

License

MIT

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

recollect_mcp-0.3.8.tar.gz (7.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

recollect_mcp-0.3.8-py3-none-any.whl (8.3 kB view details)

Uploaded Python 3

File details

Details for the file recollect_mcp-0.3.8.tar.gz.

File metadata

  • Download URL: recollect_mcp-0.3.8.tar.gz
  • Upload date:
  • Size: 7.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.10.7 {"installer":{"name":"uv","version":"0.10.7","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for recollect_mcp-0.3.8.tar.gz
Algorithm Hash digest
SHA256 8aced0253c9b4ff6cca7b076ce5456016f6543b7a10c503d015a4508210de3ca
MD5 b7d79c173b02f6e9a0f5eed55bd6cb9c
BLAKE2b-256 8dbe28775780cae541b4d86c3044d4020c384e3bcc00dd9c7b870c4faf3f5a61

See more details on using hashes here.

File details

Details for the file recollect_mcp-0.3.8-py3-none-any.whl.

File metadata

  • Download URL: recollect_mcp-0.3.8-py3-none-any.whl
  • Upload date:
  • Size: 8.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.10.7 {"installer":{"name":"uv","version":"0.10.7","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for recollect_mcp-0.3.8-py3-none-any.whl
Algorithm Hash digest
SHA256 b839e6fa3c2ccc1024cce3e374770919cc1daf4c1933d614264c89d3ab68d3c8
MD5 09864cceb75b26693d396caa274f4510
BLAKE2b-256 5c7dcb861530c2002865ac5f7a8202837081147aaaa8e29f76390d98e993dd46

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page