跳到主要内容
印格

API documentation · Memory API

Agent Memory MCP

Use Engra Agent Memory from MCP clients (Cursor, Claude Desktop, etc.) via Model Context Protocol Streamable HTTP. See the REST API guide for HTTP integration.

MCP endpoint

Single URL supporting POST / GET / DELETE (stateless JSON mode). Clients send JSON-RPC messages to this endpoint.

https://ai-sass-7pymefszf-keyskulls-projects.vercel.app/api/v1/memory/mcp

Authentication

MCP and REST share the same dashboard API keys (inf_ prefix). Tenant-scoped keys are required; local .env placeholder keys cannot be used for production MCP.

Create an API key

  1. Open Console → API keys (/dashboard/keys)
  2. Multi-select scopes under Gateway / Memory groups
  3. Quick presets: MCP read-only, MCP read/write, Gateway default
  4. Read-only agents: memory:read only
  5. For memory_save_atom: add memory:write
  6. Memory MCP usually needs no Gateway binding
  7. Copy the inf_… key immediately into your MCP client Authorization header

Scope reference

  • memory:readmemory_list_libraries / search / recall / wake-up / list_atoms
  • memory:writememory_save_atom, POST /atoms

Headers

  • Authorization: Bearer inf_xxxxxxxx (recommended)
  • X-API-Key: inf_xxxxxxxx
  • Do not use upstream Gemini/OpenAI keys — those belong in Gateway upstream settings

Transport

  • Protocol: MCP Streamable HTTP (2025-11-25)
  • Mode: stateless + JSON response (one POST → one JSON body, no long-lived SSE required)
  • Standard MCP methods supported: initialize, tools/list, tools/call, etc.

Recommended workflow

  1. Call memory_list_libraries first to obtain memoryLibraryId
  2. Use memory_search / memory_recall / memory_wake_up for retrieval
  3. Use memory_save_atom for synchronous writes
  4. All tools except list_libraries require memoryLibraryId in arguments

Tools

ToolScopeDescription
memory_list_librariesmemory:readList memory libraries for the workspace (id, name, slug, persona)
memory_searchmemory:readL3 deep semantic search
memory_recallmemory:readL2 topic recall
memory_wake_upmemory:readL0+L1 wake-up stack
memory_save_atommemory:writeSave an atom synchronously (same as ?sync=1)
memory_list_atomsmemory:readPaginated atom list

Cursor configuration example

{
  "mcpServers": {
    "engra-memory": {
      "url": "https://ai-sass-7pymefszf-keyskulls-projects.vercel.app/api/v1/memory/mcp",
      "headers": {
        "Authorization": "Bearer inf_xxxxxxxx"
      }
    }
  }
}

HTTP integration

Custom MCP clients should follow the Streamable HTTP spec: POST requests need Accept including application/json and text/event-stream. This server primarily responds with application/json.

← Agent Memory REST API · API keys · Memory console