Skip to content

Commit 836552d

Browse files
committed
Mention mcp-remote as fallback for oauth 2 mcp registeration
1 parent ed66a3d commit 836552d

1 file changed

Lines changed: 29 additions & 1 deletion

File tree

docs/api/mcp/index.mdx

Lines changed: 29 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,35 @@ For programmatic access without storing credentials, use OAuth 2.0 with device f
2828

2929
#### Prerequisites
3030

31-
Before using OAuth, you must create an OAuth application in your Sourcegraph instance. Follow the instructions [here](/admin/oauth_apps#creating-an-oauth-app). (Note: you will need the `user:all` scope)
31+
Before using OAuth, you must create an OAuth application in your Sourcegraph instance. Follow the instructions [here](/admin/oauth_apps#creating-an-oauth-app). (Note: you will need the `user:all` scope)
32+
33+
#### Registering the MCP Server
34+
35+
Once you have your Client ID, you can register the MCP server in your client using that ID.
36+
37+
If your client does not natively support specifying an OAuth 2.0 Client ID, you can use `mcp-remote` as a fallback. Add the following configuration to the relevant section for MCP servers of your client to use the `stdio` transport with the following configuration:
38+
39+
```json
40+
{
41+
"sourcegraph": {
42+
"type": "stdio",
43+
"command": "npx",
44+
"args": [
45+
"mcp-remote",
46+
"https://your-sourcegraph-instance.com/.api/mcp/v1",
47+
"3334",
48+
"--static-oauth-client-info",
49+
"{\"client_id\":\"<your-client-id>\"}",
50+
"--static-oauth-client-metadata",
51+
"{\"scope\":\"user:all\"}"
52+
]
53+
}
54+
}
55+
```
56+
57+
<Callout type="info">
58+
Replace `your-sourcegraph-instance.com` with your Sourcegraph instance URL and `<your-client-id>` with the ID of the client you registered in the prerequisites step.
59+
</Callout>
3260

3361
### Authorization Header
3462

0 commit comments

Comments
 (0)