Repository navigation
Description
Summary
In any environment without a working OS/D-Bus secret-service (e.g. a headless Docker container — no gnome-keyring, no org.freedesktop.secrets), adding any server — even a plain Streamable HTTP server with no OAuth config — causes every subsequent GET /api/servers to fail with:
Failed to read server list: Couldn't access platform storage: PermissionDenied
Environment
@modelcontextprotocol/[email protected]- Reproduced in Docker, run with
DANGEROUSLY_OMIT_AUTH=true,DANGEROUSLY_BIND_ALL_INTERFACES=true— no D-Bus/secret-service daemon present, as is typical for minimal/CI containers.
Steps to Reproduce
1. Build a minimal container
Create a Dockerfile:
FROM node:24-alpine
RUN npm install -g @modelcontextprotocol/[email protected]
ENV HOST=0.0.0.0 \
DANGEROUSLY_BIND_ALL_INTERFACES=true \
DANGEROUSLY_OMIT_AUTH=true \
MCP_AUTO_OPEN_ENABLED=false \
CLIENT_PORT=6274
EXPOSE 6274
CMD ["mcp-inspector", "--web"]Build and run it:
docker build -t inspector-repro .
docker run --rm -d -p 6274:6274 --name inspector-repro inspector-reproConfirm it's up by opening http://localhost:6274 in your browser (HTTP, not HTTPS) — you should see the Inspector UI with an empty server list.
2. Add any server via the UI
- Click Add Server → Add Manually.
- Give it any name, e.g.
test-server. - Set transport to Streamable HTTP.
- Set the URL to any value, e.g.
https://example.com/mcp. - Save/submit the server.
Expected: the server list loads normally and shows test-server.
Actual: the server list fails to load. The underlying GET /api/servers request (visible in browser dev tools) returns:
HTTP/1.1 500 Internal Server Error
{"error":"Failed to read server list: Couldn't access platform storage: PermissionDenied\n\nCaused by:\n PermissionDenied"}
Root Cause
expectedSecretFields()unconditionally includes the OAuth-client-secret field for every server, even ones with no OAuth config at all. This meansrehydrateConfig()→readKeychainEntriesFor()→secretStore.get()runs a keychain lookup for every server on everyGET /api/servers, regardless of whether that server could possibly have a stored secret.- In
KeyringSecretStore.get(),new AsyncEntry(SERVICE_NAME, buildAccount(serverId, field))is constructed outside the surrounding try/catch — only the subsequentawait entry.getPassword()is guarded. - When there's no secret-service backend available,
@napi-rs/keyring'sAsyncEntryconstructor throws synchronously, so it bypasses theKeychainUnavailableError-specific graceful-degradation path that already exists elsewhere in the codebase (e.g. inmigratePlaintextSecrets()), and instead surfaces as a raw, unclassified error → generic 500 in the/api/serversroute handler.
Activity
koriyoshi2041 commentedon Aug 5, 2026
I reproduced the synchronous-constructor escape described here and prepared a focused fix with regression coverage:
koriyoshi2041/inspector@main...koriyoshi2041:inspector:fix/keyring-constructor-failure
The change moves
AsyncEntryconstruction inside each operation's existing availability boundary, preserving the documented contract (getreturnsnull,deleteno-ops, andsetthrowsKeychainUnavailableError). It adds constructor-failure tests for all three operations.npm run validate:webpasses: 258 test files / 3710 tests.GitHub currently rejects PR creation from this account with
createPullRequestpermission / REST 404, so I am leaving the tested branch here rather than duplicating the report. If cross-fork PR creation is enabled or a maintainer wants the patch rebased elsewhere, I can follow up.Mahmoud-Eltohamy commentedon Aug 5, 2026
I have an infrastructure-level fix for this — making the Docker image ship with the
system packages
@napi-rs/keyringactually requires.Branch: https://github.com/MahmoudEltohamy/inspector/tree/fix/docker-keyring-deps
Changes to
Dockerfile(runtime stage only):libsecret-1-0,dbus,dbus-x11,gnome-keyring,gosu(~15 MB)ENTRYPOINT ["mcp-inspector"]with an inline entrypoint script that:dbus-daemon --system(needed by gnome-keyring)nodeuser viagosudbus-launchfor a session busgnome-keyring-daemonwith an empty passwordmcp-inspectorThis gives full keyring functionality in the container (secrets actually persist)
rather than silent degradation.
Happy to submit as a PR to
v2/mainif a maintainer can allow fork PRs, or feelfree to cherry-pick the Dockerfile changes directly.
cliffhall commentedon Aug 5, 2026
Closing as a duplicate of #1848, which is now the single tracking issue for this bug.
Thanks for the report — it was not wasted. Three people hit this independently in different environments, which is a large part of the evidence that it affects essentially any containerized or keyring-less deployment rather than one unusual setup:
PermissionDeniedonGET /api/serversgnome-keyring/org.freedesktop.secretsGET /api/serversfails in container withCouldn't access platform storage: PermissionDenied#1931 — Docker Swarm container behind Traefik,ghcr.io/…/inspector:2.1.0Root cause:
@napi-rs/keyring'sAsyncEntryconstructor does the platform-store setup and throws when no secret service is reachable. It is constructed outside thetryinget/set/deleteincore/auth/node/secret-store.ts, so the graceful-degradation path that already exists never engages — the raw error escapes and 500s everyGET /api/servers.Your analysis carried a second finding beyond the constructor bug — that
expectedSecretFields()runs a keychain lookup for every server even with no OAuth config at all. I have quoted it in full on #1848 so it survives this issue closing; it explains why the failure fires so broadly.Subscribe to #1848 for the fix. No further action needed here.
cliffhall commentedon Aug 6, 2026
For the record, since this was closed as a duplicate of #1848: the fix is now open as #1945, and it is exactly the change your root-cause section describes —
new AsyncEntry(...)moved inside the surroundingtryinget,set, anddelete, so a construction-time throw follows the documented degradation contract instead of escaping unclassified into a generic 500.Your analysis was right on both counts, including the amplification: because
expectedSecretFields()unconditionally includes the OAuth slot,rehydrateConfig()constructs an entry for every server, so the default seeded catalog was enough to 500 the firstGET /api/serversbefore any server was added.After the fix,
GET /api/serversreturns 200 in a container with no secret-service backend, and only an actual attempt to save a secret hard-fails — as aKeychainUnavailableError, so the routes' 503 translation and themigratePlaintextSecretsskip branch you mentioned both engage.Two related items you may want to watch: #1948 handles the neighboring case where
@napi-rs/keyringcannot be imported at all (no prebuilt binary for the platform), and #1950 covers what secret persistence should actually mean in a container — #1945 makes the non-secret flows work but leaves such environments with no way to store a secret at all.