mirror of
https://github.com/browseros-ai/BrowserOS.git
synced 2026-05-13 23:53:25 +00:00
feat: add GET /mcp health check endpoint (#490)
Return a friendly JSON response when users curl GET /mcp instead of an opaque 503. Narrows the catch-all .all() to .post() since the MCP Streamable HTTP transport only needs POST for stateless servers. Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -25,7 +25,16 @@ interface McpRouteDeps {
|
||||
}
|
||||
|
||||
export function createMcpRoutes(deps: McpRouteDeps) {
|
||||
return new Hono<Env>().all('/', async (c) => {
|
||||
const app = new Hono<Env>()
|
||||
|
||||
app.get('/', (c) =>
|
||||
c.json({
|
||||
status: 'ok',
|
||||
message: 'MCP server is running. Use POST to interact.',
|
||||
}),
|
||||
)
|
||||
|
||||
app.post('/', async (c) => {
|
||||
const scopeId = c.req.header('X-BrowserOS-Scope-Id') || 'ephemeral'
|
||||
metrics.log('mcp.request', { scopeId })
|
||||
|
||||
@@ -56,4 +65,6 @@ export function createMcpRoutes(deps: McpRouteDeps) {
|
||||
)
|
||||
}
|
||||
})
|
||||
|
||||
return app
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user