You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
MCP server disconnects / URL returns Unauthorized #4
import{WorkerEntrypoint}from'cloudflare:workers';import{ProxyToSelf}from'workers-mcp';exportdefaultclassMyWorkerextendsWorkerEntrypoint<Env>{/** * A warm, friendly greeting from your new Workers MCP server. * @param name {string} the name of the person we are greeting. * @return {string} the contents of our greeting. */sayHello(name: string){return`Hello from an MCP Worker, ${name}!`;}/** * @ignore **/asyncfetch(request: Request): Promise<Response>{returnnewProxyToSelf(this).fetch(request);}}
And my claude_desktop_config.json looks like this:
When I start Claude I get an error saying the MCP server disconnected. When I try to visit the URL for the MCP on my subdomain it just says "Unauthorized".
I was wondering if this was possibly related to the SHARED_SECRET that gets created? I tried adding it to the env section of Claude's MCP config but that didn't seem to fix it.
Looking in Claude's log file for my MCP server (found at ~/Library/Logs/Claude), it looks like there might be something wrong with the build:
file:///Users/my-username/Developer/my-mcp/node_modules/workers-mcp/dist/cli.js:574
import { scheduler } from "node:timers/promises";
^^^^^^^^^
SyntaxError: The requested module 'node:timers/promises' does not provide an export named 'scheduler'
at ModuleJob._instantiate (node:internal/modules/esm/module_job:124:21)
at async ModuleJob.run (node:internal/modules/esm/module_job:181:5)
at async Promise.all (index 0)
at async ESMLoader.import (node:internal/modules/esm/loader:281:24)
at async loadESM (node:internal/process/esm_loader:88:5)
at async handleMainPromise (node:internal/modules/run_main:65:12)
It looks like Claude was creating a non-interactive shell which doesn't load .zshrc, so nvm was not being initialized correctly. Claude was using an older version of node from nvm, v16, which doesn't have scheduler in node:timers/promises. I "fixed" the issue by just deleting node 16, which leaves only node 20 in my list of nvm versions.
Activity
robdodson commentedon Jan 4, 2025
Looking in Claude's log file for my MCP server (found at
~/Library/Logs/Claude), it looks like there might be something wrong with the build:robdodson commentedon Jan 5, 2025
It looks like Claude was creating a non-interactive shell which doesn't load .zshrc, so nvm was not being initialized correctly. Claude was using an older version of node from nvm, v16, which doesn't have scheduler in node:timers/promises. I "fixed" the issue by just deleting node 16, which leaves only node 20 in my list of nvm versions.