{"record":{"id":"bb5cf976bc98bcb0","repo":"ComposioHQ/composio","slug":"failed-to-retrieve-mcp-server-server-id","errorCode":null,"errorMessage":"Failed to retrieve MCP server {server_id}","messagePattern":"Failed to retrieve MCP server (.+?)","errorType":"validation","errorClass":"ValidationError","httpStatus":null,"severity":"error","filePath":"python/composio/core/models/mcp.py","lineNumber":313,"sourceCode":"\n        :param server_id: The unique identifier of the MCP server/config\n        :return: Complete MCP server information\n\n        Example:\n            >>> server = composio.experimental.mcp.get('mcp_12345')\n            >>>\n            >>> print(server['name'])  # \"My Personal MCP Server\"\n            >>> print(server['allowed_tools'])  # [\"GITHUB_CREATE_ISSUE\", \"SLACK_SEND_MESSAGE\"]\n            >>> print(server['toolkits'])  # [\"github\", \"slack\"]\n            >>> print(server['server_instance_count'])  # 3\n        \"\"\"\n        try:\n            response = self._client.mcp.retrieve(server_id)\n\n            return response\n\n        except Exception as e:\n            raise ValidationError(f\"Failed to retrieve MCP server {server_id}\") from e\n\n    def update(\n        self,\n        server_id: str,\n        name: t.Optional[str] = None,\n        toolkits: t.Optional[t.List[t.Union[ConfigToolkit, str]]] = None,\n        manually_manage_connections: t.Optional[bool] = None,\n        allowed_tools: t.Optional[t.List[str]] = None,\n    ):\n        \"\"\"\n        Update an existing MCP server configuration.\n\n        :param server_id: The unique identifier of the MCP server to update\n        :param name: Optional new name for the MCP server\n        :param toolkits: Optional list of toolkit configurations (strings or objects)\n        :param manually_manage_connections: Optional flag for connection management\n        :param allowed_tools: Optional list of specific tools to enable across all toolkits\n        :return: Updated MCP server information","sourceCodeStart":295,"sourceCodeEnd":331,"githubUrl":"https://github.com/ComposioHQ/composio/blob/64b1b85502b1beeb2379e6c9e8bf1104504fa637/python/composio/core/models/mcp.py#L295-L331","documentation":"Raised when retrieving a single MCP server/config by ID via MCP.get(server_id) fails — the client.mcp.retrieve call threw (bad ID, auth, network, or 4xx/5xx from the backend). The server_id is included in the message to identify which lookup failed; the original exception is chained.","triggerScenarios":"Calling composio.mcp.get(server_id) with a nonexistent, deleted, or malformed server_id; or when the request itself fails due to auth/network issues.","commonSituations":"Using a server_id copied from another workspace/environment, using an ID after the config was deleted, expired API key.","solutions":["Verify server_id exists by listing: [s.id for s in composio.mcp.list()]","Inspect e.__cause__ for the underlying HTTP status (404 vs 401 vs network)","Confirm the API key belongs to the same workspace where the server was created"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":"ids = {s.id for s in composio.mcp.list()}\nif server_id not in ids:\n    raise ValueError(f'unknown MCP server {server_id}')","typeGuard":null,"tryCatchPattern":"try:\n    cfg = composio.mcp.get(server_id)\nexcept ValidationError as e:\n    if getattr(e.__cause__, 'status_code', None) == 404:\n        return None\n    raise","preventionTips":["List-and-check IDs before get","Use IDs from the same workspace"],"tags":["mcp","python","not-found","retrieve"],"backgroundTag":"resource-not-found","analyzedSha":"64b1b85502b1beeb2379e6c9e8bf1104504fa637","analyzedAt":"2026-08-28T15:39:33.623Z","schemaVersion":2},"datasetVersion":"2026-08-28T16:17:29.566Z"}