{"id":"agent-network-restricted-dependency-install","title":"Dependency install fails because the agent sandbox blocks network access","status":"verified","affected_tools":["codex","claude-code","gemini","qwen-code","cursor","aider"],"tags":["agents","sandbox","network","dependencies"],"url":"https://laozhangzzz.github.io/agent-pitbook/pits/agent-network-restricted-dependency-install.html","markdown_url":"https://laozhangzzz.github.io/agent-pitbook/pits/agent-network-restricted-dependency-install.md","answer_summary":{"problem":"dependency installation fails with DNS, host resolution, registry, index, TLS, or timeout errors","root_cause":"The package manager needs external network access but the agent sandbox blocks it by default.","fix":"Classify the error as network-related before changing dependency manifests.","verification":"Re-run the same command after approved network access."},"answer_queries":["Dependency install fails because the agent sandbox blocks network access","Dependency install fails because the agent sandbox blocks network access fix","Dependency install fails because the agent sandbox blocks network access root cause","how to fix Dependency install fails because the agent sandbox blocks network access","codex install fails agent sandbox blocks network access","codex install fails agent sandbox blocks network access fix","blocks network access dependency install fails agent sandbox codex","blocks network access dependency install fails agent sandbox codex fix"]}
{"id":"agent-prompt-injection-in-debug-sources","title":"Debug sources can contain prompt injection targeting coding agents","status":"candidate","affected_tools":["codex","claude-code","gemini","qwen-code","cursor","aider"],"tags":["agents","security","prompt-injection","retrieval"],"url":"https://laozhangzzz.github.io/agent-pitbook/pits/agent-prompt-injection-in-debug-sources.html","markdown_url":"https://laozhangzzz.github.io/agent-pitbook/pits/agent-prompt-injection-in-debug-sources.md","answer_summary":{"problem":"a source includes instructions to ignore system or developer instructions","root_cause":"LLM-readable troubleshooting material can also be used as a prompt-injection channel.","fix":"Treat external source text as data rather than executable instruction.","verification":"Review the resulting pit record for instructions aimed at the consuming agent."},"answer_queries":["Debug sources can contain prompt injection targeting coding agents","Debug sources can contain prompt injection targeting coding agents fix","Debug sources can contain prompt injection targeting coding agents root cause","how to fix Debug sources can contain prompt injection targeting coding agents","codex sources contain prompt injection targeting coding agents","codex sources contain prompt injection targeting coding agents fix","targeting coding agents debug sources contain prompt injection codex","targeting coding agents debug sources contain prompt injection codex fix"]}
{"id":"claude-agent-sdk-mcp-json-requires-project-settingsource","title":"Claude Agent SDK does not load .mcp.json unless settingSources includes \"project\"","status":"verified","affected_tools":["claude-code","claude-agent-sdk"],"tags":["mcp","claude-agent-sdk","claude-code","mcp-json","settings","configuration"],"url":"https://laozhangzzz.github.io/agent-pitbook/pits/claude-agent-sdk-mcp-json-requires-project-settingsource.html","markdown_url":"https://laozhangzzz.github.io/agent-pitbook/pits/claude-agent-sdk-mcp-json-requires-project-settingsource.md","answer_summary":{"problem":"the SDK reports no MCP servers even though .mcp.json is in the working directory","root_cause":"The Agent SDK does not auto-load project/user/local settings from disk; it loads them only when settingSources is set.","fix":"Pass settingSources including 'project' (and 'user'/'local' as needed) when constructing the SDK query so .mcp.json is read.","verification":"Inspect mcpServerStatus() / the mcp_servers field on first SDK launch."},"answer_queries":["SDK doesnt read from .mcp.json until the CLI is run in the cwd","SDK doesnt read from .mcp.json until the CLI is run in the cwd fix","SDK doesnt read from .mcp.json until the CLI is run in the cwd root cause","Claude Agent SDK does not load .mcp.json unless settingSources includes project","Claude Agent SDK does not load .mcp.json unless settingSources includes \"project\" fix","Claude Agent SDK does not load .mcp.json unless settingSources includes \"project\" root cause","how to fix Claude Agent SDK does not load .mcp.json unless settingSources includes project","claude-code load mcp json unless settingsources includes project"]}
{"id":"claude-code-mcp-chrome-bridge-single-transport-deadlock","title":"Claude Code chrome-bridge MCP gets stuck after one transport connects","status":"verified","affected_tools":["claude-code","mcp-chrome-bridge"],"tags":["agents","claude-code","mcp","chrome","browser-automation","transport","deadlock","native-messaging"],"url":"https://laozhangzzz.github.io/agent-pitbook/pits/claude-code-mcp-chrome-bridge-single-transport-deadlock.html","markdown_url":"https://laozhangzzz.github.io/agent-pitbook/pits/claude-code-mcp-chrome-bridge-single-transport-deadlock.md","answer_summary":{"problem":"Claude Code cannot reconnect to the chrome-bridge MCP server","root_cause":"The bridge can reuse a singleton MCP Server instance across HTTP/SSE connections.","fix":"Do not use curl /mcp as a health check.","verification":"After killing or patching the native host, verify only the lightweight ping endpoint."},"answer_queries":["Singleton McpServer causes Already connected to a transport","Singleton McpServer causes Already connected to a transport fix","Singleton McpServer causes Already connected to a transport root cause","replace getMcpServer singleton with factory","replace getMcpServer singleton with factory fix","replace getMcpServer singleton with factory root cause","MCP Chrome Bridge returns 500 due to ERR_HTTP_HEADERS_SENT","MCP Chrome Bridge returns 500 due to ERR_HTTP_HEADERS_SENT fix"]}
{"id":"claude-desktop-mcp-protocol-instance-reuse-already-connected","title":"Claude Desktop MCP error: Already connected to a transport (Protocol instance reuse)","status":"verified","affected_tools":["claude-desktop"],"tags":["mcp","claude-desktop","transport","protocol","already-connected","client-bug","versioning"],"url":"https://laozhangzzz.github.io/agent-pitbook/pits/claude-desktop-mcp-protocol-instance-reuse-already-connected.html","markdown_url":"https://laozhangzzz.github.io/agent-pitbook/pits/claude-desktop-mcp-protocol-instance-reuse-already-connected.md","answer_summary":{"problem":"startup toasts: Could not connect to MCP server <name>","root_cause":"The MCP SDK connection model is one transport per Protocol/server instance.","fix":"Upgrade Claude Desktop to a build where this is fixed (resolved in a later release after 1.1.3918).","verification":"Upgrade Claude Desktop and relaunch."},"answer_queries":["Claude Desktop MCP servers fail with Protocol instance reuse error (Already connected to a transport); Anthropic confirms fix in a later Desktop release","Claude Desktop MCP servers fail with Protocol instance reuse error (Already connected to a transport); Anthropic confirms fix in a later Desktop release fix","Claude Desktop MCP servers fail with Protocol instance reuse error (Already connected to a transport); Anthropic confirms fix in a later Desktop release root cause","Claude Desktop MCP error: Already connected to a transport Protocol instance reuse","Claude Desktop MCP error: Already connected to a transport (Protocol instance reuse) fix","Claude Desktop MCP error: Already connected to a transport (Protocol instance reuse) root cause","how to fix Claude Desktop MCP error: Already connected to a transport Protocol instance reuse","claude-desktop error already connected transport protocol instance reuse"]}
{"id":"claude-desktop-no-dynamic-resource-templates","title":"Claude Desktop does not list dynamic MCP resource templates (only static resources)","status":"verified","affected_tools":["claude-desktop","mcp-server"],"tags":["mcp","claude-desktop","resources","resource-templates","client-capability","fastmcp"],"url":"https://laozhangzzz.github.io/agent-pitbook/pits/claude-desktop-no-dynamic-resource-templates.html","markdown_url":"https://laozhangzzz.github.io/agent-pitbook/pits/claude-desktop-no-dynamic-resource-templates.md","answer_summary":{"problem":"a static resource works in Claude Desktop but a parameterized/templated resource does not show","root_cause":"Dynamic resources are exposed via resources/templates/list; static resources via resources/list.","fix":"Do not rely on dynamic resource templates in Claude Desktop; confirm client support before designing around them.","verification":"Open the server in MCP Inspector and check the Resources tab."},"answer_queries":["dynamic resource not working in Claude desktop","dynamic resource not working in Claude desktop fix","dynamic resource not working in Claude desktop root cause","Claude Desktop does not list dynamic MCP resource templates only static resources","Claude Desktop does not list dynamic MCP resource templates (only static resources) fix","Claude Desktop does not list dynamic MCP resource templates (only static resources) root cause","how to fix Claude Desktop does not list dynamic MCP resource templates only static resources","claude-desktop list dynamic mcp resource templates static resources"]}
{"id":"codex-workspace-root-moved-stale-state","title":"Codex still references an old workspace path after a project move","status":"candidate","affected_tools":["codex"],"tags":["codex","workspace","macos","state"],"url":"https://laozhangzzz.github.io/agent-pitbook/pits/codex-workspace-root-moved-stale-state.html","markdown_url":"https://laozhangzzz.github.io/agent-pitbook/pits/codex-workspace-root-moved-stale-state.md","answer_summary":{"problem":"Codex or its sidebar references an old workspace folder","root_cause":"The desktop app persists workspace roots separately from the shell current directory, and those saved roots may not update when a folder is moved.","fix":"Use the app's normal folder switching or reopen-workspace flow first.","verification":"Start a fresh Codex session after switching or repairing the workspace."},"answer_queries":["Codex still references an old workspace path after a project move","Codex still references an old workspace path after a project move fix","Codex still references an old workspace path after a project move root cause","how to fix Codex still references an old workspace path after a project move","codex references old workspace path after project move","codex references old workspace path after project move fix","after project move still references old workspace path codex","after project move still references old workspace path codex fix"]}
{"id":"docker-published-port-localhost-refused","title":"Docker port is published but localhost refuses the connection","status":"verified","affected_tools":["codex","claude-code","gemini","qwen-code","cursor","aider"],"tags":["docker","macos","ports","localhost"],"url":"https://laozhangzzz.github.io/agent-pitbook/pits/docker-published-port-localhost-refused.html","markdown_url":"https://laozhangzzz.github.io/agent-pitbook/pits/docker-published-port-localhost-refused.md","answer_summary":{"problem":"docker ps or docker port shows the expected host port","root_cause":"The app inside the container is listening on loopback rather than a container network interface.","fix":"Change the app bind address inside the container to 0.0.0.0.","verification":"Inspect port mapping and make an HTTP request from the host."},"answer_queries":["Docker port is published but localhost refuses the connection","Docker port is published but localhost refuses the connection fix","Docker port is published but localhost refuses the connection root cause","how to fix Docker port is published but localhost refuses the connection","codex docker port published localhost refuses connection","codex docker port published localhost refuses connection fix","localhost refuses connection docker port published codex","localhost refuses connection docker port published codex fix"]}
{"id":"fastmcp-421-invalid-host-header-dns-rebinding","title":"FastMCP returns 421 Invalid Host Header behind a proxy due to DNS rebinding protection","status":"verified","affected_tools":["mcp-server","fastmcp"],"tags":["mcp","fastmcp","python-sdk","streamable-http","dns-rebinding","proxy","docker","421"],"url":"https://laozhangzzz.github.io/agent-pitbook/pits/fastmcp-421-invalid-host-header-dns-rebinding.html","markdown_url":"https://laozhangzzz.github.io/agent-pitbook/pits/fastmcp-421-invalid-host-header-dns-rebinding.md","answer_summary":{"problem":"all external requests fail with HTTP 421 Misdirected Request and 'Invalid Host header'","root_cause":"FastMCP enables DNS rebinding protection that validates the request Host header against an allowed list (added in PR #861).","fix":"Explicitly allow your hosts and origins via TransportSecuritySettings(allowed_hosts=[...], allowed_origins=[...]).","verification":"Send a proxied request after setting allowed_hosts or disabling protection."},"answer_queries":["Guide: Resolving '421 Invalid Host Header' DNS Rebinding Protection","Guide: Resolving '421 Invalid Host Header' (DNS Rebinding Protection) fix","Guide: Resolving '421 Invalid Host Header' (DNS Rebinding Protection) root cause","FastMCP returns 421 Invalid Host Header behind a proxy due to DNS rebinding protection","FastMCP returns 421 Invalid Host Header behind a proxy due to DNS rebinding protection fix","FastMCP returns 421 Invalid Host Header behind a proxy due to DNS rebinding protection root cause","how to fix FastMCP returns 421 Invalid Host Header behind a proxy due to DNS rebinding protection","mcp-server host header behind proxy dns rebinding protection"]}
{"id":"fastmcp-overrides-logging-configuration","title":"FastMCP overrides your app's logging configuration on init (duplicate or lost logs)","status":"candidate","affected_tools":["mcp-server","python-sdk","fastmcp"],"tags":["mcp","fastmcp","python-sdk","logging","configuration","side-effects"],"url":"https://laozhangzzz.github.io/agent-pitbook/pits/fastmcp-overrides-logging-configuration.html","markdown_url":"https://laozhangzzz.github.io/agent-pitbook/pits/fastmcp-overrides-logging-configuration.md","answer_summary":{"problem":"log messages become duplicated after the FastMCP server is created","root_cause":"FastMCP performs global logging configuration at startup (configure_logging) instead of confining itself to its own logger.","fix":"Re-apply your logging configuration after constructing FastMCP so your handlers win.","verification":"Emit logs after re-applying your config."},"answer_queries":["Option to not rewrite the logging configuration workarounds: re-apply dictConfig, remove added handler","Option to not rewrite the logging configuration (workarounds: re-apply dictConfig, remove added handler) fix","Option to not rewrite the logging configuration (workarounds: re-apply dictConfig, remove added handler) root cause","FastMCP overrides your apps logging configuration on init duplicate or lost logs","FastMCP overrides your apps logging configuration on init (duplicate or lost logs) fix","FastMCP overrides your apps logging configuration on init (duplicate or lost logs) root cause","how to fix FastMCP overrides your apps logging configuration on init duplicate or lost logs","mcp-server app logging configuration init duplicate lost logs"]}
{"id":"github-mcp-vscode-toolset-name-mismatch","title":"VS Code agent config: github/* MCP toolset is Unknown tool while github warns it's renamed","status":"candidate","affected_tools":["github-mcp-server","vscode"],"tags":["mcp","github-mcp-server","vscode","toolsets","configuration","naming"],"url":"https://laozhangzzz.github.io/agent-pitbook/pits/github-mcp-vscode-toolset-name-mismatch.html","markdown_url":"https://laozhangzzz.github.io/agent-pitbook/pits/github-mcp-vscode-toolset-name-mismatch.md","answer_summary":{"problem":"'tools': ['github/*'] produces Unknown tool","root_cause":"The server/* toolset alias resolves only when the MCP server is registered under the matching name (e.g. installed via the official flow so it is named github).","fix":"Use the name that resolves for your setup: if github/* is Unknown tool, use 'github' and ignore the rename warning for now.","verification":"Run the agent with the chosen tools entry."},"answer_queries":["VSCode Toolset name mismatch: github/* fails with Unknown tool, but github warns its deprecated","VSCode Toolset name mismatch: github/* fails with Unknown tool, but github warns its deprecated fix","VSCode Toolset name mismatch: github/* fails with Unknown tool, but github warns its deprecated root cause","VS Code agent config: github/* MCP toolset is Unknown tool while github warns its renamed","VS Code agent config: github/* MCP toolset is Unknown tool while github warns its renamed fix","VS Code agent config: github/* MCP toolset is Unknown tool while github warns its renamed root cause","how to fix VS Code agent config: github/* MCP toolset is Unknown tool while github warns its renamed","github-mcp-server mcp toolset unknown tool while warns renamed"]}
{"id":"macos-portaudio-silent-zero-capture-unavailable-default-input","title":"macOS PortAudio/sounddevice records all-zero silent audio with no error when the default mic is unavailable","status":"verified","affected_tools":["sounddevice","portaudio","voice-to-claude"],"tags":["macos","audio","portaudio","sounddevice","silent-capture","microphone","clamshell","voice"],"url":"https://laozhangzzz.github.io/agent-pitbook/pits/macos-portaudio-silent-zero-capture-unavailable-default-input.html","markdown_url":"https://laozhangzzz.github.io/agent-pitbook/pits/macos-portaudio-silent-zero-capture-unavailable-default-input.md","answer_summary":{"problem":"multi-second speech transcribes to a single junk token (e.g. 6.2s clip -> '我。', stray Korean '그.', or '谷歌')","root_cause":"With the lid closed (clamshell), the built-in MacBook mic is physically unavailable but is still enumerated AND still selected as the default input device.","fix":"Diagnose by measuring the recorded level, not by trusting the API: 0 == silent capture.","verification":"After pinning to the Studio Display mic, measure the recorded peak and run ASR."},"answer_queries":["macOS PortAudio/sounddevice records all-zero silent audio with no error when the default mic is unavailable","macOS PortAudio/sounddevice records all-zero silent audio with no error when the default mic is unavailable fix","macOS PortAudio/sounddevice records all-zero silent audio with no error when the default mic is unavailable root cause","how to fix macOS PortAudio/sounddevice records all-zero silent audio with no error when the default mic is unavailable","sounddevice silent audio no error default mic unavailable","sounddevice silent audio no error default mic unavailable fix","default mic unavailable all zero silent audio no error sounddevice","default mic unavailable all zero silent audio no error sounddevice fix"]}
{"id":"mcp-client-uses-user-level-npmrc-wrong-registry","title":"MCP server hangs because the GUI client uses your user-level .npmrc, not your project's","status":"verified","affected_tools":["cursor","claude-desktop","cline","mcp-server"],"tags":["mcp","npx","npmrc","registry","startup","timeout"],"url":"https://laozhangzzz.github.io/agent-pitbook/pits/mcp-client-uses-user-level-npmrc-wrong-registry.html","markdown_url":"https://laozhangzzz.github.io/agent-pitbook/pits/mcp-client-uses-user-level-npmrc-wrong-registry.md","answer_summary":{"problem":"npx -y <package> works in a project terminal but not when launched by the client","root_cause":"npm merges config from multiple .npmrc files; the project-level file only applies when the working directory is inside that project.","fix":"Inspect effective npm config and the user-level rc file.","verification":"Relaunch from the client after fixing ~/.npmrc."},"answer_queries":["author resolved 'Client closed' by fixing an incorrect registry in user-level ~/.npmrc that the project .npmrc had overridden in the terminal","author resolved 'Client closed' by fixing an incorrect registry in user-level ~/.npmrc that the project .npmrc had overridden in the terminal fix","author resolved 'Client closed' by fixing an incorrect registry in user-level ~/.npmrc that the project .npmrc had overridden in the terminal root cause","MCP server hangs because the GUI client uses your user-level .npmrc, not your projects","MCP server hangs because the GUI client uses your user-level .npmrc, not your projects fix","MCP server hangs because the GUI client uses your user-level .npmrc, not your projects root cause","how to fix MCP server hangs because the GUI client uses your user-level .npmrc, not your projects","cursor client uses your user level npmrc project"]}
{"id":"mcp-error-32000-connection-closed-server-failed-to-start","title":"MCP error -32000: Connection closed means the stdio server died before the handshake","status":"verified","affected_tools":["claude-desktop","cursor","cline","mcp-server"],"tags":["mcp","stdio","startup","error-32000","npx","diagnosis"],"url":"https://laozhangzzz.github.io/agent-pitbook/pits/mcp-error-32000-connection-closed-server-failed-to-start.html","markdown_url":"https://laozhangzzz.github.io/agent-pitbook/pits/mcp-error-32000-connection-closed-server-failed-to-start.md","answer_summary":{"problem":"client UI shows MCP error -32000: Connection closed","root_cause":"The client spawns the configured command and speaks JSON-RPC over stdio.","fix":"Reproduce outside the client: run the exact command + args from the config in a terminal with the same env.","verification":"Reconnect from the client after fixing the underlying cause."},"answer_queries":["GitHub MCP Server Fails to Start: 'npx' Command Error and Connection Closed -32000","GitHub MCP Server Fails to Start: 'npx' Command Error and Connection Closed (-32000) fix","GitHub MCP Server Fails to Start: 'npx' Command Error and Connection Closed (-32000) root cause","Fix 'Client Closed' Error by Correcting npm Config","Fix 'Client Closed' Error by Correcting npm Config fix","Fix 'Client Closed' Error by Correcting npm Config root cause","MCP error -32000: Connection closed means the stdio server died before the handshake","MCP error -32000: Connection closed means the stdio server died before the handshake fix"]}
{"id":"mcp-filesystem-server-windows-access-denied-case-sensitivity","title":"Filesystem MCP server denies allowed Windows paths due to drive-letter case mismatch","status":"candidate","affected_tools":["claude-desktop","cursor","mcp-server"],"tags":["mcp","server-filesystem","windows","paths","case-sensitivity","access-denied"],"url":"https://laozhangzzz.github.io/agent-pitbook/pits/mcp-filesystem-server-windows-access-denied-case-sensitivity.html","markdown_url":"https://laozhangzzz.github.io/agent-pitbook/pits/mcp-filesystem-server-windows-access-denied-case-sensitivity.md","answer_summary":{"problem":"Windows only: a file under an allowed directory returns 'Error: Access denied - path outside allowed directories'","root_cause":"The allowed-directory check compares request paths against allowed roots as strings.","fix":"Make the configured allowed-directory drive-letter case match what the client sends; try both C:\\... and c:\\... forms.","verification":"Call read_file on a path under the allowed directory after aligning case or applying the patched build."},"answer_queries":["Filesystem server access denied for allowed paths on Windows","Filesystem server access denied for allowed paths on Windows fix","Filesystem server access denied for allowed paths on Windows root cause","step toward fixing Windows path validation","step toward fixing Windows path validation fix","step toward fixing Windows path validation root cause","Filesystem MCP server denies allowed Windows paths due to drive-letter case mismatch","Filesystem MCP server denies allowed Windows paths due to drive-letter case mismatch fix"]}
{"id":"mcp-github-remote-oauth-dcr-unsupported-use-pat","title":"Remote MCP OAuth fails with \"does not support dynamic client registration\"; use a PAT","status":"verified","affected_tools":["claude-code","github-mcp-server"],"tags":["mcp","oauth","dynamic-client-registration","github","claude-code","remote-mcp","pat"],"url":"https://laozhangzzz.github.io/agent-pitbook/pits/mcp-github-remote-oauth-dcr-unsupported-use-pat.html","markdown_url":"https://laozhangzzz.github.io/agent-pitbook/pits/mcp-github-remote-oauth-dcr-unsupported-use-pat.md","answer_summary":{"problem":"claude mcp add ... https://api.githubcopilot.com/mcp/ then the connection fails","root_cause":"The client's OAuth flow relies on OAuth 2.1 Dynamic Client Registration to register itself with the authorization server.","fix":"Create a fine-grained GitHub Personal Access Token with the scopes you need.","verification":"Connect after providing the PAT in env."},"answer_queries":["Claude Code cannot connect to GitHubs remote MCP server using OAuth authentication PAT via GITHUB_PERSONAL_ACCESS_TOKEN is the confirmed workaround","Claude Code cannot connect to GitHubs remote MCP server using OAuth authentication (PAT via GITHUB_PERSONAL_ACCESS_TOKEN is the confirmed workaround) fix","Claude Code cannot connect to GitHubs remote MCP server using OAuth authentication (PAT via GITHUB_PERSONAL_ACCESS_TOKEN is the confirmed workaround) root cause","Remote MCP OAuth fails with \"does not support dynamic client registration\"; use a PAT","Remote MCP OAuth fails with \"does not support dynamic client registration\"; use a PAT fix","Remote MCP OAuth fails with \"does not support dynamic client registration\"; use a PAT root cause","how to fix Remote MCP OAuth fails with \"does not support dynamic client registration\"; use a PAT","claude-code oauth fails support dynamic client registration pat"]}
{"id":"mcp-inspector-docker-connection-refused-host-env","title":"MCP Inspector in Docker refuses connections unless HOST and ALLOWED_ORIGINS are set","status":"verified","affected_tools":["mcp-inspector"],"tags":["mcp","inspector","docker","devcontainer","networking","connection-refused","allowed-origins"],"url":"https://laozhangzzz.github.io/agent-pitbook/pits/mcp-inspector-docker-connection-refused-host-env.html","markdown_url":"https://laozhangzzz.github.io/agent-pitbook/pits/mcp-inspector-docker-connection-refused-host-env.md","answer_summary":{"problem":"curl http://localhost:6274 returns Failed to connect ... Connection refused","root_cause":"Inspector listens on the loopback interface, which inside a container is only reachable by processes in that container.","fix":"Pass HOST and ALLOWED_ORIGINS to the container run command.","verification":"Curl the UI port after setting the env vars."},"answer_queries":["Docker container connection refused HOST + ALLOWED_ORIGINS workaround","Docker container connection refused (HOST + ALLOWED_ORIGINS workaround) fix","Docker container connection refused (HOST + ALLOWED_ORIGINS workaround) root cause","MCP Inspector in Docker refuses connections unless HOST and ALLOWED_ORIGINS are set","MCP Inspector in Docker refuses connections unless HOST and ALLOWED_ORIGINS are set fix","MCP Inspector in Docker refuses connections unless HOST and ALLOWED_ORIGINS are set root cause","how to fix MCP Inspector in Docker refuses connections unless HOST and ALLOWED_ORIGINS are set","mcp-inspector refuses connections unless host allowed origins set"]}
{"id":"mcp-inspector-release-regression-pin-version","title":"MCP Inspector breaks after an upgrade; pin a known-good version","status":"verified","affected_tools":["mcp-inspector"],"tags":["mcp","inspector","npx","regression","versioning","streamable-http"],"url":"https://laozhangzzz.github.io/agent-pitbook/pits/mcp-inspector-release-regression-pin-version.html","markdown_url":"https://laozhangzzz.github.io/agent-pitbook/pits/mcp-inspector-release-regression-pin-version.md","answer_summary":{"problem":"npx @modelcontextprotocol/inspector fails with 'sh: mcp-inspector: command not found' or ''mcp-inspector' is not recognized' (0.10.0)","root_cause":"Inspector is released often and some releases regress.","fix":"Pin a known-good version to unblock, e.g. @0.9.0 for the 0.10.0 command-not-found regression or @0.16.7 for the 0.17.2 Controller-already-closed regression.","verification":"Run the pinned or fixed version."},"answer_queries":["sh: mcp-inspector: command not found after upgrading to v0.10.0 downgrade to 0.9.0","sh: mcp-inspector: command not found after upgrading to v0.10.0 (downgrade to 0.9.0) fix","sh: mcp-inspector: command not found after upgrading to v0.10.0 (downgrade to 0.9.0) root cause","Controller is already closed on fastmcp Streamable HTTP downgrade to 0.16.7; fixed in 0.17.5","Controller is already closed on fastmcp Streamable HTTP (downgrade to 0.16.7; fixed in 0.17.5) fix","Controller is already closed on fastmcp Streamable HTTP (downgrade to 0.16.7; fixed in 0.17.5) root cause","MCP Inspector breaks after an upgrade; pin a known-good version","MCP Inspector breaks after an upgrade; pin a known-good version fix"]}
{"id":"mcp-npx-cache-corrupted-server-fails-to-start","title":"A corrupted or cold npx cache makes an MCP server fail to start or time out","status":"verified","affected_tools":["claude-desktop","cursor","cline","mcp-server"],"tags":["mcp","npx","cache","startup","timeout","error-32001"],"url":"https://laozhangzzz.github.io/agent-pitbook/pits/mcp-npx-cache-corrupted-server-fails-to-start.html","markdown_url":"https://laozhangzzz.github.io/agent-pitbook/pits/mcp-npx-cache-corrupted-server-fails-to-start.md","answer_summary":{"problem":"npx-launched MCP server worked before and now fails, or fails only on first launch","root_cause":"npx downloads the package into the npm cache before running it.","fix":"Clear the npm/npx cache and relaunch.","verification":"Relaunch after clearing the cache or pre-installing."},"answer_queries":["comment confirming a corrupted npx cache from network errors caused the server to crash; clearing it fixed startup","comment confirming a corrupted npx cache from network errors caused the server to crash; clearing it fixed startup fix","comment confirming a corrupted npx cache from network errors caused the server to crash; clearing it fixed startup root cause","Client closed / -32001 Request timed out around npx MCP startup","Client closed / -32001 Request timed out around npx MCP startup fix","Client closed / -32001 Request timed out around npx MCP startup root cause","A corrupted or cold npx cache makes an MCP server fail to start or time out","A corrupted or cold npx cache makes an MCP server fail to start or time out fix"]}
{"id":"mcp-puppeteer-screenshots-in-memory-only","title":"Puppeteer MCP screenshots live in memory only; there is no file on disk to find","status":"verified","affected_tools":["mcp-server","claude-desktop"],"tags":["mcp","server-puppeteer","screenshots","resources","in-memory","misconception"],"url":"https://laozhangzzz.github.io/agent-pitbook/pits/mcp-puppeteer-screenshots-in-memory-only.html","markdown_url":"https://laozhangzzz.github.io/agent-pitbook/pits/mcp-puppeteer-screenshots-in-memory-only.md","answer_summary":{"problem":"puppeteer_screenshot reports success but no image file appears on disk","root_cause":"The server stores screenshots in memory and exposes them as MCP resources, with no documented filesystem path.","fix":"Retrieve the screenshot via the MCP resource the server exposes, not from a file path.","verification":"Inspect the resource list in the client/Inspector and the filesystem."},"answer_queries":["Puppeteer MCP Server Missing Screenshots","Puppeteer MCP Server Missing Screenshots fix","Puppeteer MCP Server Missing Screenshots root cause","Puppeteer MCP screenshots live in memory only; there is no file on disk to find","Puppeteer MCP screenshots live in memory only; there is no file on disk to find fix","Puppeteer MCP screenshots live in memory only; there is no file on disk to find root cause","how to fix Puppeteer MCP screenshots live in memory only; there is no file on disk to find","mcp-server live memory there no file disk find"]}
{"id":"mcp-reference-server-archived-unmaintained","title":"Several official reference MCP servers are archived; their bugs will not be fixed","status":"verified","affected_tools":["mcp-server","claude-desktop","cursor"],"tags":["mcp","servers","archived","deprecated","maintenance","postgres","github","puppeteer"],"url":"https://laozhangzzz.github.io/agent-pitbook/pits/mcp-reference-server-archived-unmaintained.html","markdown_url":"https://laozhangzzz.github.io/agent-pitbook/pits/mcp-reference-server-archived-unmaintained.md","answer_summary":{"problem":"a reference server misbehaves and the issue is closed with a deprecation/archival note","root_cause":"The project archived a number of reference servers to reduce maintenance load and focus on a smaller core set.","fix":"Before debugging a reference server, check whether it is in modelcontextprotocol/servers-archived or flagged deprecated in the main README.","verification":"Check the repository of the server you depend on."},"answer_queries":["server-postgres multi-instance issue closed; maintainer notes the server moved to servers-archived","server-postgres multi-instance issue closed; maintainer notes the server moved to servers-archived fix","server-postgres multi-instance issue closed; maintainer notes the server moved to servers-archived root cause","maintainer deprecation notice that server-github development moved to github/github-mcp-server","maintainer deprecation notice that server-github development moved to github/github-mcp-server fix","maintainer deprecation notice that server-github development moved to github/github-mcp-server root cause","Several official reference MCP servers are archived; their bugs will not be fixed","Several official reference MCP servers are archived; their bugs will not be fixed fix"]}
{"id":"mcp-reverse-proxy-buffers-sse-connection-fails","title":"A reverse proxy buffering SSE breaks remote MCP after OAuth and initialize succeed","status":"verified","affected_tools":["claude-desktop","mcp-server"],"tags":["mcp","sse","streamable-http","reverse-proxy","cloudflare-tunnel","buffering","remote-mcp"],"url":"https://laozhangzzz.github.io/agent-pitbook/pits/mcp-reverse-proxy-buffers-sse-connection-fails.html","markdown_url":"https://laozhangzzz.github.io/agent-pitbook/pits/mcp-reverse-proxy-buffers-sse-connection-fails.md","answer_summary":{"problem":"the client connects to a custom remote MCP then errors (e.g. 'There was an error connecting to your server')","root_cause":"MCP Streamable HTTP streams responses over SSE, which must be flushed incrementally.","fix":"Disable response buffering for the MCP endpoint at the proxy.","verification":"Connect through the proxy and watch the stream."},"answer_queries":["Claude Desktop custom MCP connection failure; confirmed root cause is Cloudflare Tunnel buffering SSE despite successful OAuth/initialize","Claude Desktop custom MCP connection failure; confirmed root cause is Cloudflare Tunnel buffering SSE despite successful OAuth/initialize fix","Claude Desktop custom MCP connection failure; confirmed root cause is Cloudflare Tunnel buffering SSE despite successful OAuth/initialize root cause","A reverse proxy buffering SSE breaks remote MCP after OAuth and initialize succeed","A reverse proxy buffering SSE breaks remote MCP after OAuth and initialize succeed fix","A reverse proxy buffering SSE breaks remote MCP after OAuth and initialize succeed root cause","how to fix A reverse proxy buffering SSE breaks remote MCP after OAuth and initialize succeed","claude-desktop breaks remote mcp after oauth initialize succeed"]}
{"id":"mcp-server-memory-ignores-memory-file-path-env","title":"server-memory ignores MEMORY_FILE_PATH because the npm build lagged the source","status":"verified","affected_tools":["claude-desktop","cursor","mcp-server"],"tags":["mcp","server-memory","environment-variable","npm","versioning","paths"],"url":"https://laozhangzzz.github.io/agent-pitbook/pits/mcp-server-memory-ignores-memory-file-path-env.html","markdown_url":"https://laozhangzzz.github.io/agent-pitbook/pits/mcp-server-memory-ignores-memory-file-path-env.md","answer_summary":{"problem":"MEMORY_FILE_PATH is set but the memory file is created at a default location","root_cause":"The npm release (e.g. 0.6.2) was older than the GitHub main source: its compiled dist/index.js hardcoded path.join(__dirname, 'memory.json').","fix":"Pin @modelcontextprotocol/server-memory@latest in the config to get the build that honors the env var (fix shipped in release 2025.4.25).","verification":"Launch with @latest and an absolute MEMORY_FILE_PATH, then check where the file is written."},"answer_queries":["Environment variables not respected in @modelcontextprotocol/server-memory package","Environment variables not respected in @modelcontextprotocol/server-memory package fix","Environment variables not respected in @modelcontextprotocol/server-memory package root cause","server-memory ignores MEMORY_FILE_PATH because the npm build lagged the source","server-memory ignores MEMORY_FILE_PATH because the npm build lagged the source fix","server-memory ignores MEMORY_FILE_PATH because the npm build lagged the source root cause","how to fix server-memory ignores MEMORY_FILE_PATH because the npm build lagged the source","claude-desktop ignores file path npm build lagged source"]}
{"id":"mcp-sse-received-request-before-initialization","title":"SSE MCP server: Received request before initialization was complete","status":"verified","affected_tools":["mcp-server","python-sdk"],"tags":["mcp","sse","initialization","proxy","supergateway","python-sdk","redeploy"],"url":"https://laozhangzzz.github.io/agent-pitbook/pits/mcp-sse-received-request-before-initialization.html","markdown_url":"https://laozhangzzz.github.io/agent-pitbook/pits/mcp-sse-received-request-before-initialization.md","answer_summary":{"problem":"server raises RuntimeError: Received request before initialization was complete on tools/list or a tool call","root_cause":"The MCP lifecycle requires the client's initialize to complete before other requests.","fix":"If a gateway/proxy is in front, use a spec-compliant one: switching supergateway -> mcp-proxy resolves the double-initialize case.","verification":"Use a compliant proxy or reconnect the client, then call tools/list."},"answer_queries":["MCP SSE Server: Received request before initialization was complete comment confirms supergateway double-initialize; mcp-proxy works","MCP SSE Server: Received request before initialization was complete (comment confirms supergateway double-initialize; mcp-proxy works) fix","MCP SSE Server: Received request before initialization was complete (comment confirms supergateway double-initialize; mcp-proxy works) root cause","SSE MCP server: Received request before initialization was complete","SSE MCP server: Received request before initialization was complete fix","SSE MCP server: Received request before initialization was complete root cause","how to fix SSE MCP server: Received request before initialization was complete","mcp-server mcp server received request initialization was complete"]}
{"id":"mcp-sse-session-lost-multi-worker","title":"MCP SSE session lost across workers/pods: Could not find session for ID (404)","status":"verified","affected_tools":["mcp-server","python-sdk","fastmcp"],"tags":["mcp","sse","sessions","kubernetes","gunicorn","scaling","streamable-http","python-sdk"],"url":"https://laozhangzzz.github.io/agent-pitbook/pits/mcp-sse-session-lost-multi-worker.html","markdown_url":"https://laozhangzzz.github.io/agent-pitbook/pits/mcp-sse-session-lost-multi-worker.md","answer_summary":{"problem":"SSE connection opens (200), first POST returns 202, later POSTs return 404","root_cause":"The SSE transport is stateful: the session lives in the memory of the worker/pod that accepted the SSE connection.","fix":"Preferred: run stateless with Streamable HTTP so no per-connection in-memory session is required.","verification":"Send repeated messages on one session under a multi-instance deployment after the change."},"answer_queries":["MCP Server Session Lost in Multi-Worker Environment comments confirm stateless_http=True and ingress sticky-hash fixes","MCP Server Session Lost in Multi-Worker Environment (comments confirm stateless_http=True and ingress sticky-hash fixes) fix","MCP Server Session Lost in Multi-Worker Environment (comments confirm stateless_http=True and ingress sticky-hash fixes) root cause","MCP SSE session lost across workers/pods: Could not find session for ID 404","MCP SSE session lost across workers/pods: Could not find session for ID (404) fix","MCP SSE session lost across workers/pods: Could not find session for ID (404) root cause","how to fix MCP SSE session lost across workers/pods: Could not find session for ID 404","mcp-server lost across workers pods find id 404"]}
{"id":"mcp-stateless-streamable-http-closedresourceerror","title":"Stateless Streamable HTTP MCP server throws anyio.ClosedResourceError on some SDK versions","status":"candidate","affected_tools":["mcp-server","python-sdk","fastmcp"],"tags":["mcp","python-sdk","streamable-http","stateless","anyio","closedresourceerror","versioning"],"url":"https://laozhangzzz.github.io/agent-pitbook/pits/mcp-stateless-streamable-http-closedresourceerror.html","markdown_url":"https://laozhangzzz.github.io/agent-pitbook/pits/mcp-stateless-streamable-http-closedresourceerror.md","answer_summary":{"problem":"each request raises an exception group ending in anyio.ClosedResourceError","root_cause":"In affected versions the stateless Streamable HTTP path re-enters the transport's read loop.","fix":"Pin a known-good SDK version; users reported 1.11.0 working where 1.12.0 failed.","verification":"Send repeated requests to the stateless server on the pinned/fixed version."},"answer_queries":["_handle_stateless_request ClosedResourceError reports 1.11.0 works, 1.12.0 fails; also FastMCP 2.10/2.13","_handle_stateless_request ClosedResourceError (reports 1.11.0 works, 1.12.0 fails; also FastMCP 2.10/2.13) fix","_handle_stateless_request ClosedResourceError (reports 1.11.0 works, 1.12.0 fails; also FastMCP 2.10/2.13) root cause","Stateless Streamable HTTP MCP server throws anyio.ClosedResourceError on some SDK versions","Stateless Streamable HTTP MCP server throws anyio.ClosedResourceError on some SDK versions fix","Stateless Streamable HTTP MCP server throws anyio.ClosedResourceError on some SDK versions root cause","how to fix Stateless Streamable HTTP MCP server throws anyio.ClosedResourceError on some SDK versions","mcp-server server throws anyio closedresourceerror some sdk versions"]}
{"id":"mcp-stdio-server-exits-shell-path-not-inherited","title":"MCP stdio server exits immediately because the GUI client does not inherit your shell PATH","status":"verified","affected_tools":["claude-desktop","mcp-server"],"tags":["mcp","stdio","path","environment","nvm","npx","macos","claude-desktop","transport"],"url":"https://laozhangzzz.github.io/agent-pitbook/pits/mcp-stdio-server-exits-shell-path-not-inherited.html","markdown_url":"https://laozhangzzz.github.io/agent-pitbook/pits/mcp-stdio-server-exits-shell-path-not-inherited.md","answer_summary":{"problem":"client log: Server transport closed unexpectedly, this is likely due to the process exiting early","root_cause":"GUI clients launch MCP servers without sourcing the user's shell config, so the child gets a minimal PATH.","fix":"Confirm the failure is launch-environment, not a broken server: it runs in your terminal but fails when the client launches it.","verification":"Inspect the client MCP log after a full restart."},"answer_queries":["MCP Servers Dont Work with NVM","MCP Servers Dont Work with NVM fix","MCP Servers Dont Work with NVM root cause","npx-for-claude wrapper workaround 66 reactions","npx-for-claude wrapper workaround (66 reactions) fix","npx-for-claude wrapper workaround (66 reactions) root cause","Server transport closed unexpectedly, process exiting early write EPIPE","Server transport closed unexpectedly, process exiting early (write EPIPE) fix"]}
{"id":"mcp-stdio-stdout-logging-breaks-protocol","title":"Writing to stdout in a stdio MCP server corrupts the JSON-RPC stream","status":"verified","affected_tools":["mcp-server","typescript-sdk","python-sdk"],"tags":["mcp","stdio","stdout","logging","json-rpc","console-log","protocol"],"url":"https://laozhangzzz.github.io/agent-pitbook/pits/mcp-stdio-stdout-logging-breaks-protocol.html","markdown_url":"https://laozhangzzz.github.io/agent-pitbook/pits/mcp-stdio-stdout-logging-breaks-protocol.md","answer_summary":{"problem":"client error SyntaxError: ... is not valid JSON inside deserializeMessage / JSON.parse","root_cause":"In the stdio transport, stdout is the JSON-RPC channel.","fix":"Remove or redirect all stdout writes in the server; use stderr.","verification":"Call a tool after moving logging to stderr."},"answer_queries":["SyntaxError in stdio deserializeMessage a console.log in the server triggers it","SyntaxError in stdio deserializeMessage (a console.log in the server triggers it) fix","SyntaxError in stdio deserializeMessage (a console.log in the server triggers it) root cause","Writing to stdout in a stdio MCP server corrupts the JSON-RPC stream","Writing to stdout in a stdio MCP server corrupts the JSON-RPC stream fix","Writing to stdout in a stdio MCP server corrupts the JSON-RPC stream root cause","how to fix Writing to stdout in a stdio MCP server corrupts the JSON-RPC stream","mcp-server stdio mcp server corrupts json rpc stream"]}
{"id":"mcp-streamable-http-client-no-oauth-on-401","title":"Streamable HTTP MCP client hangs on 401 instead of starting the OAuth flow","status":"verified","affected_tools":["mcp-inspector","mcp-server"],"tags":["mcp","streamable-http","oauth","401","inspector","authorization","transport"],"url":"https://laozhangzzz.github.io/agent-pitbook/pits/mcp-streamable-http-client-no-oauth-on-401.html","markdown_url":"https://laozhangzzz.github.io/agent-pitbook/pits/mcp-streamable-http-client-no-oauth-on-401.md","answer_summary":{"problem":"connecting to an OAuth-protected MCP server over Streamable HTTP hangs","root_cause":"The SSE client transport detected a 401 and started authorization.","fix":"Upgrade to a client/Inspector/SDK version where Streamable HTTP triggers OAuth on 401 (resolved in a released Inspector version).","verification":"Connect over Streamable HTTP to an OAuth-protected server on the fixed client."},"answer_queries":["When using Streamable HTTP transport, the oauth flow is not triggered when the server returns 401 resolved in a released Inspector version","When using Streamable HTTP transport, the oauth flow is not triggered when the server returns 401 (resolved in a released Inspector version) fix","When using Streamable HTTP transport, the oauth flow is not triggered when the server returns 401 (resolved in a released Inspector version) root cause","Streamable HTTP MCP client hangs on 401 instead of starting the OAuth flow","Streamable HTTP MCP client hangs on 401 instead of starting the OAuth flow fix","Streamable HTTP MCP client hangs on 401 instead of starting the OAuth flow root cause","how to fix Streamable HTTP MCP client hangs on 401 instead of starting the OAuth flow","mcp-inspector client hangs 401 instead starting oauth flow"]}
{"id":"mcp-time-server-invalid-local-timezone","title":"mcp-server-time crashes when the local timezone is an abbreviation like EDT/PDT/CEST","status":"verified","affected_tools":["mcp-server","claude-desktop"],"tags":["mcp","server-time","timezone","zoneinfo","iana","uvx"],"url":"https://laozhangzzz.github.io/agent-pitbook/pits/mcp-time-server-invalid-local-timezone.html","markdown_url":"https://laozhangzzz.github.io/agent-pitbook/pits/mcp-time-server-invalid-local-timezone.md","answer_summary":{"problem":"uvx mcp-server-time traceback through zoneinfo/_common.py load_tzdata failing to load the timezone","root_cause":"The server resolves the local timezone, but the platform reports a non-IANA abbreviation (e.g. EDT).","fix":"Pass an explicit IANA timezone with --local-timezone.","verification":"Start the server with an explicit IANA timezone."},"answer_queries":["Time server fails under EDT timezone use --local-timezone with an IANA name","Time server fails under EDT timezone (use --local-timezone with an IANA name) fix","Time server fails under EDT timezone (use --local-timezone with an IANA name) root cause","mcp-server-time crashes when the local timezone is an abbreviation like EDT/PDT/CEST","mcp-server-time crashes when the local timezone is an abbreviation like EDT/PDT/CEST fix","mcp-server-time crashes when the local timezone is an abbreviation like EDT/PDT/CEST root cause","how to fix mcp-server-time crashes when the local timezone is an abbreviation like EDT/PDT/CEST","mcp-server local timezone abbreviation like edt pdt cest"]}
{"id":"mcp-ts-client-default-60s-request-timeout","title":"MCP TypeScript client times out long tool calls after 60s (-32001) unless you reset on progress","status":"verified","affected_tools":["mcp-server","typescript-sdk"],"tags":["mcp","typescript-sdk","timeout","error-32001","progress","long-running"],"url":"https://laozhangzzz.github.io/agent-pitbook/pits/mcp-ts-client-default-60s-request-timeout.html","markdown_url":"https://laozhangzzz.github.io/agent-pitbook/pits/mcp-ts-client-default-60s-request-timeout.md","answer_summary":{"problem":"McpError: MCP error -32001: Request timed out with data: { timeout: 60000 }","root_cause":"The default per-request timeout is 60000 ms.","fix":"Pass request options as the third argument to callTool with a larger timeout and resetTimeoutOnProgress: true.","verification":"Run a tool call that exceeds 60 seconds with the options set."},"answer_queries":["mcp client times out after 60 seconds (ignoring timeout option); comments confirm callTool request options and resetTimeoutOnProgress","mcp client times out after 60 seconds (ignoring timeout option); comments confirm callTool request options and resetTimeoutOnProgress fix","mcp client times out after 60 seconds (ignoring timeout option); comments confirm callTool request options and resetTimeoutOnProgress root cause","MCP TypeScript client times out long tool calls after 60s (-32001) unless you reset on progress","MCP TypeScript client times out long tool calls after 60s (-32001) unless you reset on progress fix","MCP TypeScript client times out long tool calls after 60s (-32001) unless you reset on progress root cause","how to fix MCP TypeScript client times out long tool calls after 60s (-32001) unless you reset on progress","mcp-server after 60s 32001 unless you reset progress"]}
{"id":"mcp-ts-sdk-commonjs-esm-pkce-challenge","title":"MCP TypeScript SDK crashes in CommonJS projects with ERR_REQUIRE_ESM (pkce-challenge)","status":"verified","affected_tools":["mcp-server","typescript-sdk"],"tags":["mcp","typescript-sdk","commonjs","esm","nestjs","pkce-challenge","dependencies"],"url":"https://laozhangzzz.github.io/agent-pitbook/pits/mcp-ts-sdk-commonjs-esm-pkce-challenge.html","markdown_url":"https://laozhangzzz.github.io/agent-pitbook/pits/mcp-ts-sdk-commonjs-esm-pkce-challenge.md","answer_summary":{"problem":"runtime crash on MCP client init: ERR_REQUIRE_ESM: require() of ES Module pkce-challenge is not supported. Use dynamic import() instead","root_cause":"pkce-challenge shipped as ESM-only.","fix":"Upgrade @modelcontextprotocol/sdk to a version that lazily import()s pkce-challenge.","verification":"Start the CommonJS app and initialize the MCP client."},"answer_queries":["@modelcontextprotocol/sdk fails in CommonJS projects due to incompatible ESM-only dependency pkce-challenge","@modelcontextprotocol/sdk fails in CommonJS projects due to incompatible ESM-only dependency (pkce-challenge) fix","@modelcontextprotocol/sdk fails in CommonJS projects due to incompatible ESM-only dependency (pkce-challenge) root cause","MCP TypeScript SDK crashes in CommonJS projects with ERR_REQUIRE_ESM pkce-challenge","MCP TypeScript SDK crashes in CommonJS projects with ERR_REQUIRE_ESM (pkce-challenge) fix","MCP TypeScript SDK crashes in CommonJS projects with ERR_REQUIRE_ESM (pkce-challenge) root cause","how to fix MCP TypeScript SDK crashes in CommonJS projects with ERR_REQUIRE_ESM pkce-challenge","mcp-server commonjs projects err require esm pkce challenge"]}
{"id":"mcp-ts-sdk-edge-runtime-ajv-codegen-evalerror","title":"MCP TS SDK validation fails on Cloudflare Workers with EvalError (AJV code generation)","status":"candidate","affected_tools":["mcp-server","typescript-sdk"],"tags":["mcp","typescript-sdk","cloudflare-workers","edge","ajv","elicitation","evalerror"],"url":"https://laozhangzzz.github.io/agent-pitbook/pits/mcp-ts-sdk-edge-runtime-ajv-codegen-evalerror.html","markdown_url":"https://laozhangzzz.github.io/agent-pitbook/pits/mcp-ts-sdk-edge-runtime-ajv-codegen-evalerror.md","answer_summary":{"problem":"EvalError: Code generation from strings disallowed for this context, with a stack through new Function and Ajv.localCompile","root_cause":"The SDK validates JSON Schema with AJV v6, which generates validator code at runtime via new Function.","fix":"On Cloudflare, use the McpAgent integration that added elicitation support; call elicitation on the McpAgent class, not mcpServer.server.","verification":"Run the validation/elicitation path on the edge runtime."},"answer_queries":["Elicitation feature fails on Cloudflare Workers due to AJV code generation EvalError","Elicitation feature fails on Cloudflare Workers due to AJV code generation (EvalError) fix","Elicitation feature fails on Cloudflare Workers due to AJV code generation (EvalError) root cause","MCP TS SDK validation fails on Cloudflare Workers with EvalError AJV code generation","MCP TS SDK validation fails on Cloudflare Workers with EvalError (AJV code generation) fix","MCP TS SDK validation fails on Cloudflare Workers with EvalError (AJV code generation) root cause","how to fix MCP TS SDK validation fails on Cloudflare Workers with EvalError AJV code generation","mcp-server fails cloudflare workers evalerror ajv code generation"]}
{"id":"mcp-ts-sdk-type-instantiation-excessively-deep","title":"MCP TS SDK: 'Type instantiation is excessively deep' (ts2589) freezes the IDE","status":"verified","affected_tools":["mcp-server","typescript-sdk"],"tags":["mcp","typescript-sdk","zod","typescript","tsconfig","type-error","ide"],"url":"https://laozhangzzz.github.io/agent-pitbook/pits/mcp-ts-sdk-type-instantiation-excessively-deep.html","markdown_url":"https://laozhangzzz.github.io/agent-pitbook/pits/mcp-ts-sdk-type-instantiation-excessively-deep.md","answer_summary":{"problem":"Type instantiation is excessively deep and possibly infinite.ts(2589) on lines referencing SDK tool types","root_cause":"Deep generic instantiation in Zod's types as consumed by the SDK's tool typings.","fix":"Ensure a single Zod version is installed; duplicates are a common trigger.","verification":"Reopen the project and reference SDK tool types after the change."},"answer_queries":["Type instantiation is excessively deep when importing ToolCallback Zod author recommends single Zod version + modern moduleResolution; fixed in Zod 4.1.6","Type instantiation is excessively deep when importing ToolCallback (Zod author recommends single Zod version + modern moduleResolution; fixed in Zod 4.1.6) fix","Type instantiation is excessively deep when importing ToolCallback (Zod author recommends single Zod version + modern moduleResolution; fixed in Zod 4.1.6) root cause","MCP TS SDK: 'Type instantiation is excessively deep' (ts2589) freezes the IDE","MCP TS SDK: 'Type instantiation is excessively deep' (ts2589) freezes the IDE fix","MCP TS SDK: 'Type instantiation is excessively deep' (ts2589) freezes the IDE root cause","how to fix MCP TS SDK: 'Type instantiation is excessively deep' (ts2589) freezes the IDE","mcp-server type instantiation excessively deep ts2589 freezes ide"]}
{"id":"mcp-ts-sdk-zod-v4-incompatible","title":"MCP TypeScript SDK breaks with Zod v4: w._parse is not a function","status":"verified","affected_tools":["mcp-server","typescript-sdk"],"tags":["mcp","typescript-sdk","zod","dependencies","versioning","tools"],"url":"https://laozhangzzz.github.io/agent-pitbook/pits/mcp-ts-sdk-zod-v4-incompatible.html","markdown_url":"https://laozhangzzz.github.io/agent-pitbook/pits/mcp-ts-sdk-zod-v4-incompatible.md","answer_summary":{"problem":"tool execution returns {\"code\":-32603,\"message\":\"w._parse is not a function...\"}","root_cause":"MCP SDK versions up to ~1.17.5 declare zod ^3.x and call Zod internal API (_def, _parse).","fix":"Quick unblock: pin Zod v3 and ensure a single Zod version resolves.","verification":"Check the resolved Zod version and re-run a tool call."},"answer_queries":["MCP SDK v1.17.5 Incompatible with Zod v4 - Breaking Changes","MCP SDK v1.17.5 Incompatible with Zod v4 - Breaking Changes fix","MCP SDK v1.17.5 Incompatible with Zod v4 - Breaking Changes root cause","MCP TypeScript SDK breaks with Zod v4: w._parse is not a function","MCP TypeScript SDK breaks with Zod v4: w._parse is not a function fix","MCP TypeScript SDK breaks with Zod v4: w._parse is not a function root cause","how to fix MCP TypeScript SDK breaks with Zod v4: w._parse is not a function","mcp-server typescript sdk breaks zod v4 parse function"]}
{"id":"mcp-windows-npx-requires-cmd-c-wrapper","title":"On Windows an MCP server launched with npx needs a cmd /c wrapper","status":"verified","affected_tools":["claude-desktop","cursor","cline","mcp-server"],"tags":["mcp","windows","npx","cmd","spawn","enoent","startup"],"url":"https://laozhangzzz.github.io/agent-pitbook/pits/mcp-windows-npx-requires-cmd-c-wrapper.html","markdown_url":"https://laozhangzzz.github.io/agent-pitbook/pits/mcp-windows-npx-requires-cmd-c-wrapper.md","answer_summary":{"problem":"Windows only: the MCP server will not start","root_cause":"On Windows npx and npm are npx.cmd / npm.cmd batch files, not executables.","fix":"Launch through cmd: set command to 'cmd' and args to ['/c','npx','-y','<package>', ...].","verification":"Relaunch after wrapping with cmd /c."},"answer_queries":["Windows npx launch failure with garbled 'not recognized' error -32000","Windows npx launch failure with garbled 'not recognized' error (-32000) fix","Windows npx launch failure with garbled 'not recognized' error (-32000) root cause","comment noting Windows/WSL needs 'cmd /c' before 'npx -y' and matching npm versions","comment noting Windows/WSL needs 'cmd /c' before 'npx -y' and matching npm versions fix","comment noting Windows/WSL needs 'cmd /c' before 'npx -y' and matching npm versions root cause","On Windows an MCP server launched with npx needs a cmd /c wrapper","On Windows an MCP server launched with npx needs a cmd /c wrapper fix"]}
{"id":"portaudio-stream-close-blocks-hotkey-callback-thread","title":"PortAudio stream stop()/close() on a hotkey-callback thread can freeze the global hotkey listener","status":"verified","affected_tools":["portaudio","pynput","voice-to-claude"],"tags":["macos","audio","portaudio","pynput","threading","hotkey","deadlock","voice"],"url":"https://laozhangzzz.github.io/agent-pitbook/pits/portaudio-stream-close-blocks-hotkey-callback-thread.html","markdown_url":"https://laozhangzzz.github.io/agent-pitbook/pits/portaudio-stream-close-blocks-hotkey-callback-thread.md","answer_summary":{"problem":"a push-to-talk dictation daemon intermittently goes unresponsive after switching windows and dictating","root_cause":"stop()/close() of a PortAudio stream on a flaky/display-connected device can block for a long time.","fix":"Move recorder.stop() (the PortAudio stream.stop()/close() calls) AND all downstream processing off the pynput key-release callback thread into a background thread.","verification":"Use the daemon heavily across multiple windows after the change."},"answer_queries":["PortAudio stream stop()/close() on a hotkey-callback thread can freeze the global hotkey listener","PortAudio stream stop()/close() on a hotkey-callback thread can freeze the global hotkey listener fix","PortAudio stream stop()/close() on a hotkey-callback thread can freeze the global hotkey listener root cause","how to fix PortAudio stream stop()/close() on a hotkey-callback thread can freeze the global hotkey listener","portaudio close hotkey callback thread freeze global listener","portaudio close hotkey callback thread freeze global listener fix","freeze global listener stream stop close hotkey callback thread portaudio","freeze global listener stream stop close hotkey callback thread portaudio fix"]}
{"id":"pynput-mixed-cjk-ascii-type-out-of-order-macos","title":"pynput Controller.type() scrambles mixed Chinese+English text on macOS; use clipboard paste","status":"verified","affected_tools":["pynput","voice-to-claude"],"tags":["macos","pynput","text-injection","unicode","cjk","race-condition","clipboard","voice"],"url":"https://laozhangzzz.github.io/agent-pitbook/pits/pynput-mixed-cjk-ascii-type-out-of-order-macos.html","markdown_url":"https://laozhangzzz.github.io/agent-pitbook/pits/pynput-mixed-cjk-ascii-type-out-of-order-macos.md","answer_summary":{"problem":"injecting '打开Claude Code，然后commit一下。' yields '打开ClaudeC，然后一下。odecomit' — reordered, English fragments shoved to the end, some CJK dropped","root_cause":"On macOS pynput types CJK characters via synthesized Unicode events and ASCII via key events.","fix":"Switch text injection from per-character keyboard.type() to clipboard paste: copy the full string via pbcopy, then simulate Cmd+V.","verification":"Inject the same mixed Chinese+English sentence after the change."},"answer_queries":["pynput Controller.type() scrambles mixed Chinese+English text on macOS; use clipboard paste","pynput Controller.type() scrambles mixed Chinese+English text on macOS; use clipboard paste fix","pynput Controller.type() scrambles mixed Chinese+English text on macOS; use clipboard paste root cause","how to fix pynput Controller.type() scrambles mixed Chinese+English text on macOS; use clipboard paste","pynput mixed chinese english text macos clipboard paste","pynput mixed chinese english text macos clipboard paste fix","macos clipboard paste type scrambles mixed chinese english text pynput","macos clipboard paste type scrambles mixed chinese english text pynput fix"]}
{"id":"uv-cache-outside-workspace-sandbox","title":"uv fails in a managed workspace because cache or Python install paths are outside writable roots","status":"verified","affected_tools":["codex","claude-code","gemini","qwen-code","cursor","aider"],"tags":["python","uv","sandbox","cache"],"url":"https://laozhangzzz.github.io/agent-pitbook/pits/uv-cache-outside-workspace-sandbox.html","markdown_url":"https://laozhangzzz.github.io/agent-pitbook/pits/uv-cache-outside-workspace-sandbox.md","answer_summary":{"problem":"uv run or uv sync fails with permission or sandbox filesystem errors","root_cause":"uv defaults to cache or interpreter directories outside the agent's writable roots.","fix":"Set UV_CACHE_DIR to a workspace-local directory.","verification":"Run a small uv command with local paths."},"answer_queries":["uv fails in a managed workspace because cache or Python install paths are outside writable roots","uv fails in a managed workspace because cache or Python install paths are outside writable roots fix","uv fails in a managed workspace because cache or Python install paths are outside writable roots root cause","how to fix uv fails in a managed workspace because cache or Python install paths are outside writable roots","codex workspace cache python install paths writable roots","codex workspace cache python install paths writable roots fix","paths writable roots fails managed workspace cache python install codex","paths writable roots fails managed workspace cache python install codex fix"]}
