getsentry / getsentry/sentry-mcp

Add support for showing variables

Open
#871 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
TypeScript
Stars
853
Forks
144
Avg merge
19h 25m
Merged PRs (30d)
32

Description

**Problem:**

`get_issue_details` returns stack frames with file, line, function, and source code, but not local variable values — even when Sentry has captured them. Without variable context, the assistant can't actually diagnose the issue — it has to punt back to the human to check the UI. That defeats the purpose of the MCP integration.

I ran into this today. We had an `EncodeError: Object of type str is not JSON serializable` in a Celery/Kombu stack. In the Sentry web UI, I can see the value of `o` at the crash site (`json/encoder.py:180`) — it was a `SimpleLazyObject`. That's the whole answer to "what was being encoded?" But the MCP tool only gave me frame metadata, so I had to leave the AI workflow and go look at the UI myself.

**Proposed solution:**

Rather than bloating every `get_issue_details` response with variables from every frame, add a separate tool like `get_frame_variables(issue_id, event_id, frame_index)` that returns the local variables for a specific stack frame. This keeps the common case token-efficient while still letting the assistant drill into the frame that matters.

Another option to save on # of requests might be to include variable data only for the top/bottom frame of each exception by default, since that's where the most useful context usually lives.

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.