Allow public exposure for internal-sourced MCP servers, add custom endpoint path - #236
Merged
Merged
Conversation
…dpoint path The internal-source public-exposure gate (assertPublicExposureAllowed) blocked publishing tenant-internal-data MCP servers/composites on a public URL. Remove it — publishing that data publicly is now an intentional, supported choice — and replace the hard block with an orange warning in the create form and on the server's overview page whenever an internal-sourced server is set to public access. Also let a server's public endpoint path (endpointSlug) be a caller-chosen value instead of only a random 16-char slug: settable at create time and renamable afterwards, validated for format/length and uniqueness tenant-wide.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
An MCP server sourced from an internal Console capability (
sourceType: 'internal', or a composite with such a member) could not be exposed on a public, unauthenticated URL —assertPublicExposureAllowedrejected the save. That restriction is removed: publishing that data publicly is now an intentional, supported choice, surfaced with a warning instead of a hard block. Separately, a server's public endpoint path (endpointSlug) can now be a caller-chosen value instead of only a random 16-char slug.Changes
assertPublicExposureAllowed(composite.ts) and its three call sites inmcpService.ts(create/composite-create/update).isInternalSourcedis kept — it now only drives the UI warning, no longer gates a write.public-mcp.ts(resolvePublicServer) that blocked serving an internal-sourced server even if one were saved as public.endpointSlug?: stringtoCreateMcpServerInput/UpdateMcpServerInput. A newresolveEndpointSluginmcpService.tsnormalizes the caller's value (slugify, 8–80 chars — the 8-char floor matches whatpublic-mcp.tsalready requires and whata2aExposure.tsuses for agent slugs), checks tenant-wide uniqueness viafindMcpServerByEndpointSlug, and errors (never silently de-duplicates, unlikekey) if it's taken. Omitting it keeps today's random-slug behavior.plugins/mcp.ts: parsebody.endpointSlugon create/update; map the new service errors to 400 (bad format) / 409 (path taken) instead of falling through to 500.CreateMcpModal.tsx: removed the JS-side auto-reset that flipped a composite back to "API token required" when it picked up an internal member while public was selected; added an orange warningAlert(now covers both plaininternalsourceType and composite-with-internal-member, previously only the latter) and a "Custom path"TextInputshown when access mode is public.[id]/page.tsx(server detail page): the previously read-only "Endpoint Slug" panel is now inline-editable (mirrors the existing "Server Key" edit pattern), and the same orange warning is shown on the Overview tab when an internal-sourced server is currently public.Validation
npm run lint(0 errors; 1 pre-existing unrelated warning inCreateMcpModal.tsx)npm run test(full suite; all non-MongoDB-backed tests pass — the MongoDB-parity suites fail in this sandbox becausemongodb-memory-servercan't download its binary without network access, unrelated to this change)npm run buildnpm run docs:build(no docs changed)Release Notes
Requested via chat: "Bu kuralı kaldıralım ek olarak public olanda da özel path verebilmemiz lazım. Amaç zaten içerideki datayı dışarı açmak. Ama uyarı çıksın ekranda."
Generated by Claude Code