# AgentDB MCP server

> Gives an AI client self-learning vector memory to store patterns, search them semantically, and improve ranking from feedback.

- Repository: https://github.com/ruvnet/agentdb
- Page: https://hostedmcp.org/servers/ruvnet/agentdb
- Transport: stdio
- Stars: 99
- License: MIT

## Install

### Claude Code

```sh
claude mcp add agentdb -- npx -y agentdb
```

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

```json
{
  "mcpServers": {
    "agentdb": {
      "command": "npx",
      "args": [
        "-y",
        "agentdb"
      ]
    }
  }
}
```

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

```json
{
  "servers": {
    "agentdb": {
      "type": "stdio",
      "command": "npx",
      "args": [
        "-y",
        "agentdb"
      ]
    }
  }
}
```

### VS Code CLI

```sh
code --add-mcp '{"name":"agentdb","type":"stdio","command":"npx","args":["-y","agentdb"]}'
```

### Claude Desktop (`claude_desktop_config.json`)

```json
{
  "mcpServers": {
    "agentdb": {
      "command": "npx",
      "args": [
        "-y",
        "agentdb"
      ]
    }
  }
}
```

### Codex

```sh
codex mcp add agentdb -- npx -y agentdb
```

### Codex config.toml (`~/.codex/config.toml`)

```toml
[mcp_servers.agentdb]
command = "npx"
args = ["-y", "agentdb"]
```

### Gemini CLI

```sh
gemini mcp add -s user agentdb npx -- -y agentdb
```

### Gemini settings.json (`~/.gemini/settings.json`)

```json
{
  "mcpServers": {
    "agentdb": {
      "command": "npx",
      "args": [
        "-y",
        "agentdb"
      ]
    }
  }
}
```

## FAQ

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

Run `claude mcp add agentdb -- npx agentdb@latest mcp start`, which registers 41 MCP tools. It works with Claude Code, Cursor, Cline, or any MCP-compatible client.

### How many MCP tools does AgentDB provide?

AgentDB exposes 41 MCP tools across six families, including pattern store, search, skill library, reflexion, causal edges, and hierarchical recall.

### How does AgentDB get smarter from feedback?

After a search, you record feedback on which results were useful, and a Thompson Sampling bandit re-tunes ranking, RL algorithm choice, and compression tier for the next query.

### Does AgentDB require an external server or API keys?

No. Everything, including vectors, indexes, learning state, and the audit log, lives in a single `.rvf` file and runs offline in Node, the browser, or edge runtimes.
