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,13 +152,19 @@ const handleSessionRequest = async (req: express.Request, res: express.Response)
app.get('/mcp', handleSessionRequest); app.get('/mcp', handleSessionRequest);
app.delete('/mcp', handleSessionRequest); app.delete('/mcp', handleSessionRequest);
app.listen(port, () => { // Only start server when running locally (not on Vercel)
console.log(`\n🚀 MCP UI Demo Server`); if (!process.env.VERCEL) {
console.log(`━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━`); app.listen(port, () => {
console.log(`📡 MCP endpoint: http://localhost:${port}/mcp`); console.log(`\n🚀 MCP UI Demo Server`);
console.log(`\n📦 Available tools:`); console.log(`━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━`);
console.log(` • weather_dashboard - Simple UI, no params`); console.log(`📡 MCP endpoint: http://localhost:${port}/mcp`);
console.log(` • stock_portfolio - Complex UI with inputSchema params`); console.log(`\n📦 Available tools:`);
console.log(` • get_stock_price - Data-only, no UI`); console.log(` • weather_dashboard - Simple UI, no params`);
console.log(`━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\n`); 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"
}
]
}