Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Brave Search unable to be attached #63

Closed
jacocal opened this issue Nov 26, 2024 · 11 comments
Closed

Brave Search unable to be attached #63

jacocal opened this issue Nov 26, 2024 · 11 comments

Comments

@jacocal
Copy link

jacocal commented Nov 26, 2024

I'm running on Windows 10

This is my JSON config:

{ "mcpServers": { "brave-search": { "command": "npx", "args": [ "@modelcontextprotocol/server-brave-search" ], "env": { "BRAVE_API_KEY": "MY_KEY" } }, } }

This is the output from inspector:

An error occurred: [ { command: Command { killProcess: [Function (anonymous)], spawn: [Function: spawn], spawnOpts: [Object], index: 0, name: 'server', command: 'PORT= node C:\\Users\\{USER}\\AppData\\Local\\npm-cache\\_npx\\5a9d879542beca3a\\node_modules\\@modelcontextprotocol\\inspector\\server\\build\\index.js --env npx --args="-y @modelcontextprotocol/server-brave-search"', prefixColor: '', env: {}, cwd: '', ipc: undefined, close: [Subject], error: [Subject], stdout: [Subject], stderr: [Subject], timer: [Subject], messages: [Object], process: undefined, subscriptions: [], stdin: [Socket], pid: 6836, killed: false, exited: false, state: 'exited' }, index: 0, exitCode: 1, killed: false, timings: { startDate: 2024-11-26T17:55:34.422Z, endDate: 2024-11-26T17:55:34.435Z, durationSeconds: 0.0132205 } }, { command: Command { killProcess: [Function (anonymous)], spawn: [Function: spawn], spawnOpts: [Object], index: 1, name: 'client', command: 'PORT= node C:\\Users\\{USER}\\AppData\\Local\\npm-cache\\_npx\\5a9d879542beca3a\\node_modules\\@modelcontextprotocol\\inspector\\client\\bin\\cli.js', prefixColor: '', env: {}, cwd: '', ipc: undefined, close: [Subject], error: [Subject], stdout: [Subject], stderr: [Subject], timer: [Subject], messages: [Object], process: undefined, subscriptions: [], stdin: [Socket], pid: 26384, killed: true, exited: false, state: 'exited' }, index: 1, exitCode: 1, killed: true, timings: { startDate: 2024-11-26T17:55:34.435Z, endDate: 2024-11-26T17:55:34.447Z, durationSeconds: 0.0126171 } } ]

@mudduck
Copy link

mudduck commented Nov 26, 2024

getting same issues on windows 11/10.

Screenshot 2024-11-26 100333
Screenshot 2024-11-26 100350

logs:
2024-11-25T23:43:47.389Z [info] Attempting to connect to MCP server brave-search... 2024-11-25T23:43:47.412Z [info] Connected to MCP server brave-search! 2024-11-25T23:48:05.300Z [info] Attempting to connect to MCP server brave-search... 2024-11-25T23:48:05.335Z [info] Connected to MCP server brave-search! 2024-11-25T23:50:17.162Z [info] Attempting to connect to MCP server brave-search... 2024-11-25T23:50:17.195Z [info] Connected to MCP server brave-search! 2024-11-26T17:41:31.823Z [info] Attempting to connect to MCP server brave-search... 2024-11-26T17:41:31.852Z [info] Connected to MCP server brave-search! 2024-11-26T17:42:48.976Z [info] Attempting to connect to MCP server brave-search... 2024-11-26T17:42:49.005Z [info] Connected to MCP server brave-search! 2024-11-26T17:45:47.880Z [info] Attempting to connect to MCP server brave-search... 2024-11-26T17:45:47.909Z [info] Connected to MCP server brave-search! 2024-11-26T17:47:30.752Z [info] Attempting to connect to MCP server brave-search... 2024-11-26T17:47:30.798Z [info] Connected to MCP server brave-search! 2024-11-26T18:02:29.962Z [info] Attempting to connect to MCP server brave-search... 2024-11-26T18:02:29.985Z [info] Connected to MCP server brave-search! 2024-11-26T18:02:33.216Z [info] Attempting to connect to MCP server brave-search... 2024-11-26T18:02:33.226Z [info] Connected to MCP server brave-search! 2024-11-26T18:03:13.252Z [error] Error in MCP connection to server brave-search: SyntaxError: Unexpected token 'T', "Terminate "... is not valid JSON at JSON.parse (<anonymous>) at Vwe (C:\Users\breynolds\AppData\Local\AnthropicClaude\app-0.7.1\resources\app.asar\.vite\build\index.js:52:189) at qwe.readMessage (C:\Users\breynolds\AppData\Local\AnthropicClaude\app-0.7.1\resources\app.asar\.vite\build\index.js:52:115) at Gwe.processReadBuffer (C:\Users\breynolds\AppData\Local\AnthropicClaude\app-0.7.1\resources\app.asar\.vite\build\index.js:53:1729) at Socket.<anonymous> (C:\Users\breynolds\AppData\Local\AnthropicClaude\app-0.7.1\resources\app.asar\.vite\build\index.js:53:1520) at Socket.emit (node:events:519:28) at addChunk (node:internal/streams/readable:559:12) at readableAddChunkPushByteMode (node:internal/streams/readable:510:3) at Readable.push (node:internal/streams/readable:390:5) at Pipe.onStreamRead (node:internal/stream_base_commons:191:23)
FWIW even when connected successfully it still throws the comms error as referenced in app screen.

