deploy test server

This commit is contained in:
Fredrik Jensen 2025-12-06 12:12:00 +01:00
parent 70fe3830b5
commit 11d1a68674
2 changed files with 26 additions and 10 deletions

View File

@ -152,7 +152,9 @@ const handleSessionRequest = async (req: express.Request, res: express.Response)
app.get('/mcp', handleSessionRequest);
app.delete('/mcp', handleSessionRequest);
app.listen(port, () => {
// Only start server when running locally (not on Vercel)
if (!process.env.VERCEL) {
app.listen(port, () => {
console.log(`\n🚀 MCP UI Demo Server`);
console.log(`━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━`);
console.log(`📡 MCP endpoint: http://localhost:${port}/mcp`);
@ -161,4 +163,8 @@ app.listen(port, () => {
console.log(` • stock_portfolio - Complex UI with inputSchema params`);
console.log(` • get_stock_price - Data-only, no UI`);
console.log(`━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\n`);
});
});
}
// Export for Vercel
export default app;

10
vercel.json Normal file
View File

@ -0,0 +1,10 @@
{
"version": 2,
"buildCommand": "npm run build",
"rewrites": [
{
"source": "/(.*)",
"destination": "/packages/demo-server/index.ts"
}
]
}