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

server-github calls fail with "Error executing code: MCP error -32603: fetch is not defined" #556

Open
hinnefe2 opened this issue Jan 22, 2025 · 4 comments
Labels
bug Something isn't working

Comments

@hinnefe2
Copy link

Describe the bug

When I attempt to use tools provided by the @modelcontextprotocol/server-github MCP server in the Claude desktop app the attempt fails and Claude returns

Error executing code: MCP error -32603: fetch is not defined
Image

To Reproduce
Steps to reproduce the behavior:

  1. Add the following to claude_desktop_config.json (using a real github personal access token):
  "mcpServers": {
    "github": {
      "command": "npx",
      "args": [
        "-y",
        "@modelcontextprotocol/server-github"
      ],
      "env": {
        "GITHUB_PERSONAL_ACCESS_TOKEN": "ghp_..."
      }
    }
  1. Restart the Claude desktop app

  2. Ask Claude to use one of the tools from the server-github MCP server. For example,

Use the get_issue tool from the server-github MCP server to read the contents of this github issue: https://github.com/modelcontextprotocol/servers/issues/533

Expected behavior
Claude successfully uses the tools provided by the github MCP server.

Additional context

Claude Desktop version Version 0.7.8 (0.7.8)
OS X version 12.6.7 (21G651)
npx version 7.20.3
node version v23.6.0

Also, just running that npx command by itself seems to work:

$ npx -y @modelcontextprotocol/server-github
GitHub MCP Server running on stdio
@hinnefe2 hinnefe2 added the bug Something isn't working label Jan 22, 2025
@monkeydaichan
Copy link
Contributor

monkeydaichan commented Jan 23, 2025

@hinnefe2
Since they seem busy, I've forked the repository to add these features. PRs are very welcome!

The get_pull_request_reviews and get_pull_request_comments, get_issue_comment functions are available on the develop branch at https://github.com/monkeydaichan/mcp-servers/tree/develop

Feel free to check out these additions and provide any feedback!

@hinnefe2
Copy link
Author

@monkeydaichan Thanks for adding those! I think there's been a slight miscommunication though: my issue is not that the @modelcontextprotocol/server-github server is missing tools but rather that when I try to use the tools it does provide (e.g. the get_issue tool) it fails with the MCP error -32603: fetch is not defined error.

It sounds like you have a working setup though - would you mind sharing how you configured the server-github server?

@monkeydaichan
Copy link
Contributor

monkeydaichan commented Jan 23, 2025

@hinnefe2

I'm using asdf for Node.js version management. Here's my working configuration:

    "github": {
      "command": "npx",
      "args": [
        "${HOME}/WORK/DevAsLife/mcp-servers/src/github/dist/index.js"
      ],
      "env": {
        "GITHUB_PERSONAL_ACCESS_TOKEN": "YOUR_TOKEN_HERE",
        "PATH": "${HOME}/.asdf/shims:/usr/local/bin:/usr/bin:/bin",
        "ASDF_DIR": "/opt/homebrew/opt/asdf/libexec",
        "ASDF_DATA_DIR": "${HOME}/.asdf",
        "ASDF_NODEJS_VERSION": "23.3.0"
      }
    }

Note: Replace ${HOME} with your actual home directory path.

@monkeydaichan
Copy link
Contributor

@hinnefe2

Also, this issue might be resolved by the recent merge: #553
It includes the fix for the fetch is not defined error.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants