{"slug": "flisk-mcp-resources-give-your-agents-tools-that-run-next-to-your-services", "title": "Flisk MCP Resources: Give Your Agents Tools That Run Next to Your Services", "summary": "Flisk introduced an 'mcp' resource type that scaffolds a stateless Model Context Protocol server running inside a project's local stack, built by Docker, started with 'flisk up', routed through Traefik, and gated on a /health route. The generated server, written in TypeScript on the MCP SDK with Streamable HTTP transport, registers a placeholder 'echo' tool and validates arguments with zod schemas so bad input returns an MCP error instead of crashing. The scaffold ships without authentication and is intended only for local development behind *.localhost.", "body_md": "Agents are only as useful as the tools they can call. An `mcp` resource in Flisk is a Model Context Protocol server that runs in the same local stack as your services. Docker builds it, `flisk up` starts it, Traefik routes to it, and its health route gates startup order.\n\n```\nflisk resource docs-mcp --type mcp --stack shop\nflisk up shop\n```\n\nThe scaffold writes a `service.json` with `appType: \"mcp\"`, a port from 4000 to 5999, and `/health` as the health path. It has no framework or language setting and no backend features such as Prisma. The server source lives in `src/index.ts`, built on the MCP TypeScript SDK with the Streamable HTTP transport. It registers one placeholder tool, `echo`, so you can see the shape before you add your own.\n\nThe server answers three paths. `POST /mcp` is the endpoint clients use. `GET /mcp` returns `405` with `Allow: POST`, because the scaffold is stateless and does not open server-to-client streams. `GET /health` returns a small JSON status, which Traefik uses.\n\nIt is stateless on purpose. Each request gets a fresh server instance, so there is no session to lose when the container restarts.\n\nThrough Traefik, the resource is routed like a backend, with the name prefix stripped. A resource called `docs-mcp` in a project called `shop` is at `http://api.shop.localhost/api/docs-mcp/mcp`.\n\nYou can check it with a raw JSON-RPC call. The `accept` header must list both `application/json` and `text/event-stream`:\n\n```\ncurl -s -X POST http://api.shop.localhost/api/docs-mcp/mcp \\\n  -H 'content-type: application/json' -H 'accept: application/json, text/event-stream' \\\n  -d '{\"jsonrpc\":\"2.0\",\"id\":1,\"method\":\"tools/list\"}'\n```\n\nTools are registered in `buildServer()` in `src/index.ts`, with the SDK's `registerTool`. Arguments are described with zod schemas. Invalid arguments come back as an MCP error result rather than a crash, which keeps an agent's mistake from taking the server down.\n\nThe scaffold has no authentication. The docs say it is meant for local development behind `*.localhost`. Do not expose it beyond your machine without adding auth, and do not give it tools that change production data.\n\nThe tools you add are your code. A tool that runs a query can run any query you let it run, so scope what the tool can reach.\n\nA tool that lives in the same stack as the database it queries is tested under the same conditions as the rest of the system: the same network, the same start order, and the same readiness checks. A tool that runs as a loose script outside the stack is harder to keep honest.\n\nAn `mcp` resource is a stateless MCP server in your stack, reached through the gateway, with a health route and a placeholder tool. Add tools in `buildServer()`, validate their arguments, and keep the server local until you have added authentication.", "url": "https://wpnews.pro/news/flisk-mcp-resources-give-your-agents-tools-that-run-next-to-your-services", "canonical_source": "https://dev.to/flisk/flisk-mcp-resources-give-your-agents-tools-that-run-next-to-your-services-4gdk", "published_at": "2026-10-24 11:06:22+00:00", "updated_at": "2026-10-24 11:13:47.354200+00:00", "lang": "en", "topics": ["ai-agents", "agent-protocols", "developer-tools", "ai-tools"], "entities": ["Flisk", "Model Context Protocol", "Docker", "Traefik", "TypeScript", "zod"], "also_reported_by": [], "alternates": {"html": "https://wpnews.pro/news/flisk-mcp-resources-give-your-agents-tools-that-run-next-to-your-services", "markdown": "https://wpnews.pro/news/flisk-mcp-resources-give-your-agents-tools-that-run-next-to-your-services.md", "text": "https://wpnews.pro/news/flisk-mcp-resources-give-your-agents-tools-that-run-next-to-your-services.txt", "jsonld": "https://wpnews.pro/news/flisk-mcp-resources-give-your-agents-tools-that-run-next-to-your-services.jsonld"}}