AI & Agent Dev Bug Sandbox logo
AI & Agent Dev Bug Sandbox
Back to Radar

ERR_MODULE_NOT_FOUND: @Modelcontextprotocol/Sdk Missing From Npx Installation

The @supabase/mcp-server-supabase package crashes on `npx -y @supabase/mcp-server-supabase@latest` because @modelcontextprotocol/sdk is not installed as a production dependency, causing Node.js module resolution failure.

highConfidence 90%Model Context Protocol (MCP)supabase-jsRealtimeAffected V@supabase/mcp-Server-Supabase@latest

Origin Analysis

The root cause is that @modelcontextprotocol/sdk is not declared in the dependencies block of @supabase/mcp-server-supabase's package.json (likely it is a devDependency or peerDependency), and npx only installs production dependencies into the temporary environment, exposing the missing runtime import.
1. Ensure no global @modelcontextprotocol/sdk installed. 2. Run: npx -y @supabase/mcp-server-supabase@latest 3. Observe process exits with code 1 and stack trace: Error [ERR_MODULE_NOT_FOUND]: Cannot find package '@modelcontextprotocol/sdk' imported from dist/transports/stdio.js

Fixing Code Block

Edge Case Audit

Adding the SDK as a dependency may introduce a version that is incompatible with the existing code. Pin the exact version or use a semver range that matches the package's usage. After the fix, users with cached npx environments may need to clear the cache (`npx clear-npx-cache`) or use a new version tag. Rollback strategy: revert the package.json change and publish the previous version if the new dependency causes regressions.

Ecosystem Topology

Agent Frameworks

LangChain, LlamaIndex, and Pydantic

  1. highProperty graph relation keys collide when entity IDs or labels contain underscores
  2. highCodeActAgent drops assistant tool-call metadata during handoff, leaving an orphan tool response
  3. high[Bug]: HierarchicalNodeParser async methods return the documents unsplit
  4. highLLM.predict_and_call fails with ValidationError for non-function-calling models when react_chat_formatter is omitted
  5. highAnthropic streaming server-tool input_json_delta overwrites completed client tool_use arguments due to stale cur_tool_call state