Skip to main content

TiMEM MCP Server - Model Context Protocol server for TiMEM Engine

Project description

TiMEM MCP Server

Language: English | 简体中文

Model Context Protocol server for TiMEM Engine, providing memory management tools for AI applications.

License: MIT

Need help configuring MCP? Copy the AI setup prompt into any AI assistant and follow the steps.

Get your API key

Obtain an API key from TiMEM Console.

Set environment variables on your system (recommended — do not hard-code keys in config files):

export TiMEM_API_KEY="your-api-key"
export TiMEM_USER_ID="your-user-id"

Quick Start (Cloud HTTP — recommended)

No local install. Set environment variables, then add this to your MCP client config (~/.cursor/mcp.json):

{
  "mcpServers": {
    "TiMEM-MCP": {
      "url": "https://api.timem.cloud/mcp",
      "headers": {
        "X-API-Key": "${env:TiMEM_API_KEY}",
        "X-TiMEM-User-Id": "${env:TiMEM_USER_ID}"
      }
    }
  }
}

Restart your MCP client. Expect 4 tools: create_memory, search_memories, delete_memory, ready.

Guide: cursor_en.md · 中文版

Quick Start (Local stdio — optional)

For offline development, install from GitHub; PyPI timem-mcp==0.2.1 is also available.

1. Install timem-mcp

Option A — clone + pip:

git clone https://github.com/TiMEM-AI/timem-mcp.git
cd timem-mcp
git checkout v0.2.0
pip install -e .

Option B — uvx from GitHub (requires uv; no clone needed):

uvx --from git+https://github.com/TiMEM-AI/timem-mcp@v0.2.0 timem-mcp

Full guide: from_github_en.md · 中文版

2. Configure your MCP client

Client Guide
Cursor cursor_en.md · 中文
Claude Desktop claude_desktop.md
All clients (paths) mcp_clients_en.md · 中文

Copy an example config:

On Windows with conda, set command to the full path of your python.exe.

3. Verify

Fully quit and restart your client. Confirm 4 tools: create_memory, search_memories, delete_memory, ready. Run ready to check API connectivity.

Cursor deeplink (optional)

python scripts/generate_cursor_deeplink.py local       # clone + pip
python scripts/generate_cursor_deeplink.py from-source # uvx from GitHub

Optional: Cursor Rules

Add .cursor/rules/timem-memory.mdc to your project so Agent calls memory tools proactively.

Tool reference: tools_en.md · 中文

Quick Start: PyPI (optional)

When published to PyPI:

{
  "mcpServers": {
    "TiMEM-MCP-0.2.0": {
      "type": "stdio",
      "command": "uvx",
      "args": ["timem-mcp"],
      "env": {
        "TiMEM_API_KEY": "${env:TiMEM_API_KEY}",
        "TiMEM_USER_ID": "${env:TiMEM_USER_ID}",
        "TiMEM_API_HOST": "https://api.timem.cloud"
      }
    }
  }
}

Deeplink: python scripts/generate_cursor_deeplink.py pypi

Configuration

Variable Required Default Description
TiMEM_API_KEY Yes - TiMEM Engine API key
TiMEM_USER_ID Recommended - Default user ID (overridable per tool call)
TiMEM_API_HOST No https://api.timem.cloud API endpoint
TiMEM_MEMORY_TASK_POLL_INTERVAL_SECONDS No 1.0 Poll interval for async memory generation
TiMEM_MEMORY_TASK_MAX_WAIT_SECONDS No 60.0 Max wait for async memory generation

Both TiMEM_* and TIMEM_* prefixes are supported (TiMEM_* takes priority).

Available tools

create_memory

Create memories from conversation history. Backend accepts HTTP 202 and generates in the background; this server polls until complete.

Parameters: messages, session_id, optional user_id, expert_id, domain

API: POST /api/v1/memory/GET /api/v1/memory/memory-generation/tasks/{task_id}

search_memories

Enhanced semantic memory search.

Parameters: query_text, layer, user_id, limit, enable_memories_rethink

API: POST /api/v1/memory/search

delete_memory

Soft-delete a single memory by ID. No hard_delete or bulk delete.

When to use: User explicitly asks to forget/remove a memory; confirm memory_id from search or create first.

Parameters: memory_id

API: DELETE /api/v1/memory/{memory_id}

ready

Health check for MCP config and TiMEM API connectivity.

Other MCP clients

Claude Desktop, Windsurf, Cline, and other stdio MCP clients use the same JSON shape. See mcp_clients_en.md for config paths and AI setup prompt for guided setup.

Development

pip install -e ".[dev]"
pytest tests/ -m "not live" -v
pytest tests/ -m live -v                # requires backend + credentials
pytest tests/test_mcp_stdio.py -v       # confirms 4 MCP tools

MCP Inspector (manual testing):

npx @modelcontextprotocol/inspector python -m timem_mcp

See docs/tools_en.md for per-field Inspector examples.

Contributing

See CONTRIBUTING.md. Security: SECURITY.md. Changes: CHANGELOG.md.

License

MIT License — see LICENSE.

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

timem_mcp-0.2.1.tar.gz (43.6 kB view details)

Uploaded Source

Built Distribution

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

timem_mcp-0.2.1-py3-none-any.whl (19.4 kB view details)

Uploaded Python 3

File details

Details for the file timem_mcp-0.2.1.tar.gz.

File metadata

  • Download URL: timem_mcp-0.2.1.tar.gz
  • Upload date:
  • Size: 43.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for timem_mcp-0.2.1.tar.gz
Algorithm Hash digest
SHA256 66335a3a99aee29251cbaa8a83df795a940b92cd987446115d55bca78a6f37d8
MD5 b63fe099bc3c64639b5bbd3b22a0b9f3
BLAKE2b-256 07172aca85cc8a0e6f5afe9c767e6c4d3d1f2eb937c40629126a49084c07eff6

See more details on using hashes here.

Provenance

The following attestation bundles were made for timem_mcp-0.2.1.tar.gz:

Publisher: publish.yml on TiMEM-AI/timem-mcp

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file timem_mcp-0.2.1-py3-none-any.whl.

File metadata

  • Download URL: timem_mcp-0.2.1-py3-none-any.whl
  • Upload date:
  • Size: 19.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for timem_mcp-0.2.1-py3-none-any.whl
Algorithm Hash digest
SHA256 4474f74b61858afa4ab380d00509a3d1ed7f342d90f30e807c537710bcd6704a
MD5 8a1d99e3355cea87190d8b5d837463de
BLAKE2b-256 4e48825304bd2a74386606ec44e64e4b798cb92be3a3e4234c6f1ba4464447a3

See more details on using hashes here.

Provenance

The following attestation bundles were made for timem_mcp-0.2.1-py3-none-any.whl:

Publisher: publish.yml on TiMEM-AI/timem-mcp

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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