Summary
The Resources panel can render the wrong resource payload after switching between already-read resources.
In my local repro, resources/list returns three distinct resources, and raw resources/read returns three distinct payloads, but Inspector's detail pane can show the payload for a different resource than the one currently selected.
Environment
- MCP Inspector:
v0.21.2
- Container image in use locally:
ghcr.io/modelcontextprotocol/inspector:latest
- Image labels:
0.21.2-hotfix-3, revision adfcccca529088099d41d08459f55214bfb9b874
- Transport:
Streamable HTTP
- Connection type:
Direct
Repro
- Connect to an MCP server that supports
resources/list and resources/read.
- List resources.
- Click resource A and let Inspector read/display it.
- Click resource B and let Inspector read/display it.
- Click resource A again.
Expected
The detail pane should display resource A's payload again.
Actual
The detail pane can continue showing resource B's payload, even though the selected item and heading indicate resource A.
I also saw this related symptom:
- clicking
Build a Report approved tools showed a detail payload whose uri field was mcp://benefitsolver/report/context-md
Server-side validation
I verified the server responses independently with raw JSON-RPC calls:
resources/list returns distinct resources
resources/read returns distinct payloads for each URI
So this appears to be a client-side Inspector state/rendering bug, not a server bug.
Likely cause
I traced this locally and found two issues in the client:
- The Resources tab renders a single global
resourceContent string instead of the content for selectedResource.uri.
readResource() short-circuits if a URI is already cached, so re-selecting a cached resource does not repopulate the visible pane.
That combination leaves the detail pane showing stale content from the last-read resource.
Suggested fix
- Derive displayed content from
resourceContentMap[selectedResource.uri]
- Keep
Refresh as a real refresh by bypassing the cache check when explicitly requested
Summary
The Resources panel can render the wrong resource payload after switching between already-read resources.
In my local repro,
resources/listreturns three distinct resources, and rawresources/readreturns three distinct payloads, but Inspector's detail pane can show the payload for a different resource than the one currently selected.Environment
v0.21.2ghcr.io/modelcontextprotocol/inspector:latest0.21.2-hotfix-3, revisionadfcccca529088099d41d08459f55214bfb9b874Streamable HTTPDirectRepro
resources/listandresources/read.Expected
The detail pane should display resource A's payload again.
Actual
The detail pane can continue showing resource B's payload, even though the selected item and heading indicate resource A.
I also saw this related symptom:
Build a Report approved toolsshowed a detail payload whoseurifield wasmcp://benefitsolver/report/context-mdServer-side validation
I verified the server responses independently with raw JSON-RPC calls:
resources/listreturns distinct resourcesresources/readreturns distinct payloads for each URISo this appears to be a client-side Inspector state/rendering bug, not a server bug.
Likely cause
I traced this locally and found two issues in the client:
resourceContentstring instead of the content forselectedResource.uri.readResource()short-circuits if a URI is already cached, so re-selecting a cached resource does not repopulate the visible pane.That combination leaves the detail pane showing stale content from the last-read resource.
Suggested fix
resourceContentMap[selectedResource.uri]Refreshas a real refresh by bypassing the cache check when explicitly requested