{"record":{"id":"bc30ef25b9bafbcc","repo":"BerriAI/litellm","slug":"server-name-cannot-contain-mcp-tool-prefix-separ","errorCode":null,"errorMessage":"Server name cannot contain '{MCP_TOOL_PREFIX_SEPARATOR}'. Use an alternative character instead Found: {server_name}","messagePattern":"Server name cannot contain '(.+?)'\\. Use an alternative character instead Found: (.+?)","errorType":"http","errorClass":"HTTPException","httpStatus":400,"severity":"error","filePath":"litellm/proxy/_experimental/mcp_server/utils.py","lineNumber":502,"sourceCode":"\ndef validate_mcp_server_name(server_name: str, raise_http_exception: bool = False) -> None:\n    \"\"\"\n    Validate that MCP server name does not contain 'MCP_TOOL_PREFIX_SEPARATOR'.\n\n    Args:\n        server_name: The server name to validate\n        raise_http_exception: If True, raises HTTPException instead of generic Exception\n\n    Raises:\n        Exception or HTTPException: If server name contains 'MCP_TOOL_PREFIX_SEPARATOR'\n    \"\"\"\n    if server_name and MCP_TOOL_PREFIX_SEPARATOR in server_name:\n        error_message = f\"Server name cannot contain '{MCP_TOOL_PREFIX_SEPARATOR}'. Use an alternative character instead Found: {server_name}\"\n        if raise_http_exception:\n            from fastapi import HTTPException\n            from starlette import status\n\n            raise HTTPException(status_code=status.HTTP_400_BAD_REQUEST, detail={\"error\": error_message})\n        else:\n            raise Exception(error_message)\n\n\ndef extract_mcp_tool_result_error_message(result: object) -> str | None:\n    \"\"\"The first text content of an ``isError=True`` tool result, or ``None``\n    when the result is not an error.\n\n    Accepts both ``mcp.types.CallToolResult`` objects and their dict\n    equivalents, duck-typed so the ``mcp`` package is not required.\n    \"\"\"\n    is_error: Final[object] = result.get(\"isError\") if isinstance(result, Mapping) else getattr(result, \"isError\", None)\n    if is_error is not True:\n        return None\n    content: Final[object] = result.get(\"content\") if isinstance(result, Mapping) else getattr(result, \"content\", None)\n    if isinstance(content, (list, tuple)):\n        for item in content:\n            text: object = item.get(\"text\") if isinstance(item, Mapping) else getattr(item, \"text\", None)","sourceCodeStart":484,"sourceCodeEnd":520,"githubUrl":"https://github.com/BerriAI/litellm/blob/77b7c6c40c0c5aa5fbcb1d6a1825ac39ca8829b8/litellm/proxy/_experimental/mcp_server/utils.py#L484-L520","documentation":"validate_mcp_server_name rejects names containing MCP_TOOL_PREFIX_SEPARATOR ('/') because the separator is how tool names are prefixed per server; allowing it would make prefixed tool names ambiguous. Raised as Exception or HTTPException depending on the flag.","triggerScenarios":"Thrown at litellm/proxy/_experimental/mcp_server/utils.py:502 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Rename the MCP server to remove the prefix separator character."],"exampleFix":"Use letters/digits/underscores in the server name.","handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"77b7c6c40c0c5aa5fbcb1d6a1825ac39ca8829b8","analyzedAt":"2026-08-18T11:44:31.656Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}