# Flisk MCP Resources: Give Your Agents Tools That Run Next to Your Services

> Source: <https://dev.to/flisk/flisk-mcp-resources-give-your-agents-tools-that-run-next-to-your-services-4gdk>
> Published: 2026-10-24 11:06:22+00:00

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.

```
flisk resource docs-mcp --type mcp --stack shop
flisk up shop
```

The 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.

The 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.

It is stateless on purpose. Each request gets a fresh server instance, so there is no session to lose when the container restarts.

Through 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`.

You can check it with a raw JSON-RPC call. The `accept` header must list both `application/json` and `text/event-stream`:

```
curl -s -X POST http://api.shop.localhost/api/docs-mcp/mcp \
  -H 'content-type: application/json' -H 'accept: application/json, text/event-stream' \
  -d '{"jsonrpc":"2.0","id":1,"method":"tools/list"}'
```

Tools 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.

The 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.

The 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.

A 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.

An `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.
