{"record":{"id":"9cca9ec7294a9d8f","repo":"langchain-ai/deepagents","slug":"mcp-server-server-name-configured-command-not","errorCode":null,"errorMessage":"MCP server '{server_name}': configured command not found on PATH. Install it or check your MCP config.","messagePattern":"MCP server '(.+?)': configured command not found on PATH\\. Install it or check your MCP config\\.","errorType":"validation","errorClass":"RuntimeError","httpStatus":null,"severity":"error","filePath":"libs/code/deepagents_code/mcp_tools.py","lineNumber":1860,"sourceCode":"    \"\"\"Verify that a stdio server's command exists on PATH.\n\n    Args:\n        server_name: Server name for error messages.\n        server_config: Validated server config.\n\n    Raises:\n        RuntimeError: If the command is missing or not found on PATH.\n    \"\"\"\n    command = server_config.get(\"command\")\n    if command is None:\n        msg = f\"MCP server '{server_name}': missing 'command' in config.\"\n        raise RuntimeError(msg)\n    if shutil.which(command) is None:\n        msg = (\n            f\"MCP server '{server_name}': configured command not found on PATH. \"\n            \"Install it or check your MCP config.\"\n        )\n        raise RuntimeError(msg)\n\n\nasync def _check_remote_server(server_name: str, server_config: dict[str, Any]) -> None:\n    \"\"\"Check network connectivity to a remote MCP server URL.\n\n    Args:\n        server_name: Server name for error messages.\n        server_config: Validated remote server config.\n\n    Raises:\n        RuntimeError: If the URL is missing, unreachable, or returns 5xx.\n    \"\"\"\n    import httpx\n\n    url = server_config.get(\"url\")\n    if url is None:\n        msg = f\"MCP server '{server_name}': missing 'url' in config.\"\n        raise RuntimeError(msg)","sourceCodeStart":1842,"sourceCodeEnd":1878,"githubUrl":"https://github.com/langchain-ai/deepagents/blob/a1af029e6e73cb17c36bff823d227747b28e91e1/libs/code/deepagents_code/mcp_tools.py#L1842-L1878","documentation":"For stdio MCP servers, `_check_stdio_server` resolves the configured `command` with `shutil.which`. If the executable is not found on the system PATH it raises this RuntimeError telling you to install the command or fix the config. The config is structurally valid; the binary simply isn't available in the current environment.","triggerScenarios":"Config command like \"mcp-server-fs\", \"npx\", or \"uvx\" that isn't installed or isn't on PATH when the check runs: binary never installed, run inside a container/venv lacking the tool, or a Windows-only command on Linux.","commonSituations":"Fresh machine or CI container missing Node/npx or uvx; tool installed via pipx/cargo into ~/.local/bin not on PATH in the shell running dcode; command renamed between versions; using a package-internal entry point without installing the package.","solutions":["Install the command (e.g. `npm install -g <pkg>` for npx-based servers, `pip install`/`uv tool install` for uvx-based ones) and confirm with `which <command>`.","Use an absolute path to the executable in 'command' if it lives outside PATH, e.g. \"/home/me/.local/bin/mcp-server-fs\".","Fix PATH for the environment running the agent (export PATH=... in the shell, systemd unit, or container image) so the binary resolves.","If the server moved/renamed, update the 'command' value in the MCP config to the current executable name."],"exampleFix":"// before\n{\"mcpServers\": {\"fs\": {\"command\": \"mcp-server-fs\", \"args\": [\"/tmp\"]}}}\n// after (absolute path, or install the binary first)\n{\"mcpServers\": {\"fs\": {\"command\": \"/home/me/.local/bin/mcp-server-fs\", \"args\": [\"/tmp\"]}}}","handlingStrategy":"validation","validationCode":"import shutil\nfor name, server in cfg[\"mcpServers\"].items():\n    cmd = server.get(\"command\")\n    if cmd and shutil.which(cmd) is None:\n        raise SystemExit(f\"'{name}': command '{cmd}' not on PATH — install it\")","typeGuard":"def command_available(server: dict) -> bool:\n    import shutil\n    cmd = server.get(\"command\")\n    return isinstance(cmd, str) and shutil.which(cmd) is not None","tryCatchPattern":"try:\n    check_mcp_servers(cfg)\nexcept RuntimeError as e:\n    if \"not found on PATH\" in str(e):\n        print(f\"install the tool or fix PATH: {e}\")\n    else:\n        raise","preventionTips":["Run `which <command>` for every configured server command on a new machine/CI image.","Prefer absolute executable paths in configs for reproducibility.","Document required system dependencies (node/npx, uvx, etc.) in the project README.","Install servers via a lockfile or setup script so environments match."],"tags":["mcp","stdio","path","environment"],"backgroundTag":"command-not-found","analyzedSha":"a1af029e6e73cb17c36bff823d227747b28e91e1","analyzedAt":"2026-08-29T11:43:24.718Z","schemaVersion":2},"datasetVersion":"2026-08-29T12:17:43.993Z"}