# Codemesh MCP server

> Provides AI coding agents with a persistent, queryable code knowledge graph to reduce token usage and speed up codebase exploration.

- Repository: https://github.com/pyalwin/codemesh
- Page: https://hostedmcp.org/servers/pyalwin/codemesh
- Transport: stdio
- Stars: 0
- License: MIT
- Latest version: 0.1.2

## Install

### Claude Code

```sh
claude mcp add codemesh -- npx -y @pyalwin/codemesh
```

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

```json
{
  "mcpServers": {
    "codemesh": {
      "command": "npx",
      "args": [
        "-y",
        "@pyalwin/codemesh"
      ]
    }
  }
}
```

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

```json
{
  "servers": {
    "codemesh": {
      "type": "stdio",
      "command": "npx",
      "args": [
        "-y",
        "@pyalwin/codemesh"
      ]
    }
  }
}
```

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

```json
{
  "mcpServers": {
    "codemesh": {
      "command": "npx",
      "args": [
        "-y",
        "@pyalwin/codemesh"
      ]
    }
  }
}
```

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

```toml
[mcp_servers.codemesh]
command = "npx"
args = ["-y", "@pyalwin/codemesh"]
```

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

```json
{
  "mcpServers": {
    "codemesh": {
      "command": "npx",
      "args": [
        "-y",
        "@pyalwin/codemesh"
      ]
    }
  }
}
```

## Environment variables

| Name | Required | Secret | Description |
|---|---|---|---|
| `CODEMESH_PROJECT_ROOT` | no | no | Absolute path to the local codebase to index |

## Tools (10)

- `codemesh_map`
- `codemesh_source`
- `codemesh_inspect`
- `codemesh_hydrate`
- `codemesh_answer`
- `codemesh_explore`
- `codemesh_trace`
- `codemesh_enrich`
- `codemesh_workflow`
- `codemesh_status`

## FAQ

### How does Codemesh improve AI agent performance?

It provides a persistent knowledge graph that allows agents to map repositories and read exact symbols instead of grepping through files and reading irrelevant code.

### Does Codemesh require a vector database?

No, it uses a single SQLite database located in a .codemesh/ directory and does not generate embeddings.
