> ## Documentation index
> Fetch the complete documentation index at: https://contextrepo.com/docs/llms.txt
> Use it to find every page before exploring further.

# Claude Desktop Setup

> Connect Context Repo to Claude Desktop and access your prompts, documents, and collections directly from Claude's interface. Setup takes about two minutes.

Connect Context Repo to Claude Desktop and access your prompts, documents, and collections directly from Claude's interface. Setup takes about two minutes.

> **Before you start:** You'll need a [Context Repo](https://contextrepo.com) account with an API key and [Claude Desktop](https://claude.ai/download) installed.

### Get your API key

Go to **Dashboard > Settings > API Keys** and click **New API Key**. Select the `prompts.read` and `documents.read` permissions, then copy the generated key. You'll need it in the next step.

### Add the server config

Open the Claude Desktop configuration file. On macOS, this file is located at:

```
~/Library/Application Support/Claude/claude_desktop_config.json
```

If the file doesn't exist yet, create it. Add the Context Repo MCP Server:

```json title="claude_desktop_config.json"
{
  "mcpServers": {
    "context-repo": {
      "command": "npx",
      "args": ["-y", "context-repo-mcp"],
      "env": {
        "CONTEXTREPO_API_KEY": "gm_your_api_key_here"
      }
    }
  }
}
```

Replace `gm_your_api_key_here` with the API key you copied in the previous step.

> **Note:** If you already have other MCP servers in your config, add the `"context-repo"` entry inside the existing `"mcpServers"` object.

### Restart Claude Desktop and verify

Quit Claude Desktop completely and reopen it. Start a new conversation and ask:

```
List my prompts
```

Claude should return a list of your Context Repo prompts. If you haven't created any yet, it'll tell you the list is empty — that still means the connection is working.

## What you can do

With Context Repo connected, you can ask Claude to:

- **List and search** your prompts, documents, and collections
- **Create new content** directly from the conversation
- **Use prompt templates** with variables filled in contextually
- **Search your knowledge base** using semantic or keyword queries
- **Explore documents** chunk by chunk with Deep Search
- **Manage versions** — view history and restore previous versions

See the [MCP Tools Reference](https://contextrepo.com/docs/mcp/tools-reference) for all 29 available tools.

## Troubleshooting

### Server not starting

Make sure you have Node.js 18 or later installed. Run `node --version` in your terminal to check. The `npx` command needs a working Node.js installation to download and run the MCP server package.

```bash
node --version
# Should print v18.x.x or higher
```

### Config file not found

On macOS, the config file lives at `~/Library/Application Support/Claude/claude_desktop_config.json`. You can open the directory in Finder with:

```bash
open ~/Library/Application\ Support/Claude/
```

If the `Claude` folder exists but there's no config file, create `claude_desktop_config.json` with the JSON from the setup step above.

### Authentication errors

Verify your API key is correct and hasn't been revoked. You can generate a new key from **Dashboard > Settings > API Keys**. Make sure there are no extra spaces or line breaks in the `CONTEXTREPO_API_KEY` value.

- [Cursor Setup](https://contextrepo.com/docs/mcp/setup-guides/cursor): Set up Context Repo with Cursor.
- [MCP Tools Reference](https://contextrepo.com/docs/mcp/tools-reference): See the current tools available through the hosted MCP Server.
- [MCP Server Overview](https://contextrepo.com/docs/mcp): Learn about the Model Context Protocol and how it connects your workspace to AI assistants.
