Skip to main content

Claude Code Plugin

flAPI ships a Claude Code plugin from its own repository. With it installed, Claude knows how to set up a flAPI project, write REST endpoints and MCP tools, design and tune DuckLake caches, and secure, test, deploy and operate a server. It checks its own edits against your config, and it can manage a running server through flAPI's MCP config tools.

Install​

In Claude Code:

/plugin marketplace add DataZooDE/flapi
/plugin install flapi@flapi

The plugin needs the flapi server binary for validation and the flapii CLI for a running server. pip install flapi-io installs both.

To update it, run /plugin marketplace update flapi. The plugin version follows flAPI's release version (v26.11.25 at the time of writing), so use the plugin release that matches your server.

Skills​

Claude loads a skill when your request matches it. You do not have to invoke one.

PhaseSkillCovers
Setupflapi-setupInstalling, flapii project init, flapi.yaml, connections, the environment-variable whitelist, DuckDB extensions, validation
Developflapi-restEndpoint YAML, parameters and validators, Mustache SQL templates, pagination, write endpoints, YAML includes, rate limits
Developflapi-mcpMCP tools, resources and prompts, descriptions an agent can act on, async tasks, one endpoint for REST and MCP, connecting clients
Developflapi-authBasic, bearer JWT, OIDC with provider presets, roles, MCP OAuth, the config-service token, CORS
Developflapi-cache-designFull, append and merge caches, writing the populate SQL, cursors and watermarks, deletes, warm-up, write-through, replicas, prebuilt caches, time travel
Developflapi-cache-tuningMeasuring refresh time and cutting it down: predicate pushdown, incremental loads, schedules, inlining, compaction, retention
Developflapi-testingTemplate expansion, --validate-config, Tavern REST tests, MCP tests, CI
Developflapi-live-configThe config service, flapii, the flapi_* MCP config tools, hot reload
Deployflapi-deployflapi pack single binaries, Docker, Cloud Run / serverless, secrets, offline extensions
Operateflapi-operateHealth and readiness, runtime metrics, logs, tracing, cache operations, troubleshooting

Slash commands​

CommandDoes
/flapi:initScaffolds a project from a description of your data, then validates and starts it
/flapi:new-endpointCreates the YAML, SQL, validators, an optional MCP tool and a test, then tries them
/flapi:add-cachePicks a cache mode, writes the populate SQL, refreshes, measures and tunes
/flapi:auth-setupConfigures authentication and roles, and proves the 401/403/200 paths with curl
/flapi:deploy-checkRuns a pre-deployment checklist and builds the artifact
/flapi:diagnoseGoes from an error to a root cause and a verified fix
/flapi:metricsSummarizes slow or failing endpoints, rejections and slow or stale caches

MCP server entry​

The plugin registers a flapi MCP server at $FLAPI_URL/mcp/jsonrpc (default http://localhost:8080), using Claude Code's HTTP transport. It sends two headers:

  • X-Config-Token: $FLAPI_CONFIG_SERVICE_TOKEN, for the flapi_* config tools;
  • Authorization: Bearer $FLAPI_MCP_TOKEN, for a server with mcp.auth on. With FLAPI_MCP_TOKEN unset the header is an empty Bearer , which a server without mcp.auth ignores.

Both variables default to empty, so the server entry registers even when neither is set. Claude then sees your endpoints as MCP tools. If the server runs with --config-service, Claude also sees the flapi_* config tools: it can list and edit endpoints, expand templates, refresh caches and read flapi_get_metrics. Every flapi_* call needs the config-service token. Endpoint changes show up in tools/list at once, without a restart.

export FLAPI_CONFIG_SERVICE_TOKEN=$(openssl rand -hex 32)
export FLAPI_MCP_TOKEN=... # only when mcp.auth is enabled
flapi -c flapi.yaml --config-service --config-service-token "$FLAPI_CONFIG_SERVICE_TOKEN"
# then start Claude Code in the same shell

For mcp.auth.type: bearer, FLAPI_MCP_TOKEN is an HS256 JWT signed with jwt-secret, with sub, an iss equal to jwt-issuer and a roles claim that matches the tools' allowed-roles; for type: oidc it is an access token from your identity provider. A server with type: basic needs an Authorization: Basic ... header, which the plugin entry cannot send: register that server yourself with claude mcp add --transport http ... --header "Authorization: Basic <base64 user:pass>" --header "X-Config-Token: $FLAPI_CONFIG_SERVICE_TOKEN".

Hook: validate, hot-reload, check​

After Claude edits a .yaml, .yml or .sql file inside a flAPI project (a directory with a flapi.yaml in it or above it, or inside the template.path of the config FLAPI_CONFIG names), the plugin's hook:

  1. Validates: runs flapi -c <flapi.yaml> --validate-config, if flapi is on PATH or FLAPI_BIN is set. Errors go back to Claude, which fixes them.
  2. Reloads: if validation passed and FLAPI_CONFIG_SERVICE_TOKEN is set, reloads the edited endpoint file on the running server (POST /api/v1/_config/endpoints/reload-file). For a .sql file, every endpoint YAML that uses it is reloaded. A file that no longer loads is rejected with its reason, and the endpoint keeps its previous configuration.
  3. Checks the templates without running them (template/expand?validate_only=1): the serving template with no parameters and with a sample value for every typed field, and a cache template-file with the live watermark. Parse and bind errors (an unknown column, a typo in MERGE) go back to Claude.

Before it sends the token, the hook checks that the server at FLAPI_URL serves this project (its project-name and template.path); otherwise it sends nothing there. It does not reload into a packed binary, or into a server started before flapi.yaml changed its ducklake, auth or mcp settings. When a shell command deletes an endpoint YAML, the hook unloads the endpoints it declared. If something is missing (no binary, no project, no token, no server), the hook does nothing. It never blocks an edit.

VariableDefaultUsed by
FLAPI_URLhttp://localhost:8080MCP server, hook, flapii (when FLAPI_BASE_URL is unset)
FLAPI_CONFIG_SERVICE_TOKEN—MCP server (X-Config-Token), hook, flapii
FLAPI_MCP_TOKEN—MCP server (Authorization: Bearer, for mcp.auth)
FLAPI_BINflapi on PATHhook
FLAPI_CONFIGnearest flapi.yamlhook

Working on the plugin​

The plugin lives in the flAPI repository under plugins/flapi/. To try local changes without installing:

claude --plugin-dir ./plugins/flapi

make check-skills checks every skill against the real code and binaries (config keys against the parser, flapi/flapii options against --help, cache template variables, the version stamp) and runs every tagged example through flapi --validate-config and a live server. CI runs the same check.

🍪 Cookie Settings