staqlydocs

Overview

Pick the right way to connect your coding agent, n8n or scripts to staqly.

Edit on GitHub

To save output in staqly, an agent or automation has to talk to it. Coding agents such as Claude Code, Codex and OpenCode use MCP (Model Context Protocol, the standard way to give an AI agent tools). Automations and scripts use the REST API. Both go through the same services and the same permission checks, so they can do the same things.

Choose your client

The staqly CLI can also print the right MCP setup for you: staqly mcp config claude (or codex, opencode, cursor, windsurf).

Endpoints

ProtocolForEndpoint
MCP, Streamable HTTP (recommended)coding agentshttp://localhost:3333/mcp + Authorization: Bearer {ACCESS_TOKEN}
MCP, STDIOclients that only support STDIO; needs Dockerdocker exec -i staqly mcp-stdio (no token)
RESTautomations and scriptshttp://localhost:3333/v1/... + Authorization: Bearer {ACCESS_TOKEN}

Staqly Community Edition (staqly serve or the Docker image) has one key, the access token (stk_local_...): staqly prints it at every start, staqly serve token (Docker: docker exec staqly server token) prints it again. See Community Edition vs Staqly Cloud.

Which MCP transport?

Use Streamable HTTP unless your client only supports STDIO. HTTP works with both staqly serve and Docker; STDIO runs a helper inside the staqly Docker container.

AspectStreamable HTTPSTDIO
Endpointhttp://localhost:3333/mcpdocker exec -i staqly mcp-stdio
Works with staqly serveYesNot out of the box: needs Docker, or building mcp-stdio from source
Works with a remote / cloud instanceYes (bearer API key)No: it opens the database inside the container
CredentialsThe access token (Community Edition) or an API key (cloud), as a bearer headerNone locally: it opens the database inside the container
SessionsStateless: every request is authenticated on its ownOne process per agent session
Recommended✔When your client only supports STDIO

STDIO: use -i, never -t

docker exec -i keeps stdin open for the protocol. Adding -t allocates a TTY and breaks the JSON-RPC stream.

Permissions in cloud mode

In the Community Edition, an agent with the access token has full access. In cloud mode, MCP requires an API key and enforces its scopes: a read-only key cannot write, create_post needs posts:write, schedule_post / publish_post need posts:publish, channels need channels:manage. /mcp accepts only bearer keys, never browser cookies. See MCP tools for the scope of every tool and Authentication & scopes for creating keys.

On this page