{"record":{"id":"40c44ddcc8d5836f","repo":"oobabooga/textgen","slug":"unknown-mcp-server-type-server-type","errorCode":null,"errorMessage":"Unknown MCP server type: {server['type']}","messagePattern":"Unknown MCP server type: (.+?)","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"modules/tool_use.py","lineNumber":145,"sourceCode":"    \"\"\"Convert an MCP Tool object to OpenAI-format tool dict.\"\"\"\n    return {\n        \"type\": \"function\",\n        \"function\": {\n            \"name\": tool.name,\n            \"description\": tool.description or \"\",\n            \"parameters\": tool.inputSchema or {\"type\": \"object\", \"properties\": {}}\n        }\n    }\n\n\ndef _mcp_server_id(server):\n    \"\"\"Return a human-readable identifier for a server config.\"\"\"\n    if server[\"type\"] == \"http\":\n        return server[\"url\"]\n    elif server[\"type\"] == \"stdio\":\n        return f'{server[\"command\"]} {\" \".join(server[\"args\"])}'\n    else:\n        raise ValueError(f\"Unknown MCP server type: {server['type']}\")\n\n\nasync def _mcp_session(server, callback):\n    \"\"\"Open an MCP session and pass it to the callback.\"\"\"\n    from mcp import ClientSession\n\n    if server[\"type\"] == \"http\":\n        from mcp.client.streamable_http import streamablehttp_client\n        async with streamablehttp_client(server[\"url\"], headers=server[\"headers\"] or None) as (read_stream, write_stream, _):\n            async with ClientSession(read_stream, write_stream) as session:\n                await session.initialize()\n                return await callback(session)\n    elif server[\"type\"] == \"stdio\":\n        from mcp import StdioServerParameters\n        from mcp.client.stdio import stdio_client\n        params = StdioServerParameters(command=server[\"command\"], args=server[\"args\"], env=server.get(\"env\"))\n        async with stdio_client(params) as (read_stream, write_stream):\n            async with ClientSession(read_stream, write_stream) as session:","sourceCodeStart":127,"sourceCodeEnd":163,"githubUrl":"https://github.com/oobabooga/textgen/blob/ed888c71f221df552750e1834b3654abab8ae345/modules/tool_use.py#L127-L163","documentation":"Error \"Unknown MCP server type: {server['type']}\" thrown in oobabooga/textgen.","triggerScenarios":"Raised when parsing MCP server configuration and a server entry has an unrecognized 'type' field. Triggers when the tool-use/MCP config contains a type other than the supported transports; check the server definition in your MCP settings.","commonSituations":"See trigger scenarios.","solutions":["Set the MCP server 'type' to a supported value in the configuration.","Remove or correct the unknown MCP server entry in your settings."],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"ed888c71f221df552750e1834b3654abab8ae345","analyzedAt":"2026-08-15T05:24:21.000Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}