Skip to content

Commit 6438c19

Browse files
jdorfmanenriquegh
andauthored
Add instructions for Sourcegraph MCP server in Cursor settings (#1412)
https://sourcegraph-docs-git-jd-add-cursor-mcp-sourcegraph-f8c71130.vercel.app/api/mcp#cursor <img width="668" height="743" alt="image" src="https://github.com/user-attachments/assets/1f566741-6a45-476f-9c10-c196925da855" /> <!-- Explain the changes introduced in your PR --> ## Pull Request approval You will need to get your PR approved by at least one member of the Sourcegraph team. For reviews of docs formatting, styles, and component usage, please tag the docs team via the #docs Slack channel. Co-authored-by: Enrique Gonzalez <[email protected]>
1 parent 3ef233e commit 6438c19

File tree

1 file changed

+28
-0
lines changed

1 file changed

+28
-0
lines changed

docs/api/mcp/index.mdx

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -133,6 +133,34 @@ You can also add the Sourcegraph MCP server as a locally-scoped server, which is
133133

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

136+
### Cursor
137+
138+
You can add the Sourcegraph MCP server to Cursor by configuring it in your MCP settings file:
139+
140+
1. Open or create the MCP configuration file at `~/.cursor/mcp.json` (or the equivalent path on your system).
141+
2. Add the following configuration:
142+
143+
```json
144+
{
145+
"mcpServers": {
146+
"sourcegraph": {
147+
"type": "http",
148+
"url": "https://your-sourcegraph-instance.com/.api/mcp/v1",
149+
"headers": {
150+
"Authorization": "token YOUR_ACCESS_TOKEN"
151+
}
152+
}
153+
}
154+
}
155+
```
156+
157+
<Callout type="info">
158+
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.
159+
</Callout>
160+
161+
3. Save the configuration file.
162+
4. Restart Cursor to apply the new configuration.
163+
136164
## Available Tools
137165

138166
<Callout type="info">

0 commit comments

Comments
 (0)