feat(mcp): mount /mcp Streamable HTTP endpoint

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
root
2026-06-04 20:09:30 +10:00
parent 0b29b8c2f3
commit 6041f845e9
2 changed files with 44 additions and 0 deletions

View File

@@ -9,6 +9,8 @@ import { router as ingestRouter } from './lib/api/routes/ingest.js';
import { router as iconsRouter } from './lib/api/routes/icons.js';
import { startCron } from './lib/cron/index.js';
import { seedFromConfig } from './lib/health/registry.js';
import { mcpAuth } from './lib/api/middleware/mcp_auth.js';
import { handleMcp } from './lib/mcp/http.js';
const VERSION = '2.0.0-alpha.13';
@@ -41,6 +43,9 @@ export function createApp() {
mountApi(app);
// MCP Streamable HTTP for external agents (read + suggest-only, space-scoped).
app.all('/mcp', mcpAuth, handleMcp);
app.use((_req, res) => res.status(404).json({ error: { code: 'not_found' } }));
app.use((err, _req, res, _next) => {