memories.sh logomemories.sh
CLI Reference

memories serve

Start the MCP server (stdio or SSE transport).

memories serve [options]

Start the Model Context Protocol (MCP) server. Supports two transport modes:

  • stdio (default) — For desktop apps like Cursor, Claude Code
  • SSE/HTTP — For web-based tools like v0

Options

OptionDescriptionDefault
--sseUse SSE/HTTP transport instead of stdiofalse
-p, --port <port>Port for SSE server3030
--host <host>Host to bind to127.0.0.1
--corsEnable CORS for cross-origin requestsfalse

Stdio Transport (Default)

For desktop apps that spawn the server as a subprocess:

memories serve

The server communicates via stdin/stdout using the MCP protocol. Diagnostic messages go to stderr.

Auto-Configuration

Run memories init to automatically configure MCP for detected tools:

memories init

This adds the appropriate config to each tool's MCP settings.

Manual Configuration

Add to your tool's MCP config:

{
  "mcpServers": {
    "memories": {
      "command": "npx",
      "args": ["-y", "@memories.sh/cli", "serve"]
    }
  }
}

SSE Transport (Local Development)

For local development and testing with web-based tools:

memories serve --sse

Output:

[memories] Starting MCP server with SSE transport
[memories] Listening on http://127.0.0.1:3030
[memories] Connect v0 or other clients to: http://127.0.0.1:3030/mcp

Examples

# Local development
memories serve --sse

# Custom port
memories serve --sse --port 8080

# Enable CORS for browser clients
memories serve --sse --cors

Endpoints

EndpointDescription
GET/POST /mcpMCP Streamable HTTP endpoint
GET /healthHealth check (returns {"status":"ok"})

For production use with v0 and web tools, use the hosted endpoint at https://memories.sh/api/mcp with an API key from your dashboard. See the v0 integration guide.

Available Tools

The MCP server exposes these tools:

ToolDescription
get_contextGet rules and relevant memories (primary tool)
add_memoryStore a memory (global: true or project_id override)
search_memoriesFull-text or semantic search
get_rulesGet all active rules
list_memoriesList recent memories
edit_memoryUpdate a memory
forget_memorySoft-delete a memory
bulk_forget_memoriesBulk soft-delete memories matching filters
vacuum_memoriesPermanently purge soft-deleted memories
add_reminderCreate a cron-based reminder
list_remindersList reminders
run_due_remindersEvaluate and emit due reminders
enable_reminderEnable a reminder
disable_reminderDisable a reminder
delete_reminderDelete a reminder

When your MCP client runs outside the target repo, pass project_id to force project scope:

{
  "name": "add_memory",
  "arguments": {
    "content": "Use backoff for transient failures",
    "type": "rule",
    "project_id": "github.com/webrenew/agent-space"
  }
}

Use global: true for global memories. Do not send both global and project_id.

Available Resources

ResourceDescription
memories://rulesAll active rules
memories://recent20 most recent memories
memories://project/{projectId}All memories for a specific project

Config Locations by Tool

ToolConfig LocationTransport
Cursor.cursor/mcp.jsonstdio
Claude Code.mcp.jsonstdio
Windsurf.windsurf/mcp.jsonstdio
VS Code.vscode/mcp.jsonstdio
v0MCP settingsSSE

Security Note

The SSE server exposes your memories over HTTP. Only bind to 127.0.0.1 (default) unless using a tunnel with authentication.

See the v0 integration guide for security best practices when exposing the server remotely.

On this page