Describe the bug
@modelcontextprotocol/inspector v2.0.0 fails to start on Android (Termux) because @napi-rs/keyring is imported unconditionally during module initialization.
The Inspector exits immediately before it can execute its own fallback logic for systems without an OS keychain.
To Reproduce
Steps to reproduce the behavior:
- Install the latest Inspector.
mkdir tmp-inspector
cd tmp-inspector
npm init -y
npm install @modelcontextprotocol/inspector
- Run:
npx @modelcontextprotocol/inspector
- Observe that the Inspector exits immediately with a native binding error.
Expected behavior
The Inspector should start successfully even if an OS keychain is unavailable or unsupported.
If @napi-rs/keyring cannot be used on the current platform, the Inspector should gracefully fall back to a non-keyring credential store (or disable credential persistence) instead of failing during startup.
Logs
Initial error:
Error running MCP Inspector: Cannot find native binding.
npm has a bug related to optional dependencies (https://github.com/npm/cli/issues/4828).
Please try `npm i` again after removing both package-lock.json and node_modules directory.
After investigation, the underlying error is:
Error: Cannot find module './keyring.android-arm64.node'
followed by:
Error: Cannot find module '@napi-rs/keyring-android-arm64'
The dependency tree shows:
tmp-inspector@1.0.0
└─┬ @modelcontextprotocol/inspector@2.0.0
└── @napi-rs/keyring@1.3.0
No Android-specific keyring package is installed.
I also verified that this is not a general native module loading issue:
@rolldown/binding-android-arm64 loads successfully.
- The Android native
.node file is present and can be required without errors.
The failure occurs specifically while importing @napi-rs/keyring.
Additional context
The Inspector currently performs a top-level import of:
import { AsyncEntry, findCredentialsAsync } from "@napi-rs/keyring";
This import exists in multiple clients (CLI, TUI, and Web).
Those same files also contain logic intended to handle unavailable OS keychains (for example, messages such as "OS keychain is not available...").
However, because the import itself fails, execution never reaches that fallback logic.
It appears this dependency should be loaded lazily (e.g. inside a try/catch) so that unsupported platforms such as Android/Termux can still run the Inspector without OS keychain integration.
Describe the bug
@modelcontextprotocol/inspectorv2.0.0 fails to start on Android (Termux) because@napi-rs/keyringis imported unconditionally during module initialization.The Inspector exits immediately before it can execute its own fallback logic for systems without an OS keychain.
To Reproduce
Steps to reproduce the behavior:
mkdir tmp-inspector cd tmp-inspector npm init -y npm install @modelcontextprotocol/inspectorExpected behavior
The Inspector should start successfully even if an OS keychain is unavailable or unsupported.
If
@napi-rs/keyringcannot be used on the current platform, the Inspector should gracefully fall back to a non-keyring credential store (or disable credential persistence) instead of failing during startup.Logs
Initial error:
After investigation, the underlying error is:
followed by:
The dependency tree shows:
No Android-specific keyring package is installed.
I also verified that this is not a general native module loading issue:
@rolldown/binding-android-arm64loads successfully..nodefile is present and can be required without errors.The failure occurs specifically while importing
@napi-rs/keyring.Additional context
The Inspector currently performs a top-level import of:
This import exists in multiple clients (CLI, TUI, and Web).
Those same files also contain logic intended to handle unavailable OS keychains (for example, messages such as "OS keychain is not available...").
However, because the import itself fails, execution never reaches that fallback logic.
It appears this dependency should be loaded lazily (e.g. inside a
try/catch) so that unsupported platforms such as Android/Termux can still run the Inspector without OS keychain integration.