{"record":{"id":"ae9b0c7ab86c0a15","repo":"langchain-ai/deepagents","slug":"server-server-name-has-type-server-type-r","errorCode":null,"errorMessage":"Server '{server_name}' has type '{server_type}' (remote) but also declares a 'command' field. Remove 'command' or set `\"type\": \"stdio\"`.","messagePattern":"Server '(.+?)' has type '(.+?)' \\(remote\\) but also declares a 'command' field\\. Remove 'command' or set `\"type\": \"stdio\"`\\.","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"libs/code/deepagents_code/mcp_tools.py","lineNumber":893,"sourceCode":"        raise TypeError(error_msg)\n\n    server_type = _resolve_server_type(server_config)\n\n    if server_type in _SUPPORTED_REMOTE_TYPES:\n        if \"url\" not in server_config:\n            error_msg = (\n                f\"Server '{server_name}' with type '{server_type}' \"\n                \"missing required 'url' field\"\n            )\n            raise ValueError(error_msg)\n\n        if \"command\" in server_config:\n            error_msg = (\n                f\"Server '{server_name}' has type '{server_type}' (remote) \"\n                \"but also declares a 'command' field. Remove 'command' or \"\n                'set `\"type\": \"stdio\"`.'\n            )\n            raise ValueError(error_msg)\n\n        headers = server_config.get(\"headers\")\n        if headers is not None and not isinstance(headers, dict):\n            error_msg = f\"Server '{server_name}' 'headers' must be a dictionary\"\n            raise TypeError(error_msg)\n\n        if isinstance(headers, dict):\n            for name, value in headers.items():\n                if not isinstance(value, str):\n                    error_msg = (\n                        f\"Server '{server_name}' header {name!r} must be \"\n                        f\"a string, got {type(value).__name__}\"\n                    )\n                    raise TypeError(error_msg)\n    elif server_type == \"stdio\":\n        if \"command\" not in server_config:\n            error_msg = f\"Server '{server_name}' missing required 'command' field\"\n            raise ValueError(error_msg)","sourceCodeStart":875,"sourceCodeEnd":911,"githubUrl":"https://github.com/langchain-ai/deepagents/blob/a1af029e6e73cb17c36bff823d227747b28e91e1/libs/code/deepagents_code/mcp_tools.py#L875-L911","documentation":"A server whose resolved type is remote must not declare a 'command' field; that field is exclusive to stdio servers. The error tells the user to remove 'command' or switch the type to stdio.","triggerScenarios":"Config mixing remote fields (type: http/sse + url) with a leftover 'command' key; converting a stdio entry to remote without deleting 'command'.","commonSituations":"Editing an existing stdio entry to point at a remote URL while keeping the launch command; merging two config files that define the same server differently.","solutions":["Remove the 'command' (and 'args') fields from the remote server entry","Set \"type\": \"stdio\" instead if the server is launched locally via command","Re-run validation after editing to confirm the config is clean"],"exampleFix":"// before\n{\"api\": {\"type\": \"http\", \"url\": \"https://mcp.example.com\", \"command\": \"npx\"}}\n// after\n{\"api\": {\"type\": \"http\", \"url\": \"https://mcp.example.com\"}}","handlingStrategy":"validation","validationCode":"def remote_entry_clean(cfg: dict) -> bool:\n    if cfg.get('type') in ('http', 'sse', 'streamable-http'):\n        return 'command' not in cfg\n    return True","typeGuard":null,"tryCatchPattern":"try:\n    tools = await resolve_and_load_mcp_tools(config)\nexcept ValueError as e:\n    if \"declares a 'command' field\" in str(e):\n        log.error('remote server must not define command: %s', e)\n    raise","preventionTips":["When converting stdio -> remote, delete 'command'/'args' in the same edit","Strip transport-specific keys per type before passing configs","Lint MCP config files to forbid command+url together"],"tags":["mcp","validation","configuration"],"backgroundTag":"conflicting-config-fields","analyzedSha":"a1af029e6e73cb17c36bff823d227747b28e91e1","analyzedAt":"2026-08-29T11:43:24.718Z","schemaVersion":2},"datasetVersion":"2026-08-29T12:17:43.993Z"}