This directory contains the MCP server handler for Air Agent.
The MCP server is optional and only available when running in server mode (not static export).
The MCP server can be enabled by creating the API route:
-
Create the directory:
mkdir -p app/api/mcp
-
Create
app/api/mcp/route.ts:import { handleMcpRequest } from "@/server/mcp/handler" export const GET = handleMcpRequest export const POST = handleMcpRequest export const DELETE = handleMcpRequest
-
Run in development mode:
npm run dev
The MCP server will be available at http://localhost:3000/api/mcp
To deploy with MCP server support:
-
Ensure the
app/api/mcp/route.tsfile exists (as shown above) -
Remove or comment out
output: 'export'fromnext.config.ts -
Deploy to a Node.js platform (Vercel, Netlify, etc.)
By default, the app builds for static export (GitHub Pages, etc.) and the MCP server is not available.
The handler code exists in server/mcp/handler.ts but is not included in the build unless you create the API route as described above.
For complete MCP server documentation, see MCP_SERVER.md