Add Dockerfile and Vercel integration for MCP server

 Implement x402 payment handling in WebFetchTool
📝 Refactor count increment logic in X402 payment tracker
 Introduce feature flag management in Bun build
 Create macro for package versioning and issue reporting
 Add preload script for Bun bundler features
This commit is contained in:
nirholas
2026-03-31 10:45:43 +00:00
parent cf9b405372
commit c0b205208d
14 changed files with 461 additions and 555 deletions

21
mcp-server/api/index.ts Normal file
View File

@@ -0,0 +1,21 @@
/**
* Vercel serverless function — proxies requests to the Express HTTP server.
*
* This file re-exports the Express app as a Vercel serverless handler.
* Vercel automatically routes /api/* to this function.
*
* Deploy:
* cd mcp-server && npx vercel
*
* Environment variables (set in Vercel dashboard):
* CLAUDE_CODE_SRC_ROOT — absolute path where src/ is deployed
* MCP_API_KEY — optional bearer token for auth
*
* NOTE: Vercel serverless functions are stateless, so the Streamable HTTP
* transport (which requires sessions) won't persist across invocations.
* For production use with session-based MCP clients, prefer Railway/Render/VPS.
* The legacy SSE transport and stateless tool calls work fine on Vercel.
*/
export { app as default } from "./vercelApp.js";