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

[Windows] MCP Server (Brave Search) fails to connect - environment variable issues #52

Closed
nebooz opened this issue Nov 26, 2024 · 1 comment

Comments

@nebooz
Copy link

nebooz commented Nov 26, 2024

Description

Trying to set up Brave Search MCP integration on Windows 11 with Claude desktop app v0.7.1. While the server appears to start successfully ("Brave Search MCP Server running on stdio"), the app shows "could not attach to MCP server brave-search".

Configuration

The following config was used:

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

Environment

  • OS: Windows 11 (22631)
  • Claude Desktop App: v0.7.1
  • Node.js: v22.7.0
  • npm: v10.8.2

Behavior

  1. npm installs packages successfully
  2. Server appears to start ("Brave Search MCP Server running on stdio")
  3. Claude app shows "could not attach to MCP server brave-search"
  4. npm logs show ENOENT errors related to environment variable path resolution

Error Logs

verbose stack Error: ENOENT: no such file or directory, lstat 'C:\Users\[username]\AppData\Local\AnthropicClaude\app-0.7.1\${APPDATA}'

Attempted Solutions

  1. Using full paths instead of environment variables
  2. Using different shell commands (cmd vs powershell)
  3. Different stdio configurations
  4. Setting explicit NPM_CONFIG_PREFIX
  5. Using @latest version of the package

None of these resolved the connection issue between the app and the server.

Additional Notes

  • The server starts successfully when run directly in PowerShell
  • The issue appears to be specific to how the Claude app spawns and connects to the MCP server process on Windows
  • Environment variable resolution (${APPDATA} vs %APPDATA%) seems to be a key issue

Question

Is there a recommended way to set up MCP servers on Windows? The current setup seems to have issues with Windows-specific path handling and environment variables.

@jspahrsummers
Copy link
Member

Sorry about this! I think this is the same root cause as #40, so merging with that issue.

@jspahrsummers jspahrsummers closed this as not planned Won't fix, can't repro, duplicate, stale Nov 26, 2024
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

2 participants