All integrations
Get an API key
Sourcegraph
Code search across repositories and organisations.
Developer
Web data
How an agent reaches it
MCPREST APICLI
How you authenticate
API key
- Create an access token in user settings.
- Sourcegraph expects `Authorization: token <value>`, not Bearer.
Connection details
- Base URL
- https://sourcegraph.com/.api/graphql
- Pagination
- cursor
Common endpoints
| search code | POST / |
Worth knowing
- GraphQL only, and the `Authorization` scheme word is `token` rather than `Bearer`.
- Self-hosted instances use their own host.