feat: add MCP server with streamable HTTP transport at /mcp

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-04-03 13:38:18 +02:00
parent 8919829167
commit 6f51432d42
2 changed files with 177 additions and 0 deletions

View File

@@ -1,6 +1,7 @@
import { Hono } from "hono";
import { serveStatic } from "hono/bun";
import { seedDefaults } from "../db/seed.ts";
import { mcpRoutes } from "./mcp/index.ts";
import { requireAuth } from "./middleware/auth.ts";
import { authRoutes } from "./routes/auth.ts";
import { categoryRoutes } from "./routes/categories.ts";
@@ -41,6 +42,11 @@ app.route("/api/settings", settingsRoutes);
app.route("/api/threads", threadRoutes);
app.route("/api/setups", setupRoutes);
// MCP server (conditionally mounted)
if (process.env.GEARBOX_MCP !== "false") {
app.route("/mcp", mcpRoutes);
}
// Serve uploaded images
app.use("/uploads/*", serveStatic({ root: "./" }));