Skip to content

npx fails to resolve executable due to hidden directory in bin field (.smithery/stdio/index.cjs) #107

@memgrafter

Description

@memgrafter

Description

When attempting to run the Exa MCP server via npx for a local stdio connection, the execution fails because npm cannot locate or link the binary.

Error Messages:

npm error could not determine executable to run

Claude Code CLI

 ❯ 1. exa  ✘ failed · Enter to view details

 ※ Tip: Run claude --debug to see logs inline, or view log files in
   /Users/trentrobbins/Library/Caches/claude-cli-nodejs/-Users-trentrobbins-code-flatagents

 MCP Config locations (by scope):
  • User config (available in all your projects):
    • /Users/trentrobbins/.claude.json
  • Project config (shared via .mcp.json):
    • /Users/trentrobbins/code/flatagents/.mcp.json (file does not exist)
  • Local config (private to you in this project):
    • /Users/trentrobbins/.claude.json [project: /Users/trentrobbins/code/flatagents]

Root Cause

The package.json for exa-mcp-server defines the binary path using a hidden directory:

"bin": {
  "exa-mcp-server": ".smithery/stdio/index.cjs"
}

Standard npm behavior often fails to create the appropriate symlink in node_modules/.bin/ when the target path resides within a dot-prefixed (hidden) folder like .smithery. This prevents npx from identifying the correct entry point.

Impact

Users following the standard MCP setup for local stdio (e.g., in Claude Desktop or Cursor) will encounter failures when using the recommended npx -y exa-mcp-server command.

Steps to Reproduce

  1. Run npx -y exa-mcp-server in a terminal.
  2. Observe the npm error could not determine executable to run error.

Suggested Fix

Move the production entry point out of the hidden .smithery directory to a standard location, such as dist/ or build/, and update the bin field accordingly:

"bin": {
  "exa-mcp-server": "dist/index.cjs"
}

Workaround

npm install -g exa-mcp-server
claude mcp add exa -e EXA_API_KEY=YOUR_KEY -- node "$(npm root -g)/exa-mcp-server/.smithery/stdio/index.cjs"

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions