langflow-ai/langflow · error · HTTPException

OAuth authentication is not yet implemented for MCP server c

Error message

OAuth authentication is not yet implemented for MCP server creation during project creation.

What it means

Raised while creating an MCP server during project creation when the project template/config requests auth_type='oauth' for the MCP endpoint. OAuth-backed MCP proxies are not implemented in this code path, so instead of producing a broken server config the API returns HTTP 501 with this message and logs a warning. It is an explicit capability gap, not a transient failure.

Source

Thrown at src/backend/base/langflow/api/utils/mcp/config_utils.py:443

                streamable_http_url = await get_project_streamable_http_url(user_starter_folder.id)

                # Prepare server config (similar to new project creation)
                if default_auth.get("auth_type", "none") == "apikey":
                    command = "uvx"
                    args = [
                        *mcp_sdk_constraint_args(),
                        "mcp-proxy",
                        "--transport",
                        "streamablehttp",
                        "--headers",
                        "x-api-key",
                        unmasked_api_key.api_key,
                        streamable_http_url,
                    ]
                elif default_auth.get("auth_type", "none") == "oauth":
                    msg = "OAuth authentication is not yet implemented for MCP server creation during project creation."
                    logger.warning(msg)
                    raise HTTPException(status_code=501, detail=msg)
                else:  # default_auth_type == "none"
                    # No authentication - direct connection
                    command = "uvx"
                    args = [
                        *mcp_sdk_constraint_args(),
                        "mcp-proxy",
                        "--transport",
                        "streamablehttp",
                        streamable_http_url,
                    ]
                server_config = {"command": command, "args": args}

                # Add to user's MCP servers configuration
                await logger.adebug(f"Adding MCP server '{server_name}' for user {user.username}")
                await update_server(
                    server_name,
                    server_config,
                    user,

View on GitHub (pinned to 976ec789d2)

Solutions

  1. Change the MCP server's auth_type to 'apikey' (supported: proxy forwards x-api-key) or 'none' and retry project creation
  2. Front the streamable-http MCP endpoint with an external OAuth broker yourself, then use 'none' for the internal hop
  3. Track upstream releases for OAuth MCP support instead of retrying — retrying unchanged will keep returning 501

Example fix

// before
"default_auth": {"auth_type": "oauth"}
// after
"default_auth": {"auth_type": "apikey", "api_key": "..."}
Defensive patterns

Strategy: fallback

Validate before calling

SUPPORTED_MCP_AUTH = {"none", "apikey"}

def mcp_auth_supported(server_def: dict) -> bool:
    return server_def.get("default_auth", {}).get("auth_type", "none") in SUPPORTED_MCP_AUTH

Try / catch

try:
    create_project(template)
except HTTPStatusError as e:
    if e.response.status_code == 501 and "OAuth" in e.response.text:
        for s in template["mcp_servers"]:
            s.setdefault("default_auth", {})["auth_type"] = "apikey"
        create_project(template)  # retry with supported auth
    else:
        raise

Prevention

When it happens

Trigger: POST project-creation (or project-from-template) API whose MCP server definition sets default_auth.auth_type='oauth'; config_utils.py hits the oauth branch, logs, and raises HTTPException(501).

Common situations: Importing a project template authored for a newer/enterprise Langflow that supports OAuth MCP; hand-writing an mcp config with oauth expecting the proxy to handle the token dance.

Understand the failure class

Related errors


AI-assisted analysis of langflow-ai/langflow@976ec789d2 (2026-08-14). Data as JSON: /api/errors/ed31cbaf57798933. Report an issue: GitHub.