diff --git a/docs/api/mcp/index.mdx b/docs/api/mcp/index.mdx index 5c0a9a9fe..cd1d80b1a 100644 --- a/docs/api/mcp/index.mdx +++ b/docs/api/mcp/index.mdx @@ -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" + } + } + } + } + ``` + + + 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. + + +3. Save the configuration file. +4. Restart Cursor to apply the new configuration. + ## Available Tools