This project provides a remote Model Context Protocol (MCP) server that acts as middleware between AI models and the Sentry API. It allows AI assistants to access Sentry functionality through standardized tools while handling authentication and API interactions.
The easiest way to get started is by using the deployed service:
https://mcp.sentry.dev
For self-hosted Sentry installations, you can use the stdio transport method:
Create a Personal API Token (PAT) in Sentry with these scopes:
Launch the server using npx:
npx @sentry/mcp-server@latest --access-token=sentry-pat --host=sentry.example.com
Alternatively, use environment variables:
SENTRY_AUTH_TOKEN=your-token SENTRY_HOST=sentry.example.com npx @sentry/mcp-server@latest
The MCP server includes an Inspector for testing:
pnpm inspector
Enter your server URL (https://[domain].workers.dev/sse
) and connect. After authentication, you can test the available tools.
{
"mcpServers": {
"math": {
"command": "npx",
"args": [
"mcp-remote",
"https://mcp-github-oauth.<your-subdomain>.workers.dev/sse"
]
}
}
}
For Cursor:
npx mcp-remote https://<your-worker-name>.<your-subdomain>.workers.dev/sse
For other clients like Windsurf:
To develop the MCP server locally:
Create an OAuth App in Sentry (Settings → API → Applications)
http://localhost:8788
http://localhost:8788/callback
Create a .dev.vars
file with:
SENTRY_CLIENT_ID=your_development_sentry_client_id
SENTRY_CLIENT_SECRET=your_development_sentry_client_secret
pnpm dev
http://localhost:8788/sse
When using Claude with your MCP server, you might see error messages since Claude Desktop doesn't fully support remote MCP servers yet. To verify the connection, hover over the 🔨 icon in Claude's interface to see if your tools are available.
For any connectivity issues, ensure your OAuth credentials are correct and that you've completed the authentication flow successfully.
There are two ways to add an MCP server to Cursor. The most common way is to add the server globally in the ~/.cursor/mcp.json
file so that it is available in all of your projects.
If you only need the server in a single project, you can add it to the project instead by creating or adding it to the .cursor/mcp.json
file.
To add a global MCP server go to Cursor Settings > MCP and click "Add new global MCP server".
When you click that button the ~/.cursor/mcp.json
file will be opened and you can add your server like this:
{
"mcpServers": {
"cursor-rules-mcp": {
"command": "npx",
"args": [
"-y",
"cursor-rules-mcp"
]
}
}
}
To add an MCP server to a project you can create a new .cursor/mcp.json
file or add it to the existing one. This will look exactly the same as the global MCP server example above.
Once the server is installed, you might need to head back to Settings > MCP and click the refresh button.
The Cursor agent will then be able to see the available tools the added MCP server has available and will call them when it needs to.
You can also explictly ask the agent to use the tool by mentioning the tool name and describing what the function does.