Skip to content

Can't add MCP servers that need a static auth header #229

@matiacone

Description

@matiacone

Problem

https://api.excalidraw.com/api/v1/mcp returns 401 Authorization header required because it needs a static API key.

Root cause

Chicken-and-egg in the probe:

  1. probeEndpoint (packages/plugins/mcp/src/sdk/plugin.ts:466-522) connects with no auth → 401, fails.
  2. Falls back to OAuth probe → not supported → fails.
  3. Returns "Could not connect to MCP endpoint and no OAuth was detected".

The UI (AddMcpSource.tsx:609) only shows the Authentication section after a successful probe, so the user can't supply the header needed to make the probe succeed.

Fix

Treat 401 as a third probe outcome (requiresHeaderAuth) alongside connected/OAuth. Surface the auth section, let the user pick a secret-backed header, then re-probe with it before enabling "Add source".

Acceptance

  • Excalidraw (and other static-token MCPs) add successfully via UI.
  • Genuine unreachable errors (DNS, 5xx) still fail cleanly.
  • OAuth flow unchanged.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions