You want a host to call your tools, a file, and a prompt. This app serves all three over MCP. The page imports the server object, so the tool name, the resource URI, and the prompt arguments stay typed. The page calls the server in the same process. A host calls it over HTTP at /api/mcp.
- From the repo root, run
pnpm install. - Run
pnpm --filter mcp-server dev. - Open http://localhost:3100.
- Click Call the server.
The forecast, the city guide, and the trip brief come from the MCP server.
The server is src/mcp-server.ts. The route is src/routes/api.mcp.ts. The page is src/routes/index.tsx.