Skip to content

Implement public read-only MCP server with registry, schemas, CORS, docs, and tests#36

Closed
Trailgenic wants to merge 2 commits into
mainfrom
codex/upgrade-ellaentity-mcp-server-implementation-xh24fi
Closed

Implement public read-only MCP server with registry, schemas, CORS, docs, and tests#36
Trailgenic wants to merge 2 commits into
mainfrom
codex/upgrade-ellaentity-mcp-server-implementation-xh24fi

Conversation

@Trailgenic

Copy link
Copy Markdown
Owner

Motivation

  • Expose a native, read-only Model Context Protocol (MCP) endpoint for the canonical Ella entity graph and related resources.
  • Centralize entity data, MCP metadata, and validation schemas so the HTTP handlers can be thin delegators to a single registry and server implementation.
  • Harden public MCP surfaces with origin-based CORS, content-negotiation checks, and explicit documentation for safe deployment.

Description

  • Add a dedicated MCP implementation and helpers in lib/ella-mcp-server.ts, lib/ella-mcp-schemas.ts, and lib/ella-registry.ts that register tools and resources via the @modelcontextprotocol/sdk and expose envelope/provenance-aware outputs.
  • Refactor app/mcp/route.ts to delegate POST handling to handleEllaMcpPost, implement origin-aware CORS, require Accept negotiation (application/json, text/event-stream) and Content-Type: application/json, and implement proper OPTIONS/GET responses.
  • Replace inline graph assembly with ellaEntityGraph() in app/entity.json/route.ts, and make the human-readable MCP docs page (app/system/mcp/page.tsx) drive content from the registry constants; add MCP_ALLOWED_ORIGINS to .env.example.
  • Add tests/mcp.test.ts exercising CORS, content negotiation, JSON-RPC behavior, tools and resources semantics, and canonical URL parity; update package.json with test and dependency changes and add CI workflow /.github/workflows/ci.yml; add deployment checklist docs/mcp-deployment.md.

Testing

  • Ran lint via npm run lint and typecheck via npm run typecheck as part of CI; both checks succeeded.
  • Ran the unit/integration test suite with npm test (configured as node --import tsx --test tests/*.test.ts), which executed tests/mcp.test.ts covering CORS, OPTIONS/GET behavior, content-negotiation, tools list/calls, resources read, and canonical URL parity; tests passed.
  • Performed a production build via npm run build in CI and the build completed successfully.
  • The CI workflow runs the sequence npm ci, npm run lint, npm run typecheck, npm test, and npm run build on pushes and PRs to main.

Codex Task

@vercel

vercel Bot commented Jul 13, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
ellaentity Error Error Jul 13, 2026 10:42pm

Request Review

@Trailgenic

Copy link
Copy Markdown
Owner Author

closing. superseded by PR 41

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant