The Sentry MCP Server provides a Model Context Protocol server for interacting with Sentry, allowing AI assistants to retrieve and analyze error data, manage projects, and monitor application performance through the Sentry API.
Before you begin, ensure you have:
Install the required dependencies:
npm install
To configure the MCP server with Claude, add the following to your Claude settings:
{
"mcpServers": {
"sentry": {
"command": "npx",
"args": ["ts-node", "/Users/<your-user-directory>/mcp-sentry-ts/index.ts"],
"env": {
"SENTRY_AUTH": "<YOUR_AUTH_TOKEN>"
}
}
}
}
Important configuration notes:
args
field to match your actual directory<YOUR_AUTH_TOKEN>
with your Sentry authentication tokenStart the MCP server with:
npx ts-node index.ts
Lists all accessible Sentry projects for a given organization.
Parameters:
organization_slug
(string, required): Organization slugview
(string, optional): "summary" or "detailed" (default: "detailed")format
(string, optional): "plain" or "markdown" (default: "markdown")Creates a new project in Sentry and retrieves its client keys.
Parameters:
organization_slug
(string, required): Organization slugteam_slug
(string, required): Team slug to assign the project toname
(string, required): Project nameplatform
(string, optional): Platform typeview
(string, optional): "summary" or "detailed" (default: "detailed")format
(string, optional): "plain" or "markdown" (default: "markdown")Retrieves details about an issue using its short ID.
Parameters:
organization_slug
(string, required): Organization slugshort_id
(string, required): Issue short ID (e.g., PROJECT-123)format
(string, optional): "plain" or "markdown" (default: "markdown")Retrieves and analyzes a Sentry issue.
Parameters:
issue_id_or_url
(string, required): Full Sentry issue URL or numeric issue IDview
(string, optional): "summary" or "detailed" (default: "detailed")format
(string, optional): "plain" or "markdown" (default: "markdown")Lists issues from a specific Sentry project.
Parameters:
organization_slug
(string, required): Organization slugproject_slug
(string, required): Project slugview
(string, optional): "summary" or "detailed" (default: "detailed")format
(string, optional): "plain" or "markdown" (default: "markdown")Retrieves and analyzes a specific Sentry event from an issue.
Parameters:
issue_id_or_url
(string, required): Full Sentry issue URL or numeric issue IDevent_id
(string, required): Specific event ID to retrieveview
(string, optional): "summary" or "detailed" (default: "detailed")format
(string, optional): "plain" or "markdown" (default: "markdown")Lists error events from a specific Sentry project.
Parameters:
organization_slug
(string, required): Organization slugproject_slug
(string, required): Project slugview
(string, optional): "summary" or "detailed" (default: "detailed")format
(string, optional): "plain" or "markdown" (default: "markdown")Lists events for a specific Sentry issue.
Parameters:
organization_slug
(string, required): Organization slugissue_id
(string, required): Issue IDview
(string, optional): "summary" or "detailed" (default: "detailed")format
(string, optional): "plain" or "markdown" (default: "markdown")Lists replays from a specific Sentry organization.
Parameters:
organization_slug
(string, required): Organization slugproject_ids
(string[], optional): List of project IDs for filteringenvironment
(string, optional): Environment filterstats_period
(string, optional): Time period (e.g., "24h", "7d")start
(string, optional): Start date for filteringend
(string, optional): End date for filteringsort
(string, optional): Field to sort byquery
(string, optional): Search queryper_page
(number, optional): Number of replays per pagecursor
(string, optional): Pagination cursorview
(string, optional): "summary" or "detailed" (default: "detailed")format
(string, optional): "plain" or "markdown" (default: "markdown")This MCP has been verified to work with Codeium Windsurf. Note that Cursor currently has issues with its MCP implementation, and this tool may not be fully functional with it.
To add this MCP server to Claude Code, run this command in your terminal:
claude mcp add-json "sentry" '{"command":"npx","args":["ts-node","index.ts"],"env":{"SENTRY_AUTH":"${SENTRY_AUTH_TOKEN}"}}'
See the official Claude Code MCP documentation for more details.
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 > Tools & Integrations and click "New MCP Server".
When you click that button the ~/.cursor/mcp.json
file will be opened and you can add your server like this:
{
"mcpServers": {
"sentry": {
"command": "npx",
"args": [
"ts-node",
"index.ts"
],
"env": {
"SENTRY_AUTH": "${SENTRY_AUTH_TOKEN}"
}
}
}
}
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 explicitly ask the agent to use the tool by mentioning the tool name and describing what the function does.
To add this MCP server to Claude Desktop:
1. Find your configuration file:
~/Library/Application Support/Claude/claude_desktop_config.json
%APPDATA%\Claude\claude_desktop_config.json
~/.config/Claude/claude_desktop_config.json
2. Add this to your configuration file:
{
"mcpServers": {
"sentry": {
"command": "npx",
"args": [
"ts-node",
"index.ts"
],
"env": {
"SENTRY_AUTH": "${SENTRY_AUTH_TOKEN}"
}
}
}
}
3. Restart Claude Desktop for the changes to take effect