Sourcegraph streaming search API
- URL
-
https://sourcegraph.com/.api/search/stream - Docs
- https://sourcegraph.com/docs/api/stream-api
Authorization: token <credential> Create a personal or service-account access token in your Sourcegraph instance. The docs reference Settings > Access tokens for users and service-account Access tokens for service accounts; start from creating an access token or service accounts. Use the mcp scope for MCP-only access when desired.
Authorization: Bearer <credential> Point your MCP client at the server URL and approve access in the browser. The server supports OAuth Dynamic Client Registration (RFC 7591), so the client registers itself automatically — no developer-portal app, client_id, or client_secret to create.
Create a service account, then open that account's Access tokens > M2M credentials and click Create M2M credential as documented in service accounts. Save the generated client_id and client_secret, then exchange them for a short-lived bearer token with the Sourcegraph OAuth token endpoint. Select scopes appropriate to the target API.