Home/Documentation

MCP Server

Model Context Protocol5 min setup

Connect MemoAir to Cursor, Claude, or any MCP-compatible AI tool. Your assistant gets persistent memory that survives across every conversation.

Connect Cursor — 5 minutes

Cursor natively supports HTTP MCP transport. The fastest path uses the dashboard one-click install:

One-click install (recommended)

  1. 1.Open dashboard.memoair.space
  2. 2.Go to Connected Apps → click CursorInstall
  3. 3.Cursor opens and configures MCP automatically
  4. 4.Run npx -p memoair-mcp memoair-init in your project root
  5. 5.Press Cmd+Shift+PDeveloper: Reload Window

Terminal fallback — if the deeplink didn't open, this single command writes .cursor/mcp.json and runs memoair-init together:

BASH
npx -p memoair-mcp memoair-connect cursor \
--mcp-url "https://mcp-server.memoair.space/mcp" \
--project-api-key "memoair_pk_your_project_key" \
--user-id "your-email@example.com" \
--init

Manual config — create .cursor/mcp.json in your project root:

.cursor/mcp.json
JSON
{
"mcpServers": {
"memoair": {
"url": "https://mcp-server.memoair.space/mcp",
"headers": {
"X-API-Key": "memoair_pk_your_project_key",
"X-User-ID": "your-email@example.com"
}
}
}
}

Smart rules: memoair-init installs a Cursor rule that auto-retrieves only the coding rules relevant to your current task — saving 60–80% of rule tokens per request. Full Cursor guide →

Verify your setup

Press Cmd+Shift+PMCP: List Servers — confirm memoair appears. Then ask Cursor: "Use MemoAir to save that this project uses MemoAir for memory." — if MemoAir responds, you're done.

Other Clients

Prerequisites

  • Node.js 20+ (required by the memoair-mcp package)
  • A MemoAir project API key — prefix memoair_pk_ — from your dashboard settings
  • Cursor, Claude Desktop, or Claude Code

Available Tools

Once connected, your AI assistant has access to these memory tools:

search_memories
Search for coding conventions, architecture context, and project knowledge. Pass file_path to auto-scope results to the relevant service.
query (required)limitviewtagstag_modefile_pathinclude_supersededsession_id
save_memory
Save a coding insight, convention, or pattern to working memory. Include relevant tags to make it findable in future sessions.
content (required)typesource_urlsource_titleimage_urldescriptiontags
save_document
Save or update a versioned canonical document — architecture decisions, coding rules, conventions, or setup guides. Old versions are automatically superseded.
content (required)doc_family_id (required)source_titlesource_urltagssupersedes_doc_family_id
list_tags
Discover what knowledge categories exist in the project. Returns tags grouped by namespace (service, type, topic, lang).
prefix
delete_memory
Delete a specific memory by its ID, obtained from search results.
id (required)
update_memory
Update an existing memory with new content.
id (required)content (required)typesource_urlsource_titleimage_urldescription
analyze_query
Save new information and search for related context simultaneously. Use when the user shares new facts, updates, or corrections.
query (required)source_urlsource_title
list_working_memory
List items in working memory grouped by category (tab, clip, task, agent, chat). Useful for cross-agent context sharing.
categoriesinclude_contentlimit
get_working_memory_context
Retrieve context from a specific working memory item or search within a category.
category (required)queryitem_idlimit
get_doc_family
Retrieve the current version of a canonical document by family ID. More precise than search for known doc families.
doc_family_id (required)include_history
get_recent_deltas
Get recent memory deltas for a doc family or service. Use after get_doc_family to catch up on decisions since the last canonical save.
doc_family_idservice_tagsince_doc_familylimit

Server Prompts

MCP clients that support prompts can invoke these built-in workflows:

wiki_coding_assistant

Initialize as a wiki-first coding assistant: load project guides before searching, save deltas after changes.

load_project_context

Load project context using the guide-first pattern: get_doc_family → get_recent_deltas → search_memories for gaps.

record_coding_decision

Record a coding decision or learning — routes to save_document for full docs, save_memory for small deltas.

Environment Variables

For stdio mode or self-hosted deployments:

VariableRequiredDescription
MEMOAIR_API_KEYstdio onlyProject API key (prefix memoair_pk_). HTTP mode uses the X-API-Key header instead.
MEMOAIR_USER_IDOptionalUser ID for memory isolation in stdio mode. HTTP mode uses the X-User-ID header.
MEMOAIR_API_BASEOptionalBackend URL (defaults to http://localhost:8080). Set for self-hosted instances.
MEMOAIR_TRANSPORTOptionalTransport mode: http (default for hosted), stdio (local dev).

Troubleshooting

Cursor deeplink did not open

Use the terminal fallback: npx -p memoair-mcp memoair-connect cursor --mcp-url ... --project-api-key ... --user-id ... --init

MCP server not appearing in tool list

Run Developer: Reload Window from the Command Palette. If still missing, verify .cursor/mcp.json exists and contains a valid mcpServers object.

Authentication errors

Verify your API key starts with memoair_pk_ and hasn't expired. Regenerate from dashboard settings if needed.

Node.js version error

memoair-mcp requires Node.js 20+. Run node --version to check, then upgrade via nvm or nodejs.org if needed.

.cursor/mcp.json has invalid JSON

Open the file and validate it. The file must be a JSON object with a top-level mcpServers key. Remove comments or trailing commas.

memoair-init did not create files

Existing files are intentionally preserved. Check that .cursor/rules/memoair.mdc and memoair.md don't already exist. Delete them if you want a fresh install.

Related

Full Cursor Integration Guide

Smart rules, token savings, project guide, and team workflows