Fix MCP discovery and Accept compatibility#41
Merged
Trailgenic merged 2 commits intoJul 14, 2026
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
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.
Motivation
Description
app/mcp/route.ts: accept missing/empty,*/*, and JSON-only Accept headers, normalize those cases toapplication/json, text/event-stream, pass fully compliant JSON+SSE requests through unchanged, and rejecttext/event-stream-only or unsupported types with HTTP 406; normalization clones the incomingRequestand changes only theAcceptheader. (PreservesContent-Type,Origin,MCP-Protocol-Version, session headers, body and all other request properties and continues to callhandleEllaMcpPost.)https://mcp.ellaentity.ai/inapp/mcp/route.ts, generating discovery values from the canonical registry constants (canonical entity ID, server info, protocol versions, tool names, resource URIs, docs and entity-graph URLs, and a public read-only scope statement) rather than hard-coding values.next.config.tsrewritesmcp.ellaentity.ai/->/mcp?mcpRoot=1, andapp/mcp/route.tstreats hostmcp.ellaentity.ai+ either path/or themcpRoot=1marker as the canonical root discovery request; directGET /mcpremains405withAllow: POST, OPTIONS.1.1.2to1.1.3without changing any ontology/entity data, canonical IDs, tool names, resource URIs, data versions, lastModified values, or privacy boundaries.tests/mcp.test.tsto assert Accept normalization behavior and canonical root discovery and alias behavior.app/mcp/route.ts,lib/ella-registry.ts,next.config.ts,tests/mcp.test.ts(commit on branchcodex/fix-mcp-discovery-and-accept-compatibility, commit idc1ffd68).Testing
git diff --checkwhich passed and committed the changes locally; the repository contains the new tests and route logic but cannot be pushed from this environment due to network/proxy restrictions.npm cibut the environment’s proxy/network prevented a successful dependency install, leaving dependencies incomplete and causing subsequent steps to fail.npm run lintcould not complete due to missing dev dependencies (ESLint modules), therefore lint did not pass in this environment.npm run typecheckfailed locally because required packages and types (e.g.,next, React JSX runtime,zod, MCP SDK types, Node types) were not available after the failednpm ci.npm testcould not complete becausetsxwas not installed in node_modules in this environment; tests were added and are runnable in a normal environment and include assertions for: missing Accept, empty Accept,*/*,application/jsononly,application/json, text/event-stream,text/event-streamalone -> 406,text/plain-> 406, invalidContent-Type-> 415, disallowedOrigin-> 403, preservation of JSON-RPC body and headers, root discovery JSON contents,/mcp405 behavior, and alias POST behavior.npm run buildcould not complete locally becausenextwas not available after dependency install failed.git pushfailed in this environment (CONNECT tunnel failed, response 403) so the branch remains pushed only locally and GitHub Actions CI / verify was not run; therefore no Draft PR URL is available from this run.If CI/network access is available in your environment, run the verification sequence:
npm ci,npm run lint,npm run typecheck,npm test,npm run build, and the tests added intests/mcp.test.tsshould validate the Accept normalization and discovery behavior; the change preserves all canonical registry values, tools, resources, protocols, schemas, provenance, and privacy boundaries (only the server version string was incremented to1.1.3).Codex Task