@dsp-ant
Copy link
Member

dsp-ant commented Nov 26, 2024

I'm running on Windows 10

This is my JSON config:

{ "mcpServers": { "brave-search": { "command": "npx", "args": [ "@modelcontextprotocol/server-brave-search" ], "env": { "BRAVE_API_KEY": "MY_KEY" } }, } }

This is the output from inspector:

An error occurred: [ { command: Command { killProcess: [Function (anonymous)], spawn: [Function: spawn], spawnOpts: [Object], index: 0, name: 'server', command: 'PORT= node C:\\Users\\{USER}\\AppData\\Local\\npm-cache\\_npx\\5a9d879542beca3a\\node_modules\\@modelcontextprotocol\\inspector\\server\\build\\index.js --env npx --args="-y @modelcontextprotocol/server-brave-search"', prefixColor: '', env: {}, cwd: '', ipc: undefined, close: [Subject], error: [Subject], stdout: [Subject], stderr: [Subject], timer: [Subject], messages: [Object], process: undefined, subscriptions: [], stdin: [Socket], pid: 6836, killed: false, exited: false, state: 'exited' }, index: 0, exitCode: 1, killed: false, timings: { startDate: 2024-11-26T17:55:34.422Z, endDate: 2024-11-26T17:55:34.435Z, durationSeconds: 0.0132205 } }, { command: Command { killProcess: [Function (anonymous)], spawn: [Function: spawn], spawnOpts: [Object], index: 1, name: 'client', command: 'PORT= node C:\\Users\\{USER}\\AppData\\Local\\npm-cache\\_npx\\5a9d879542beca3a\\node_modules\\@modelcontextprotocol\\inspector\\client\\bin\\cli.js', prefixColor: '', env: {}, cwd: '', ipc: undefined, close: [Subject], error: [Subject], stdout: [Subject], stderr: [Subject], timer: [Subject], messages: [Object], process: undefined, subscriptions: [], stdin: [Socket], pid: 26384, killed: true, exited: false, state: 'exited' }, index: 1, exitCode: 1, killed: true, timings: { startDate: 2024-11-26T17:55:34.435Z, endDate: 2024-11-26T17:55:34.447Z, durationSeconds: 0.0126171 } } ]

I suspect that this is fixed by the https://github.com/modelcontextprotocol/inspector/releases/tag/0.2.3 release

@zzworker
Copy link

{
"mcpServers": {
"brave-search": {
"command": "npx",
"args": [
"-y",
"@modelcontextprotocol/server-brave-search"
],
"env": {
"BRAVE_API_KEY": "xxxxxxxx"
}
},
"memory": {
"command": "npx",
"args": [
"-y",
"@modelcontextprotocol/server-memory"
]
},
"filesystem": {
"command": "npx",
"args": [
"-y",
"@modelcontextprotocol/server-filesystem",
"/Users/xxx/Downloads",
"/Users/xxx/Code"
]
}
}
}

ERROR: You must supply a command.

Execute binaries from npm packages.

npx [options] [@Version] [command-arg]...

npx [options] [-p|--package ]... [command-arg]...

npx [options] -c ''

npx --shell-auto-fallback [shell]

Options:
--package, -p Package to be installed. [string]
--cache Location of the npm cache. [string]
--always-spawn Always spawn a child process to execute the command.
[boolean]
--no-install Skip installation if a package is missing. [boolean]
--userconfig Path to user npmrc. [string]
--call, -c Execute string as if inside npm run-script. [string]
--shell, -s Shell to execute the command with, if any.
[string] [default: false]
--shell-auto-fallback Generate shell code to use npx as the "command not
found" fallback.
[string] [choices: "", "bash", "fish", "zsh"]
--ignore-existing Ignores existing binaries in $PATH, or in the local
project. This forces npx to do a temporary install and
use the latest version. [boolean]
--quiet, -q Suppress output from npx itself. Subcommands will not
be affected. [boolean]
--npm npm binary to use for internal operations.
[string] [default:
"/Users/zhuangsheng/.nvm/versions/node/v12.14.1/lib/node_modules/npm/bin/npm-c
li.js"]
--node-arg, -n Extra node argument when calling a node binary.[string]
--version, -v Show version number [boolean]
--help, -h Show help [boolean]

For the full documentation, see the manual page for npx(1).

image

@jacocal
Copy link
Author

jacocal commented Nov 26, 2024

@dsp-ant I'm unsure, the merge has not been officialy released, at least I'm unable to upgrade either python or uv package at the moment

@dsp-ant
Copy link
Member

dsp-ant commented Nov 27, 2024

@dsp-ant I'm unsure, the merge has not been officialy released, at least I'm unable to upgrade either python or uv package at the moment

https://www.npmjs.com/package/@modelcontextprotocol/inspector has been released.

That being said, we have seen a few people having issues with npx on windows. One way to work around this is :

# in the servers repo
npm install
npm run build
{
  "mcpServers": {
    "brave-search": {
      "command": "node",
      "args": ["path/to/servers/src/brave-search/dist/index.js"],
      "env": {
         "BRAVE_KEY": "..."
      }
    }
  }
}

@jacocal
Copy link
Author

jacocal commented Nov 27, 2024

@dsp-ant I'm unsure, the merge has not been officialy released, at least I'm unable to upgrade either python or uv package at the moment

https://www.npmjs.com/package/@modelcontextprotocol/inspector has been released.

That being said, we have seen a few people having issues with npx on windows. One way to work around this is :

# in the servers repo
npm install
npm run build
{
  "mcpServers": {
    "brave-search": {
      "command": "node",
      "args": ["path/to/servers/src/brave-search/dist/index.js"],
      "env": {
         "BRAVE_KEY": "..."
      }
    }
  }
}

I have tried this method as you mentioned. Still unable to attach Brave Search MCP to Claude, this is the config file:

{
    "mcpServers": {
        "brave-search-node": {
            "command": "node",
            "args": ["C:\\Users\\{USER}\\Documents\\Code\\LLM\\servers\\src\brave-search\\dist\\index.js"],
            "env": {
                "BRAVE_API_KEY": "{MY_KEY}"
            }
        }
    }
}

@natefikru
Copy link

I'm seeing this issue as well but on mac os.

@RaminMammadzada
Copy link

I am having the same issue in Mac Sonoma 14.6.1.

@ajithprabhakar
Copy link

It is the same issue for me as well, my problem is none of the mcp servers are working
image

@alexwhecht
Copy link

I successfully set up the Brave Search MCP server for Claude Desktop using the following steps:

  1. Installed the @modelcontextprotocol/server-brave-search module globally using:
npm install -g @modelcontextprotocol/server-brave-search
  1. Located the module script (dist/index.js) in the global npm directory: C:/Users/<Your_Username>/AppData/Roaming/npm/node_modules/@modelcontextprotocol/server-brave-search/dist/index.js.

  2. Updated the claude_desktop_config.json file with the following configuration:

{
  "mcpServers": {
    "brave-search": {
      "command": "node",
      "args": [
        "C:/Users/<Your_Username>/AppData/Roaming/npm/node_modules/@modelcontextprotocol/server-brave-search/dist/index.js"
      ],
      "env": {
        "BRAVE_API_KEY": "your_api_key_here"
      }
    }
  }
}
  1. Restarted Claude Desktop, and it now works with Brave Search MCP.

@1WorldCapture
Copy link

I successfully set up the Brave Search MCP server for Claude Desktop using the following steps:

  1. Installed the @modelcontextprotocol/server-brave-search module globally using:
npm install -g @modelcontextprotocol/server-brave-search
  1. Located the module script (dist/index.js) in the global npm directory: C:/Users/<Your_Username>/AppData/Roaming/npm/node_modules/@modelcontextprotocol/server-brave-search/dist/index.js.
  2. Updated the claude_desktop_config.json file with the following configuration:
{
  "mcpServers": {
    "brave-search": {
      "command": "node",
      "args": [
        "C:/Users/<Your_Username>/AppData/Roaming/npm/node_modules/@modelcontextprotocol/server-brave-search/dist/index.js"
      ],
      "env": {
        "BRAVE_API_KEY": "your_api_key_here"
      }
    }
  }
}
  1. Restarted Claude Desktop, and it now works with Brave Search MCP.

@alexwhecht you saved my life :) two key points trying this method:

  1. remember to change command from 'npx' to 'node'
  2. if anyone using nvm, the path is not under your AppData, you can search server-brave-search using Everything, fill correct path.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

10 participants