{"record":{"id":"ed31cbaf57798933","repo":"langflow-ai/langflow","slug":"oauth-authentication-is-not-yet-implemented-for-mc","errorCode":null,"errorMessage":"OAuth authentication is not yet implemented for MCP server creation during project creation.","messagePattern":"OAuth authentication is not yet implemented for MCP server creation during project creation\\.","errorType":"http","errorClass":"HTTPException","httpStatus":501,"severity":"error","filePath":"src/backend/base/langflow/api/utils/mcp/config_utils.py","lineNumber":443,"sourceCode":"                streamable_http_url = await get_project_streamable_http_url(user_starter_folder.id)\n\n                # Prepare server config (similar to new project creation)\n                if default_auth.get(\"auth_type\", \"none\") == \"apikey\":\n                    command = \"uvx\"\n                    args = [\n                        *mcp_sdk_constraint_args(),\n                        \"mcp-proxy\",\n                        \"--transport\",\n                        \"streamablehttp\",\n                        \"--headers\",\n                        \"x-api-key\",\n                        unmasked_api_key.api_key,\n                        streamable_http_url,\n                    ]\n                elif default_auth.get(\"auth_type\", \"none\") == \"oauth\":\n                    msg = \"OAuth authentication is not yet implemented for MCP server creation during project creation.\"\n                    logger.warning(msg)\n                    raise HTTPException(status_code=501, detail=msg)\n                else:  # default_auth_type == \"none\"\n                    # No authentication - direct connection\n                    command = \"uvx\"\n                    args = [\n                        *mcp_sdk_constraint_args(),\n                        \"mcp-proxy\",\n                        \"--transport\",\n                        \"streamablehttp\",\n                        streamable_http_url,\n                    ]\n                server_config = {\"command\": command, \"args\": args}\n\n                # Add to user's MCP servers configuration\n                await logger.adebug(f\"Adding MCP server '{server_name}' for user {user.username}\")\n                await update_server(\n                    server_name,\n                    server_config,\n                    user,","sourceCodeStart":425,"sourceCodeEnd":461,"githubUrl":"https://github.com/langflow-ai/langflow/blob/976ec789d2886a86de109c044d089d68e96c9a35/src/backend/base/langflow/api/utils/mcp/config_utils.py#L425-L461","documentation":"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.","triggerScenarios":"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).","commonSituations":"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.","solutions":["Change the MCP server's auth_type to 'apikey' (supported: proxy forwards x-api-key) or 'none' and retry project creation","Front the streamable-http MCP endpoint with an external OAuth broker yourself, then use 'none' for the internal hop","Track upstream releases for OAuth MCP support instead of retrying — retrying unchanged will keep returning 501"],"exampleFix":"// before\n\"default_auth\": {\"auth_type\": \"oauth\"}\n// after\n\"default_auth\": {\"auth_type\": \"apikey\", \"api_key\": \"...\"}","handlingStrategy":"fallback","validationCode":"SUPPORTED_MCP_AUTH = {\"none\", \"apikey\"}\n\ndef mcp_auth_supported(server_def: dict) -> bool:\n    return server_def.get(\"default_auth\", {}).get(\"auth_type\", \"none\") in SUPPORTED_MCP_AUTH","typeGuard":null,"tryCatchPattern":"try:\n    create_project(template)\nexcept HTTPStatusError as e:\n    if e.response.status_code == 501 and \"OAuth\" in e.response.text:\n        for s in template[\"mcp_servers\"]:\n            s.setdefault(\"default_auth\", {})[\"auth_type\"] = \"apikey\"\n        create_project(template)  # retry with supported auth\n    else:\n        raise","preventionTips":["Template-validate auth_type against the supported set before calling project creation","Never ship oauth MCP configs against this server version; gate them by feature detection","Front oauth-protected endpoints with an external broker and use none/apikey for the internal hop"],"tags":["mcp","oauth","http-501","project-creation"],"backgroundTag":null,"analyzedSha":"976ec789d2886a86de109c044d089d68e96c9a35","analyzedAt":"2026-08-14T18:23:12.227Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}