oobabooga/textgen · error · ValueError

Unknown MCP server type: {server['type']}

Error message

Unknown MCP server type: {server['type']}

What it means

Error "Unknown MCP server type: {server['type']}" thrown in oobabooga/textgen.

Source

Thrown at modules/tool_use.py:145

    """Convert an MCP Tool object to OpenAI-format tool dict."""
    return {
        "type": "function",
        "function": {
            "name": tool.name,
            "description": tool.description or "",
            "parameters": tool.inputSchema or {"type": "object", "properties": {}}
        }
    }


def _mcp_server_id(server):
    """Return a human-readable identifier for a server config."""
    if server["type"] == "http":
        return server["url"]
    elif server["type"] == "stdio":
        return f'{server["command"]} {" ".join(server["args"])}'
    else:
        raise ValueError(f"Unknown MCP server type: {server['type']}")


async def _mcp_session(server, callback):
    """Open an MCP session and pass it to the callback."""
    from mcp import ClientSession

    if server["type"] == "http":
        from mcp.client.streamable_http import streamablehttp_client
        async with streamablehttp_client(server["url"], headers=server["headers"] or None) as (read_stream, write_stream, _):
            async with ClientSession(read_stream, write_stream) as session:
                await session.initialize()
                return await callback(session)
    elif server["type"] == "stdio":
        from mcp import StdioServerParameters
        from mcp.client.stdio import stdio_client
        params = StdioServerParameters(command=server["command"], args=server["args"], env=server.get("env"))
        async with stdio_client(params) as (read_stream, write_stream):
            async with ClientSession(read_stream, write_stream) as session:

View on GitHub (pinned to ed888c71f2)

Solutions

  1. Set the MCP server 'type' to a supported value in the configuration.
  2. Remove or correct the unknown MCP server entry in your settings.

When it happens

Trigger: 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.

Common situations: See trigger scenarios.


AI-assisted analysis of oobabooga/textgen@ed888c71f2 (2026-08-15). Data as JSON: /api/errors/40c44ddcc8d5836f. Report an issue: GitHub.