Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 28 additions & 0 deletions docs/api/mcp/index.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,34 @@ You can also add the Sourcegraph MCP server as a locally-scoped server, which is

Locally-scoped servers take precedence over project-scoped servers with the same name and are stored in your project-specific user settings.

### Cursor

You can add the Sourcegraph MCP server to Cursor by configuring it in your MCP settings file:

1. Open or create the MCP configuration file at `~/.cursor/mcp.json` (or the equivalent path on your system).
2. Add the following configuration:

```json
{
"mcpServers": {
"sourcegraph": {
"type": "http",
"url": "https://your-sourcegraph-instance.com/.api/mcp/v1",
"headers": {
"Authorization": "token YOUR_ACCESS_TOKEN"
}
}
}
}
```

<Callout type="info">
Replace `your-sourcegraph-instance.com` with your Sourcegraph instance URL and `YOUR_ACCESS_TOKEN` with your access token. Note that Cursor requires the `type: "http"` field to be explicitly specified.
</Callout>

3. Save the configuration file.
4. Restart Cursor to apply the new configuration.

## Available Tools

<Callout type="info">
Expand Down