Skip to content

Commit 6355424

Browse files
authored
mig(external_mcp): support source names and oauth metadata discovery (#1095)
This updates schema and models to support to new features to be released in subsequent PRs: * decoupling source name from registry specifier * discovering and persisting OAuth metadata from external MCP servers in order to support OAuth in external MCPs more seamlessly
1 parent 03b8105 commit 6355424

File tree

4 files changed

+39
-17
lines changed

4 files changed

+39
-17
lines changed

server/database/schema.sql

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1085,6 +1085,7 @@ CREATE TABLE IF NOT EXISTS external_mcp_attachments (
10851085
registry_id uuid NOT NULL,
10861086
name TEXT NOT NULL CHECK (name <> ''),
10871087
slug TEXT NOT NULL CHECK (slug <> ''),
1088+
registry_server_specifier TEXT NOT NULL CHECK (registry_server_specifier <> ''),
10881089

10891090
created_at timestamptz NOT NULL DEFAULT clock_timestamp(),
10901091
updated_at timestamptz NOT NULL DEFAULT clock_timestamp(),
@@ -1111,6 +1112,16 @@ CREATE TABLE IF NOT EXISTS external_mcp_tool_definitions (
11111112
remote_url TEXT NOT NULL CHECK (remote_url <> ''),
11121113
requires_oauth BOOLEAN NOT NULL DEFAULT FALSE,
11131114

1115+
-- OAuth metadata
1116+
-- '2.1' = MCP OAuth with RFC 8414 discovery + dynamic registration
1117+
-- '2.0' = legacy OAuth 2.0 (no AS discovery, requires static client config)
1118+
-- 'none' = no OAuth required
1119+
oauth_version TEXT NOT NULL DEFAULT 'none',
1120+
oauth_authorization_endpoint TEXT,
1121+
oauth_token_endpoint TEXT,
1122+
oauth_registration_endpoint TEXT,
1123+
oauth_scopes_supported TEXT[],
1124+
11141125
created_at timestamptz NOT NULL DEFAULT clock_timestamp(),
11151126
updated_at timestamptz NOT NULL DEFAULT clock_timestamp(),
11161127
deleted_at timestamptz,

server/internal/database/models.go

Lines changed: 22 additions & 16 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
-- Modify "external_mcp_attachments" table
2+
ALTER TABLE "external_mcp_attachments" ADD CONSTRAINT "external_mcp_attachments_registry_server_specifier_check" CHECK (registry_server_specifier <> ''::text), ADD COLUMN "registry_server_specifier" text NOT NULL;
3+
-- Modify "external_mcp_tool_definitions" table
4+
ALTER TABLE "external_mcp_tool_definitions" ADD COLUMN "oauth_version" text NOT NULL DEFAULT 'none', ADD COLUMN "oauth_authorization_endpoint" text NULL, ADD COLUMN "oauth_token_endpoint" text NULL, ADD COLUMN "oauth_registration_endpoint" text NULL, ADD COLUMN "oauth_scopes_supported" text[] NULL;

server/migrations/atlas.sum

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
h1:5OBPKwbPfbmTS4WJ5Czy6jDCz5QfQ5HoFE0S5HfRwrs=
1+
h1:7FbKGgb3xn3/gqQZmdvM93GQG8i3DBIyqCBvoczkO5g=
22
20250502122425_initial-tables.sql h1:Hu3O60/bB4fjZpUay8FzyOjw6vngp087zU+U/wVKn7k=
33
20250502130852_initial-indexes.sql h1:oYbnwi9y9PPTqu7uVbSPSALhCY8XF3rv03nDfG4b7mo=
44
20250502154250_relax-http-security-fields.sql h1:0+OYIDq7IHmx7CP5BChVwfpF2rOSrRDxnqawXio2EVo=
@@ -81,3 +81,4 @@ h1:5OBPKwbPfbmTS4WJ5Czy6jDCz5QfQ5HoFE0S5HfRwrs=
8181
20251211215818_add-mcp-registries-table.sql h1:kHtam7hD4LdWVu1bfV94RLc7YKux50obf2O4FNnetGs=
8282
20251215201744_add-external-mcp-tables.sql h1:sAQggcVLuT+SJYL1doah5Ngc2dWDexn8uFLpIyfh6hA=
8383
20251215231431_project_allowed_origins.sql h1:UF+S/RzRrq+wZjtVbFmJzEWEdmr9o6ThVDRV8CUQuWs=
84+
20251219193631_add-registry-server-specifier-and-oauth-metadata.sql h1:4GBkF2ZPHrqtqagYCvMNU3XLTIqxJYhNvDT9wssdjm8=

0 commit comments

Comments
 (0)