MCP ServerNEW

MCP Server

Save your AI coding sessions and resume them from any tool — Claude Code, Cursor, Windsurf, or Continue.dev. Uses the open Model Context Protocol standard.

What is the MCP Server?

The Memra MCP Server is a local process that connects your VS Code AI tools to Memra's cloud memory. When you ask your AI assistant to “save this session” or “resume my last work”, the MCP server handles the API calls automatically.

ℹ️ Note

What is MCP? The Model Context Protocol (MCP) is an open standard by Anthropic that lets AI tools talk to external services. Think of it as a plugin system — once installed, the AI can call Memra tools just like any other function. No copy-pasting, no manual uploads.

The MCP server runs locally as a background process. Your AI tool communicates with it over standard I/O, and it forwards requests to the Memra API using your MCP key.

Prerequisites

Before installing, make sure you have:

  • Node.js 18+Run: node --version to check
  • npm or npxComes with Node.js
  • A Memra accountFree at memra-rho.vercel.app/login
  • An MCP API keyCreate one at Dashboard → MCP Keys (mk_mcp_...)
  • A supported AI toolClaude Code, Cursor, Windsurf, or Continue.dev

⚠️ Warning

MCP keys start with mk_mcp_.... Memory API keys (mk_mem_...) will be rejected with a 403 error. Make sure to create an MCP key specifically.

Installation

The MCP server ships as a local folder (mcp-server/) inside the Memra project. No global install needed — you point your AI tool directly at the built file.

1

Build the MCP server

cd /path/to/memra/mcp-server
npm install
npm run build

This creates mcp-server/dist/index.js — the file your AI tool will run.

2

Verify the build

node /path/to/memra/mcp-server/dist/index.js

You should see: 🧠 Memra MCP Server v0.1.0 followed by a missing key error (expected — you haven't set the key yet).

3

Get your MCP key

Go to Dashboard → MCP Keys and create a new key. It will start with mk_mcp_. Copy it — you'll need it in the next step.

Claude Code Setup

1

Open your Claude Code MCP config

Claude Code reads MCP servers from ~/.claude/claude_desktop_config.json (macOS/Linux) or %APPDATA%\Claude\claude_desktop_config.json (Windows).

# macOS/Linux
code ~/.claude/claude_desktop_config.json

# Windows
code %APPDATA%\Claude\claude_desktop_config.json
2

Add the Memra server

Use the full absolute path to the built dist/index.js file:

{
  "mcpServers": {
    "memra": {
      "command": "node",
      "args": ["/full/path/to/memra/mcp-server/dist/index.js"],
      "env": {
        "MEMRA_API_KEY": "mk_mcp_your_key_here"
      }
    }
  }
}

// Windows example:
// "args": ["C:\\Users\\you\\Desktop\\memra\\mcp-server\\dist\\index.js"]
3

Restart Claude Code

Close and reopen Claude Code. The MCP server will start automatically.

4

Verify connection

In a new Claude Code conversation, type:

> List my Memra sessions

Claude should respond with your sessions (or “No sessions found” if this is your first time).

5

Save your first session

> Save this conversation to Memra as "Project setup session"

⚠️ Warning

Never commit your MCP key to git. Add .claude/claude_desktop_config.json to your .gitignore if your home directory is under version control.

Cursor Setup

1

Open Cursor Settings

Go to Settings → Features → MCP Servers or open ~/.cursor/mcp.json directly.

2

Add Memra to your MCP config

{
  "mcpServers": {
    "memra": {
      "command": "node",
      "args": ["/full/path/to/memra/mcp-server/dist/index.js"],
      "env": {
        "MEMRA_API_KEY": "mk_mcp_your_key_here"
      }
    }
  }
}
3

Enable the server

In Cursor settings, toggle the Memra server on. You should see a green dot when it connects.

4

Test it

Open Cursor Composer and type:

> Save this session to Memra
5

Resume a session

> Resume my last Memra session

Windsurf Setup

1

Open Windsurf MCP settings

Go to Settings → MCP or edit ~/.codeium/windsurf/mcp_config.json.

2

Add Memra

{
  "mcpServers": {
    "memra": {
      "command": "node",
      "args": ["/full/path/to/memra/mcp-server/dist/index.js"],
      "env": {
        "MEMRA_API_KEY": "mk_mcp_your_key_here"
      }
    }
  }
}
3

Restart Windsurf

Reload the Windsurf window (Ctrl+Shift+P → “Reload Window”).

4

Test in Cascade

> Save this session to Memra

Continue.dev Setup

1

Edit ~/.continue/config.json

{
  "experimental": {
    "modelContextProtocolServers": [
      {
        "transport": {
          "type": "stdio",
          "command": "node",
          "args": ["/full/path/to/memra/mcp-server/dist/index.js"],
          "env": {
            "MEMRA_API_KEY": "mk_mcp_your_key_here"
          }
        }
      }
    ]
  }
}
2

Reload the Continue extension

Use the VS Code command palette: Continue: Reload

3

Use Memra tools in chat

> Save this conversation to Memra

How Memory Works

The MCP Server gives your AI access to two types of persistent storage:

💬 Context Sessions

Full conversation snapshots. Saved on demand, with an AI-generated summary and resume prompt (Pro). Use these to pick up exactly where you left off.

🧠 Memories

Discrete facts, decisions, or snippets you want your AI to always remember — project architecture, your coding style, recurring preferences.

Memories are stored as vector embeddings in a pgvector database. When your AI retrieves context, Memra performs a semantic search — so even if you don't remember exactly how you phrased something, the right context surfaces automatically.

Saving Memories

Tell your AI to save a memory using natural language:

> Remember that we're using Prisma with a Neon PostgreSQL database
> Save to Memra: our auth is handled by NextAuth v5 with Google provider
> Memra: store that we prefer functional components over class components

What to save

  • ·Project architecture decisions
  • ·Tech stack and library choices
  • ·Coding conventions and style preferences
  • ·Recurring bugs and their fixes
  • ·API endpoints and data models
  • ·Deployment setup and environment variables (not secrets!)

⚠️ Warning

Never save secrets, API keys, or passwords to Memra. Memories are accessible via API and may be included in future AI context.

Loading Context

Your AI can retrieve context automatically or on demand:

Pattern 1 — Explicit retrieval

> What do we have saved about authentication?
> Recall our Memra memories about the database setup

Pattern 2 — Resume a session

> Resume my last Memra session
> Load the session titled "Stripe integration work"

Pattern 3 — Automatic (with a system prompt)

Add this to your AI tool's system prompt to auto-load memories:

At the start of each conversation, call the memra_get_memory tool
to retrieve relevant context for the current task.

Switching Between AI Tools

One of the biggest benefits of Memra is cross-tool memory. Start in Claude Code, continue in Cursor, pick up in Windsurf — your sessions and memories follow you everywhere.

Claude Code session 1
└── "Save to Memra: we decided to use tRPC over REST"

Cursor session (later)
└── "What do we have saved about API architecture?"
    └── Memra returns: "tRPC over REST" ✓

Windsurf (next day)
└── "Resume my last Memra session"
    └── Loads Claude Code session context ✓
FeatureFreePro
Save sessions✓ (5 max)✓ Unlimited
Save memories
Resume sessions
AI-generated summaries
Resume prompts
Cross-tool sync
Monthly API calls20010,000

Session Management

View and manage your sessions from the dashboard or via your AI tool:

# List all sessions
> List my Memra sessions

# Get a specific session
> Show me the session titled "Auth refactor"

# Delete a session
> Delete the oldest Memra session

You can also manage sessions visually at Dashboard → MCP Sessions. From there you can view summaries, copy resume prompts, and delete sessions.

💡 Tip

On the free plan, you can store up to 5 sessions. Saving a new session when at the limit will prompt you to delete an old one or upgrade.

MCP Tools Reference

The MCP server exposes 5 tools. Your AI calls these automatically based on your natural language requests.

ToolExample triggerDescriptionPlan
memra_save_contextSave this session to MemraSaves the current conversation as a context session. Includes message count, token estimate, and tool name.Free
memra_resumeResume my last Memra sessionReturns the resume prompt and last 5 messages from your most recent (or specified) session. Requires Pro for AI-generated resume prompts.Pro
memra_list_sessionsList my Memra sessionsReturns a paginated list of your saved sessions with titles, tools, message counts, and summaries.Free
memra_save_memoryRemember that we use tRPCSaves a discrete memory (fact, decision, preference). Stored as a vector embedding for semantic retrieval.Free
memra_get_memoryWhat do we have saved about auth?Retrieves semantically relevant memories for a given query. Returns the most relevant stored facts.Free

Troubleshooting

AI says "memra tool not found" or "no MCP tools available"

  • 1.Make sure memra-mcp is installed globally: run memra-mcp --version
  • 2.Restart your AI tool completely (not just reload)
  • 3.Check the MCP config file path is correct for your OS
  • 4.Verify the JSON in the config file is valid (no trailing commas)

Error: "Wrong API key type" (403)

  • 1.You're using a Memory key (mk_mem_...) instead of an MCP key (mk_mcp_...)
  • 2.Go to Dashboard → MCP Keys and create a new MCP key
  • 3.Update your MEMRA_API_KEY in the MCP config

Error: "Invalid or missing API key" (401)

  • 1.Double-check that MEMRA_API_KEY is set correctly in your MCP config
  • 2.Make sure there are no extra spaces or quotes around the key
  • 3.Verify the key is still active at Dashboard → MCP Keys

Error: "Monthly API limit reached" (429)

  • 1.You've used all your monthly MCP API calls (200 on free plan)
  • 2.Upgrade to Pro for 10,000 calls/month at /pricing
  • 3.Limits reset on the 1st of each month

Session save fails with "session limit reached"

  • 1.Free plan allows 5 sessions maximum
  • 2.Delete old sessions from Dashboard → MCP Sessions
  • 3.Or upgrade to Pro for unlimited sessions

node: cannot find module / path not found

  • 1.Make sure you ran: cd mcp-server && npm install && npm run build
  • 2.Use the absolute path to dist/index.js — not a relative path
  • 3.On Windows use double backslashes: C:\\Users\\you\\memra\\mcp-server\\dist\\index.js
  • 4.Verify the file exists: ls /path/to/memra/mcp-server/dist/index.js

FAQ

Is the MCP server free?

Yes. The free plan includes 200 MCP API calls/month and up to 5 saved sessions. Pro ($9/month) gives you 10,000 calls, unlimited sessions, and AI-generated summaries.

Does Memra store my code?

Memra stores what your AI sends it — typically conversation messages, not raw files. If your AI includes code snippets in the conversation, those will be stored. Never ask your AI to send secrets or credentials.

Can I use Memra with multiple AI tools simultaneously?

Yes. Install the MCP server on each machine/tool with the same API key. Sessions and memories are shared across all tools connected to the same account.

What's the difference between a session and a memory?

A session is a full conversation snapshot — used to resume where you left off. A memory is a discrete fact or decision — used to give your AI persistent context across many conversations.

Do I need a separate key for each AI tool?

No. One MCP key works across all tools. You can create multiple keys for organization (e.g., one per machine), but it's not required.

How is this different from the Memory API?

The Memory API is for developers building AI applications — you call it from your own code. The MCP Server is for developers using AI coding assistants — it works inside Claude Code, Cursor, Windsurf, etc. without writing any code.

Is the MCP server open source?

The package is available on npm as @memra/mcp-server. Source available upon request.

What happens to my data if I cancel Pro?

Your sessions and memories are retained. You'll be limited to 5 sessions (oldest may need to be deleted) and 200 API calls/month.

Ready to get started?

Create your MCP key and start saving sessions in under 5 minutes.

Memra MCP Server — v1.0← Back to docs