# MarsNMe

> MarsNMe is an open-source MCP server for knowledge and memory. Persistent two-layer memory gateway for AI agents, backed by Supabase and pgvector. It runs as a hosted remote server, so there is nothing to install locally.

- **Kind:** MCP server
- **Pricing:** Open source
- **Platforms:** self-hosted, CLI, API
- **Website:** https://marsnme.com
- **Repository:** https://github.com/marsmanleo/marsnme/tree/HEAD/marsnme-supabase
- **MCP Registry name:** io.github.Marsmanleo/marsnme
- **Categories:** knowledge and memory
- **Listing updated:** 2026-11-15

## About

MarsNMe is a self-run MCP gateway that stores what happened between you and your agents, not just notes you wrote. Short-term memory holds session context in a profile's memories table with roughly a 30-day expiry. Long-term knowledge is stored as chunks with Jina v3 embeddings (1024 dimensions) in pgvector, searched by semantic recall.

Retrieval drills down in three steps: recall returns about 80-character previews, get_summary gives about 300 characters, and get_full returns the complete text. Each MCP_PROFILE gets its own isolated schema, so any number of agents can share one codebase without mixing memory. Migrations live in the repository as schema-as-code.

The package is run with npx on Node.js 20 or later and needs a Supabase project, its service-role key and a Jina API key. It serves POST /mcp and GET /health locally on a profile-based port, with optional Bearer enforcement and OAuth. The site also describes a hosted route and a Cloudflare-based self-hosted variant.

## Features

- **Two memory layers:** Short-term session memory with expiry and permanent long-term chunks.
- **Semantic recall:** pgvector search over Jina v3 embeddings.
- **Layered retrieval:** Previews, summaries and full text on demand.
- **Isolated profiles:** One schema per agent.
- **Schema-as-code:** Versioned migrations for reproducible setup.
- **Optional auth:** Bearer enforcement and OAuth endpoints.

## Good for

- Give a coding agent memory across sessions
- Keep separate memory spaces for several agents
- Recall earlier decisions by meaning
- Self-host agent memory on your own Supabase

## Install

### Claude Code (Terminal)

```sh
claude mcp add marsnme --env MCP_PROFILE='<MCP_PROFILE>' --env SUPABASE_BASE_URL='<SUPABASE_BASE_URL>' --env SUPABASE_SERVICE_ROLE_KEY='<SUPABASE_SERVICE_ROLE_KEY>' --env JINA_API_KEY='<JINA_API_KEY>' -- npx -y @marsnme/mcp-gateway
```

### Claude Desktop (claude_desktop_config.json)

```json
{
  "mcpServers": {
    "marsnme": {
      "command": "npx",
      "args": [
        "-y",
        "@marsnme/mcp-gateway"
      ],
      "env": {
        "MCP_PROFILE": "<MCP_PROFILE>",
        "SUPABASE_BASE_URL": "<SUPABASE_BASE_URL>",
        "SUPABASE_SERVICE_ROLE_KEY": "<SUPABASE_SERVICE_ROLE_KEY>",
        "JINA_API_KEY": "<JINA_API_KEY>"
      }
    }
  }
}
```

### Cursor (~/.cursor/mcp.json)

```json
{
  "mcpServers": {
    "marsnme": {
      "command": "npx",
      "args": [
        "-y",
        "@marsnme/mcp-gateway"
      ],
      "env": {
        "MCP_PROFILE": "<MCP_PROFILE>",
        "SUPABASE_BASE_URL": "<SUPABASE_BASE_URL>",
        "SUPABASE_SERVICE_ROLE_KEY": "<SUPABASE_SERVICE_ROLE_KEY>",
        "JINA_API_KEY": "<JINA_API_KEY>"
      }
    }
  }
}
```

### VS Code (.vscode/mcp.json)

```json
{
  "servers": {
    "marsnme": {
      "type": "stdio",
      "command": "npx",
      "args": [
        "-y",
        "@marsnme/mcp-gateway"
      ],
      "env": {
        "MCP_PROFILE": "<MCP_PROFILE>",
        "SUPABASE_BASE_URL": "<SUPABASE_BASE_URL>",
        "SUPABASE_SERVICE_ROLE_KEY": "<SUPABASE_SERVICE_ROLE_KEY>",
        "JINA_API_KEY": "<JINA_API_KEY>"
      }
    }
  }
}
```

### Windsurf (~/.codeium/windsurf/mcp_config.json)

```json
{
  "mcpServers": {
    "marsnme": {
      "command": "npx",
      "args": [
        "-y",
        "@marsnme/mcp-gateway"
      ],
      "env": {
        "MCP_PROFILE": "<MCP_PROFILE>",
        "SUPABASE_BASE_URL": "<SUPABASE_BASE_URL>",
        "SUPABASE_SERVICE_ROLE_KEY": "<SUPABASE_SERVICE_ROLE_KEY>",
        "JINA_API_KEY": "<JINA_API_KEY>"
      }
    }
  }
}
```

### Other clients (your client's MCP settings (most use this shape))

```json
{
  "mcpServers": {
    "marsnme": {
      "command": "npx",
      "args": [
        "-y",
        "@marsnme/mcp-gateway"
      ],
      "env": {
        "MCP_PROFILE": "<MCP_PROFILE>",
        "SUPABASE_BASE_URL": "<SUPABASE_BASE_URL>",
        "SUPABASE_SERVICE_ROLE_KEY": "<SUPABASE_SERVICE_ROLE_KEY>",
        "JINA_API_KEY": "<JINA_API_KEY>"
      }
    }
  }
}
```

## Tools

- `recall`: Return about 80-character previews of matching memories.
- `get_summary`: Fetch about 300-character excerpts.
- `get_full`: Pull complete text.

## FAQ

### What do I need to run it?

Node.js 20 or later, a Supabase project and service-role key, and a Jina API key.

### How long does short-term memory last?

The site says about 30 days.

### Can several agents share it?

Yes, each MCP_PROFILE has its own isolated schema.

### Is there a health check?

Yes. GET /health on the local port, 18790 by default for the coco profile.

### Is MarsNMe free?

Yes. MarsNMe is open source, so you can use and self-host it for free.

### How do I add MarsNMe to Claude Code?

Run this command in your terminal: claude mcp add marsnme --env MCP_PROFILE='<MCP_PROFILE>' --env SUPABASE_BASE_URL='<SUPABASE_BASE_URL>' --env SUPABASE_SERVICE_ROLE_KEY='<SUPABASE_SERVICE_ROLE_KEY>' --env JINA_API_KEY='<JINA_API_KEY>' -- npx -y @marsnme/mcp-gateway

### What are the best alternatives to MarsNMe?

The closest alternatives to MarsNMe are Codebase Memory, XERJ, Claude Code Ultimate Guide, Nautilus Compass Memory and note1.

## Alternatives

- [Codebase Memory](https://ai-powered.com/mcp/codebase-memory): Codebase Memory is an open-source MCP server for knowledge and memory.
- [XERJ](https://ai-powered.com/mcp/xerj): XERJ is an open-source MCP server for knowledge and memory.
- [Claude Code Ultimate Guide](https://ai-powered.com/mcp/claude-code-ultimate-guide): Claude Code Ultimate Guide is an open-source MCP server for ai models and llm tooling.
- [Nautilus Compass Memory](https://ai-powered.com/mcp/nautilus-compass-memory): Nautilus Compass Memory is an open-source MCP server for knowledge and memory.
- [note1](https://ai-powered.com/mcp/note1): note1 is an MCP server for productivity.
- [MedXpert 图书馆连接器（通用版）](https://ai-powered.com/mcp/medxpert): MedXpert 图书馆连接器（通用版） is an open-source MCP server for knowledge and memory.
- [Context Nest](https://ai-powered.com/mcp/context-nest): Context Nest is a freemium MCP server for knowledge and memory.
- [Tulsa Ecosystem Map](https://ai-powered.com/mcp/tulsa-ecosystem-map): Tulsa Ecosystem Map is a free MCP server for knowledge and memory.

---
Source: https://ai-powered.com/mcp/marsnme
