Overview
Pick the right way to connect your coding agent, n8n or scripts to staqly.
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
Claude Code
claude mcp add or a project .mcp.json.OpenAI Codex
codex mcp add or ~/.codex/config.toml.OpenCode
mcp block in opencode.json.Cursor
.cursor/mcp.json, plus a rule to ask before acting.Windsurf
mcp_config.json, plus a rule to ask before acting.Other MCP clients
Frameworks & automation
Scripts & SDK
The staqly CLI can also print the right MCP setup for you:
staqly mcp config claude (or codex, opencode, cursor, windsurf).
Endpoints
| Protocol | For | Endpoint |
|---|---|---|
| MCP, Streamable HTTP (recommended) | coding agents | http://localhost:3333/mcp + Authorization: Bearer {ACCESS_TOKEN} |
| MCP, STDIO | clients that only support STDIO; needs Docker | docker exec -i staqly mcp-stdio (no token) |
| REST | automations and scripts | http://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.
| Aspect | Streamable HTTP | STDIO |
|---|---|---|
| Endpoint | http://localhost:3333/mcp | docker exec -i staqly mcp-stdio |
Works with staqly serve | Yes | Not out of the box: needs Docker, or building mcp-stdio from source |
| Works with a remote / cloud instance | Yes (bearer API key) | No: it opens the database inside the container |
| Credentials | The access token (Community Edition) or an API key (cloud), as a bearer header | None locally: it opens the database inside the container |
| Sessions | Stateless: every request is authenticated on its own | One 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.