Skip to content

Add an MCP server by its address from Connections - #1517

Merged
davidmckayv merged 3 commits into
mainfrom
feat/add-mcp-server-by-url
Nov 12, 2026
Merged

davidmckayv merged 3 commits into
mainfrom
feat/add-mcp-server-by-url

Conversation

@davidmckayv

@davidmckayv davidmckayv commented Nov 12, 2026 •

Copy link
Copy Markdown
Contributor

What this does

A person can add any remote MCP server OpenBot doesn't list, by its address, from Connections → Add server, and give it to Bots like any other app. Figma's and Fireflies' official servers are the motivating cases.

OpenBot asks the server, with no credential, how it is reached:

  • Answers normally (DeepWiki): added, tools listed at once, Bots use it as it is.
  • 401 with an OAuth challenge (Fireflies, Figma): follows the MCP authorization spec. Protected resource metadata (RFC 9728), authorization server metadata (RFC 8414 / OpenID), dynamic client registration (RFC 7591), PKCE S256 and resource (RFC 8707), all through the MCP TypeScript SDK's own client/auth functions. Each person then signs in in their own browser and every call runs on their token.
  • 401 with no sign-in: asks for a key.

Background

addCustomServer and POST /servers/custom have existed since the beginning. The add-by-URL screen went away in #97, as a side effect of rebuilding the admin Plugins page into two lists; that PR kept the endpoint on purpose. It was admin-only and handled only no-auth and deployment-token servers.

Design

  • SDK for the protocol, OpenBot for the safety. Every address OpenBot fetches (the server, its metadata, token and registration endpoints) goes through the existing custom-server floor (https only, no IPs, no localhost or internal names, no metadata hosts, no credentials in the address), with no redirects followed. The SDK doesn't check the metadata issuer or the RFC 9207 iss on the redirect; OpenBot does both.
  • Discovered config on the row: mcp_servers.oauth (migration 0091, generated by drizzle-kit). The server then reads as a catalogue user-oauth app everywhere: access resolution, owner grants (Bot owners may give it), app-access state, Connections tiles, the connect route and the callback.
  • Registration at add time, so a server that only accepts approved clients is refused on the form, with nothing left behind.
  • Token set, not just a refresh token: each person's access token, refresh token and expiry are encrypted in the vault as an mcp_user_token. The access token is used until it nears expiry, then refreshed, so servers that never issue a refresh token still work.
  • Desktop: ?from=desktop now returns OAuth consents through /desktop-return, as Composio and Arcade already did (this also fixes Notion and Drive on Desktop).
  • Keys are the server's own credential, used by every Bot, so in the team edition only an admin may give one.
  • MCP allowlist (team edition): with it on, an address must be approved before anybody can add it. Allowlist entries may now be addresses as well as server ids, and a server added at an approved address is approved by that entry at call time. Admins approve an address under Admin → Apps → MCP servers, or press Approve and add on the form. The personal edition has no allowlist.
  • Bot text: show_app_access no longer leaves the model to say a server can't be used by its URL; it says the person can add it on Connections.
  • OPENBOT_ALLOW_LOOPBACK_MCP=1 admits http://127.0.0.1 for development and tests only. Documented in docs/configuration.md and docs/plugins/mcp-by-url.md.

Figma

Figma's remote MCP server only accepts clients in its own catalogue. Checked live: its registration endpoint answers 403 Forbidden to OpenBot, and the form says so. It works once Figma approves OpenBot as a client. Fireflies registers OpenBot and reaches its sign-in page.

Tests

  • server/tests/custom-mcp-by-url.integration.test.ts: real routes, real store, real vault, against a real OAuth MCP server on 127.0.0.1 (server/tests/support/oauth-mcp-server.ts, built on the SDK's server). Covers discovery, registration, the consent redirect (PKCE, resource), a forged iss refused, code redemption, the encrypted token set, tools listed as the person, the app reading ready to a Bot, a Bot's tool call, refresh after the access token lapses, a no-auth server, the address-safety refusals (regression), the non-admin key refusal and the allowlist by address.
  • server/tests/mcp-allowlist-address.test.ts: address matching and server ids.
  • server/tests/app-access-tool.test.ts: the Bot is told a server can be added by URL.
  • The app-access fix (a by-URL server read "not connected" after sign-in) was red then green against the integration test.

End to end in a real browser: added the local OAuth server, signed in, and a Bot saved and listed notes through it; added https://mcp.deepwiki.com/mcp and a Bot read a repository's wiki structure through it; Figma refused on the form; allowlist refusal and Approve and add in the team edition.

Not in this PR

  • Disconnect for a by-URL OAuth server (Notion has none either).
  • Removing a server is still an admin act, including for the person who added it.
  • Tools on servers added by URL are all treated as writes, as before.

Found driving it end to end, fixed in the second commit

  • A sign-in server's tile opened the sign-in directly, so a server whose sign-in was abandoned had no way back to its page and its off switch. The tile now opens the page.
  • Address refusals on this person-facing route named "this deployment" and the "token field"; they now say what to do.
  • A no-auth server's key row and a not-yet-connected server's empty tool list now say the right thing.

A person can now add any remote MCP server OpenBot doesn't list, by URL, from
Connections (Add server), and give it to Bots like any other app. The add-by-URL
screen went away in #97 when the admin Plugins page was rebuilt; the endpoint
stayed. This brings the flow back for everyone, not only admins.

OpenBot asks the server, with no credential, how it is reached. A normal reply
adds it and lists its tools. A 401 with an OAuth challenge follows the MCP
authorization spec: protected resource metadata (RFC 9728), authorization server
metadata (RFC 8414 / OpenID), dynamic client registration (RFC 7591), PKCE S256
and the resource parameter (RFC 8707), all through the MCP TypeScript SDK's own
client/auth functions. OpenBot adds what the SDK leaves out: every address it
fetches is held to the custom-server floor with no redirects followed, the
metadata issuer must match, and the iss on the callback is checked (RFC 9207).
Registration happens at add time, so a server that only accepts approved apps
(Figma's does) is refused on the form with nothing left behind.

Each person's token set is kept in the vault as an mcp_user_token; the access
token is used until it nears expiry, then refreshed, so servers that never issue
a refresh token work. A sign-in server reads as a catalogue user-oauth app
everywhere else: owner grants, app-access state, Connections tiles. In OpenBot
Desktop the sign-in returns through /desktop-return, now for Notion and Drive too.

Team edition: with the MCP allowlist on, an address must be approved first.
Allowlist entries may now be addresses; a server added at an approved address is
approved by that entry at call time. Admins approve an address under Admin, Apps,
MCP servers, or press Approve and add on the form. A key is the server's own and
used by every Bot, so only an admin may give one. Personal edition has no
allowlist.

show_app_access now tells the model a server can be added by its URL on
Connections, so a Bot no longer says it can't use one.

OPENBOT_ALLOW_LOOPBACK_MCP=1 admits 127.0.0.1 for development and tests only.
Tests run a real OAuth MCP server on 127.0.0.1 through the real routes: sign-in,
token storage, refresh, tool listing, a Bot's call, the iss check, address
refusals and the allowlist.
@davidmckayv
davidmckayv force-pushed the feat/add-mcp-server-by-url branch from 2413fba to a9022d0 Compare November 12, 2026 19:04
davidmckayv and others added 2 commits November 12, 2026 11:29
- A server added by URL that signs people in no longer connects on a tile press
  in the personal edition: the tile opens its page, which offers Connect beside
  the switch that removes it. Before, a server whose sign-in was abandoned had no
  way back to that switch.
- The address refusals on the person-facing route are said in the person's words
  (the floor's own sentences name the deployment and the token field), and a
  refused discovered address no longer echoes the floor's sentence.
- A no-auth server's key row says nothing is sent, instead of describing a token
  that is never sent; a sign-in server with nobody connected says to connect to
  see its tools, instead of Refresh.
- "Enter the full address, starting with https://." for an address that does not
  parse.
@davidmckayv
davidmckayv merged commit 7edbacc into main Nov 12, 2026
25 checks passed
@davidmckayv
davidmckayv deleted the feat/add-mcp-server-by-url branch November 12, 2026 19:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant