Skip to content

Migrate MCP server from ECS/Docker to Vercel serverless#836

Merged
gsharp-aai merged 9 commits intomainfrom
migrate-mcp-to-vercel
Mar 27, 2026
Merged

Migrate MCP server from ECS/Docker to Vercel serverless#836
gsharp-aai merged 9 commits intomainfrom
migrate-mcp-to-vercel

Conversation

@gsharp-aai
Copy link
Copy Markdown
Contributor

@gsharp-aai gsharp-aai commented Mar 25, 2026

Summary

Migrates the docs MCP server from an ECS/Docker deployment to a Vercel serverless function using the mcp-handler package. This eliminates the need for Docker, ECR, ECS, Terraform, and IAM/OIDC configuration.

Per team discussion, Vercel is the preferred hosting for this type of simple stateless service.

What changed

Added:

  • app/api/mcp/route.ts — Vercel serverless entry point using mcp-handler
  • vercel.json — Vercel deployment config
  • src/log.ts — standalone logging utility

Removed:

  • Dockerfile — no longer needed
  • .dockerignore — no longer needed
  • src/index.ts — Express server, session management, rate limiting (all handled by Vercel/mcp-handler)

Modified:

  • src/server.ts — data loaded via JSON imports (bundled at deploy time) instead of filesystem reads
  • src/tools/*.ts — log import path updated
  • package.jsonexpress replaced with mcp-handler
  • tsconfig.json — modernized (ES2024, NodeNext, stricter checks)
  • publish-docs.yml — ECS deploy replaced with vercel deploy --prod
  • README.md — updated for Vercel

Net: 291 lines added, 509 deleted.

How it works

The doc content (~150KB of JSON) is bundled directly into the serverless function at deploy time. No filesystem, no Docker image, no container registry. Same tool logic, same search index — just a simpler delivery mechanism.

CI/CD

On push to main: npm run build:contentnpm run buildvercel deploy --prod

Requires 3 GitHub secrets: VERCEL_TOKEN, VERCEL_ORG_ID, VERCEL_PROJECT_ID

Testing

  • npm test — 8/8 smoke tests pass (search, list sections, get pages, API reference)
  • Preview deployment available for testing before merge

Next steps

  • Set up Vercel project and add GitHub secrets
  • Test preview deployment
  • Terraform cleanup (remove ECS resources) in separate PR

Open with Devin

@github-actions
Copy link
Copy Markdown

@github-actions
Copy link
Copy Markdown

@github-actions
Copy link
Copy Markdown

@github-actions
Copy link
Copy Markdown

@github-actions
Copy link
Copy Markdown

@github-actions
Copy link
Copy Markdown

@github-actions
Copy link
Copy Markdown

devin-ai-integration[bot]

This comment was marked as resolved.

@github-actions
Copy link
Copy Markdown

@gsharp-aai gsharp-aai self-assigned this Mar 27, 2026
@dlange-aai dlange-aai self-requested a review March 27, 2026 16:56
@dlange-aai
Copy link
Copy Markdown
Contributor

Just did a review with claude and two things felt worth noting:

Add npm test to CI before deploying

  • The smoke tests validate all 4 MCP tools work end-to-end using InMemoryTransport — they catch broken tool registrations, bad JSON imports, and search index issues. Right now those tests only run locally. If the ingest step produces malformed JSON or a code change breaks a tool handler, the CI pipeline would deploy a broken server to prod without catching it.

Add --yes to npx vercel deploy

  • In CI (non-TTY), npx vercel deploy can hang or fail if it encounters any interactive prompt — e.g., first run before the project is linked, or Vercel CLI version mismatch prompts. The VERCEL_ORG_ID/VERCEL_PROJECT_ID env vars should auto-link, but --yes is a defensive one-character change that guarantees no prompt blocks the pipeline. Without it, a CI run could silently hang until timeout if Vercel's CLI behavior changes.

It's working well!

Screenshot 2026-03-27 at 1 24 17 PM

- Replace Express server with Vercel mcp-handler serverless function
- Bundle doc data as JSON imports instead of filesystem reads
- Extract log utility to standalone module
- Delete Dockerfile, .dockerignore, Express entry point
- Update CI/CD from ECS deploy to Vercel deploy
- Modernize tsconfig (ES2024, NodeNext, strict checks)
- Update README for Vercel deployment
- Switch to app/api/[transport]/route.ts (dynamic transport segment)
- Add Next.js framework deps (next, react, react-dom)
- Set tsconfig to bundler module resolution (webpack compat)
- Remove .js extensions from local imports (webpack convention)
- Keep .js on @modelcontextprotocol/sdk imports (actual .js in node_modules)
- Set vercel.json framework to nextjs with next build command
- Add next.config.js, next-env.d.ts, .next/ to gitignore
- Add security section to README documenting public/read-only posture
- Generate version.json during ingest (git SHA, timestamp, content counts)
- Expose version metadata as assemblyai://server/version MCP resource
@gsharp-aai gsharp-aai force-pushed the migrate-mcp-to-vercel branch from a2911ee to 50120a3 Compare March 27, 2026 17:30
@github-actions
Copy link
Copy Markdown

@gsharp-aai gsharp-aai merged commit aa278be into main Mar 27, 2026
4 checks passed
@gsharp-aai gsharp-aai deleted the migrate-mcp-to-vercel branch March 27, 2026 17:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants