# Ragmir

> Ragmir is an open-source MCP server for knowledge and memory. Searches your own code, PDFs and Office files and returns exact source citations. It runs locally on your machine and is started by your AI client.

- **Kind:** MCP server
- **Pricing:** Open source
- **Platforms:** CLI, self-hosted, macOS, Linux, Windows
- **Website:** https://ragmir.com
- **Repository:** https://github.com/jcode-works/jcode-ragmir/tree/HEAD/packages/ragmir-core
- **MCP Registry name:** io.github.jcode-works/ragmir
- **Categories:** knowledge and memory, developer tools
- **Listing updated:** 2026-11-14

## About

Ragmir builds a local index of the files you choose and answers retrieval requests with the passages and where they came from. The README says it does not bundle a chat model or host documents; your agent writes the answer with the model you pick.

The MCP server exposes four read-only tools. Search handles one question or up to five related ones sharing a budget, expand opens more context, status describes the base, and audit checks it. Passages already returned in a session come back as short stubs, and the server warns or refuses when an agent works outside the project it serves.

Search is hybrid BM25 plus vectors, aware of paths and camelCase names. The project reports 94% of real developer questions finding the right file in the top 10, with a 36 ms median on a 30,171-chunk monorepo. It needs Node.js 22.12 or newer and runs offline by default.

## Features

- **Exact citations:** Results point to source lines or page, slide, sheet and cell positions.
- **Hybrid search:** BM25 and vectors that understand paths and identifiers.
- **Weak-evidence flags:** Marks thin support and changed files instead of padding answers.
- **Local and offline:** Index and search run in one Node.js process.
- **Four read-only tools:** Search, expand, status and audit; nothing is modified.
- **Git hooks:** Optional hooks refresh the index after commits and checkouts.

## Good for

- Ground a coding agent in specs and ADRs
- Diagnose an incident from runbooks and source
- Prepare an API migration with cited constraints
- Run private retrieval on an offline server

## Install

### Claude Code (Terminal)

```sh
claude mcp add ragmir --env RAGMIR_PROJECT_ROOT='<RAGMIR_PROJECT_ROOT>' -- npx -y @jcode.labs/ragmir
```

### Claude Desktop (claude_desktop_config.json)

```json
{
  "mcpServers": {
    "ragmir": {
      "command": "npx",
      "args": [
        "-y",
        "@jcode.labs/ragmir"
      ],
      "env": {
        "RAGMIR_PROJECT_ROOT": "<RAGMIR_PROJECT_ROOT>"
      }
    }
  }
}
```

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

```json
{
  "mcpServers": {
    "ragmir": {
      "command": "npx",
      "args": [
        "-y",
        "@jcode.labs/ragmir"
      ],
      "env": {
        "RAGMIR_PROJECT_ROOT": "<RAGMIR_PROJECT_ROOT>"
      }
    }
  }
}
```

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

```json
{
  "servers": {
    "ragmir": {
      "type": "stdio",
      "command": "npx",
      "args": [
        "-y",
        "@jcode.labs/ragmir"
      ],
      "env": {
        "RAGMIR_PROJECT_ROOT": "<RAGMIR_PROJECT_ROOT>"
      }
    }
  }
}
```

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

```json
{
  "mcpServers": {
    "ragmir": {
      "command": "npx",
      "args": [
        "-y",
        "@jcode.labs/ragmir"
      ],
      "env": {
        "RAGMIR_PROJECT_ROOT": "<RAGMIR_PROJECT_ROOT>"
      }
    }
  }
}
```

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

```json
{
  "mcpServers": {
    "ragmir": {
      "command": "npx",
      "args": [
        "-y",
        "@jcode.labs/ragmir"
      ],
      "env": {
        "RAGMIR_PROJECT_ROOT": "<RAGMIR_PROJECT_ROOT>"
      }
    }
  }
}
```

## Tools

- `ragmir_search`: Search one question or up to five related ones with citations
- `ragmir_expand`: Expand a returned passage
- `ragmir_status`: Report on the served knowledge base
- `ragmir_audit`: Audit the index

## FAQ

### What file types can it index?

Code, PDFs, Word and other Office files, plus EPUB, with citations by native location.

### Does it need an API key or account?

No. Local-hash retrieval needs no account, key or model download.

### What does it need to run?

Node.js 22.12 or later, and the RAGMIR_PROJECT_ROOT environment variable pointing at the project.

### Can I use it outside MCP?

Yes, through the rgr command line or a TypeScript library.

### Is Ragmir free?

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

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

Run this command in your terminal: claude mcp add ragmir --env RAGMIR_PROJECT_ROOT='<RAGMIR_PROJECT_ROOT>' -- npx -y @jcode.labs/ragmir

### What are the best alternatives to Ragmir?

The closest alternatives to Ragmir are REA, Codebase Memory, GitHub, Serena MCP: the IDE for your agent and XERJ.

## Alternatives

- [REA](https://ai-powered.com/mcp/rea): REA is an open-source MCP server for developer tools.
- [Codebase Memory](https://ai-powered.com/mcp/codebase-memory): Codebase Memory is an open-source MCP server for knowledge and memory.
- [GitHub](https://ai-powered.com/mcp/github-2): GitHub is an open-source MCP server for developer tools.
- [Serena MCP: the IDE for your agent](https://ai-powered.com/mcp/serena-mcp-the-ide-for-your-agent): Serena MCP: the IDE for your agent is an open-source MCP server for developer tools.
- [XERJ](https://ai-powered.com/mcp/xerj): XERJ is an open-source MCP server for knowledge and memory.
- [Ouroboros](https://ai-powered.com/mcp/ouroboros): Ouroboros is an open-source MCP server for developer tools.
- [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.

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