fix MCP OAuth for all 5 services, add MCP connector edit view

This commit is contained in:
CREDO23 2026-04-22 10:50:43 +02:00
parent dde1948a5c
commit dfa40b8801
4 changed files with 53 additions and 16 deletions

View file

@ -128,7 +128,7 @@ async def connect_mcp_service(
status_code=502,
detail=f"DCR for {svc.name} did not return a client_id.",
)
elif not svc.supports_dcr and svc.client_id_env:
elif svc.client_id_env:
client_id = getattr(config, svc.client_id_env, None)
client_secret = getattr(config, svc.client_secret_env or "", None) or ""
if not client_id:
@ -446,7 +446,7 @@ async def reauth_mcp_service(
status_code=502,
detail=f"DCR for {svc.name} did not return a client_id.",
)
elif not svc.supports_dcr and svc.client_id_env:
elif svc.client_id_env:
client_id = getattr(config, svc.client_id_env, None)
client_secret = getattr(config, svc.client_secret_env or "", None) or ""
if not client_id:

View file

@ -1,9 +1,9 @@
"""Registry of MCP services with OAuth 2.1 support.
"""Registry of MCP services with OAuth support.
Each entry maps a URL-safe service key to its MCP server endpoint and
authentication strategy. Services with ``supports_dcr=True`` will use
RFC 7591 Dynamic Client Registration; the rest require pre-configured
credentials via environment variables.
authentication configuration. Services with ``supports_dcr=True`` use
RFC 7591 Dynamic Client Registration (the MCP server issues its own
credentials); the rest use pre-configured credentials via env vars.
"""
from __future__ import annotations
@ -65,8 +65,8 @@ MCP_SERVICES: dict[str, MCPServiceConfig] = {
name="Airtable",
mcp_url="https://mcp.airtable.com/mcp",
connector_type="AIRTABLE_CONNECTOR",
oauth_discovery_origin="https://airtable.com",
supports_dcr=False,
oauth_discovery_origin="https://airtable.com",
client_id_env="AIRTABLE_CLIENT_ID",
client_secret_env="AIRTABLE_CLIENT_SECRET",
scopes=["data.records:read", "data.records:write", "schema.bases:read", "schema.bases:write"],