feat(mgmt): add MCP server management API - #793
Conversation
Adds a new MCPServer management manager covering the managementservice MCP
endpoints the Go SDK was missing — full server lifecycle plus client management:
- Servers: Create, Update, Delete, DeleteBatch, Load, LoadAll
- Clients: CreateClient, UpdateClient, DeleteClient, DeleteClients, LoadClient,
GetClientSecret, RotateClientSecret, SearchClients
Includes the MCPServer / MCPServerClient types and their nested config types,
route wiring, manager registration, mock implementation, README section, and
unit tests. The OIDC dynamic-client-registration protocol endpoint
(mcp/client/{projectId}/{mcpServerId}/register) is intentionally excluded as it
is an OAuth/OIDC protocol endpoint rather than a management CRUD operation.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
|
🐕 Review complete — View session on Shuni Portal 🐾 |
🐕 Suggested ReviewersThe reviewers have been selected based on recent modifications to the relevant files, ensuring they possess current knowledge of the code areas involved. The focus was on balancing breadth across different parts of the feature (API, internal management, SDK, tests) with depth from those actively maintaining related files.
Suggested by Shuni based on git history and PR context. Names are not @-mentioned to avoid notifying anyone — request a review from whoever fits best. |
There was a problem hiding this comment.
🐕 Shuni's Review
Adds a new MCPServer management API — 14 server/client CRUD endpoints across types, client, interface, manager, mock, and tests.
No issues found — good bones! 🦴
Clean, additive, and consistent: the mock fully matches the interface, validation guards every required arg, and all 28 tests cover both success and error paths. Woof!
Fixes descope/etc#16608
View workflow run
Done. Committed
feat(mgmt): add MCP server management API(7bb86bb) on this fresh branch.Larger slice — new MCPServer manager (14 endpoints)
Re-diffed the live spec against the current SDK (prior PRs #789/#790/#791 merged → 78 still missing) and implemented the single largest coherent feature area: the MCP server management API.
Create,Update,Delete,DeleteBatch,Load,LoadAllCreateClient,UpdateClient,DeleteClient,DeleteClients,LoadClient,GetClientSecret,RotateClientSecret,SearchClientsThis is the biggest slice so far — a brand-new manager with deeply-nested config types, touching the full stack:
types.go—MCPServer,MCPServerClient,MCPServerClientRequest,MCPServerClientCreateResponse,MCPServerClientSearchOptions, plus nested config types (MCPServerDynamicClientRegistration,MCPApprovedScopes/MCPApplicationScope,MCPSessionSettings,MCPCIMDSettings/MCPCIMDDomainPolicies/MCPCIMDDomainPolicy,MCPSortField)api/client.go— 14 endpoint fields + init + route methodssdk/mgmt.go— newMCPServerinterface +Management.MCPServer()accessorinternal/mgmt/mcpserver.go— manager implementationinternal/mgmt/mgmt.go— registration + accessortests/mocks/mgmt/managementmock.go—MockMCPServer+ embeddingmcpserver_test.go— 28 new testsREADME.md— new "Manage MCP Servers" section + TOC entryAll quality checks pass;
go.mod/go.sumunchanged.Scope note
I implemented the 14 server/client management CRUD endpoints and deliberately excluded the 15th MCP path,
mcp/client/{projectId}/{mcpServerId}/register— that's an OIDC dynamic-client-registration protocol endpoint (path params, dozens of OIDC request/response schemas), not a management operation, consistent with how the SDK omits other protocol endpoints.Remaining ~64 gaps are other net-new areas, each best as its own PR: resource + resourcepolicy (19), FGA backups/AuthZEN (9), policies/rule (5), localization (4), project export/import + async clone (4), SSO custom-attributes/provider-ids (4), tenant admin-links (4), plus singletons (
accesskey/import,user/passkeys/import,user/update/impersonationConsent,widget/list,authz/re/deleteresourcesrelations,flow/*). A couple remain false positives (mgmt/list/{id},mgmt/outbound/app/{id}— path-param GET variants already covered via query params).Created by Shuni 🐕