Repository navigation
feat(canary): remote MCP server backed by the REST API - #145
Merged
Merged
Conversation
biersoeckli
marked this pull request as ready for review
October 3, 2026 12:33
Owner
|
relates to #97 |
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.
Warning
Canary feature. The QuickStack MCP server is experimental. Its settings are only visible when the canary update channel is enabled (
Settings → Platform → Updates → canary channel), and the endpoint is served only when canary and the MCP toggle are on. The server is disabled by default and must be explicitly enabled. Operations can change in future versions.Summary
Adds a remote MCP server for QuickStack, exposed at
/api/mcpand gated as a canary feature.2026-07-28via the stable v2 SDK@modelcontextprotocol/server, mounted as a web-standard handler in the Next.js app (no custom-server change).operationId, summary, description, tags, and theparams/query/body/200response schemas. New REST routes appear automatically.search_operations- discover operations on demand (searchterm +detaillevelname/summary/full), reportingreadOnlyand the tool to call.execute_read_operation- read-only operations (GET/HEAD), annotatedreadOnlyHint: true.execute_operation- mutating operations, annotateddestructiveHint: true, so hosts can ask for confirmation.v1Api.handle(request), so parsing, validation, Shared Authorization Checks, the central error mapper and all business logic are reused. No schema or handler duplication.getIdentityFromApiKeyHeader); the bearer credential is forwarded to the internal request.OriginMCP clients pass.Canary gating
/settings/developer/mcpand its sidebar entry are hidden unlessuseCanaryChannelis on; direct URL access returnsnotFound()./api/mcprequires canary and the MCP toggle; otherwise404.mcpServerEnableddefaults tofalse; the server must be explicitly enabled in the settings page.Files
src/server/mcp/operation-registry.ts- route introspection to operation descriptors (incl.readOnly).src/server/mcp/operation-executor.ts- builds and dispatches the internal request.src/server/mcp/mcp-auth.ts- REST API Key auth resolver.src/server/mcp/mcp-server.factory.ts- MCP server, the three tools, and read/write routing.src/server/mcp/mcp-handler.ts- host/origin/auth gate + SDK handler.src/app/api/mcp/route.ts- Next.js mount, canary + enablement gate.src/app/settings/developer/mcp/- settings page (toggle, warning, client guides).package.json/yarn.lock- add@modelcontextprotocol/server.Testing
src/server/mcp/mcp-handler.unit.spec.ts(19 tests) drives the handler seam with a fixture Elysia app and injected auth resolver: tool listing, search/filter/detail levels, read/write classification/misrouting, permission and auth failures, origin handling, execution, argument mapping and error mapping.src/app/api/mcp/route.unit.spec.ts(3 tests) covers the canary + enablement gate.src/__tests__/integration/server/mcp/mcp-handler.integration.spec.tsruns against the realv1Apiwith a real REST API Key and the existing Prisma test harness.npx tsc --noEmitclean for new code. One pre-existing unrelated error remains insrc/frontend/utils/format.utils.unit.spec.ts.yarn lintclean.