Claude Code
Add staqly to Claude Code so it can write posts, put them on the calendar and answer when a schedule asks for more.
Connect Claude Code to staqly as an MCP server, and Claude can create collections, write posts
with media and a text per channel, schedule and publish them, set up schedules and connect
channels, just from your prompts. Do this once per machine, or once per repository with a
shared .mcp.json.
Connect to Staqly Community Edition
Start staqly
Run staqly serve (or the Docker image). See the Quickstart.
Add the MCP server
Your agent sends staqly's access token, which staqly prints at every start. Put it in
STAQLY_API_KEY (in your shell profile, so the agent always has it):
export STAQLY_API_KEY=$(staqly serve token) # Docker: $(docker exec staqly server token)Then add the server with the token as a header:
claude mcp add --transport http staqly http://localhost:3333/mcp \
--header "Authorization: Bearer $STAQLY_API_KEY"Check the connection
claude mcp list # → staqly: http://localhost:3333/mcp (HTTP) - ✔ ConnectedTip: staqly mcp config claude prints this command and a .mcp.json snippet for your current
CLI profile.
Share it with your team: project .mcp.json
Commit this to your repository so everyone working in it gets staqly. Claude Code expands
${STAQLY_API_KEY} from each person's environment, so no token lands in git:
{
"mcpServers": {
"staqly": {
"type": "http",
"url": "http://localhost:3333/mcp",
"headers": { "Authorization": "Bearer ${STAQLY_API_KEY}" }
}
}
}STDIO (Docker only)
If you run staqly with Docker, you can use STDIO instead of HTTP. It runs mcp-stdio inside
the staqly container, so it needs no token, and it does not work with staqly serve:
claude mcp add staqly -- docker exec -i staqly mcp-stdioConnect to Staqly Cloud
Create a key per agent under Integrations → API keys, e.g. a Content agent key with
collections:read posts:read posts:write posts:publish media:read media:write, and pass it
as a header:
export STAQLY_API_KEY=stk_...
claude mcp add --transport http staqly https://app.staqly.ai/mcp \
--header "Authorization: Bearer $STAQLY_API_KEY"Or in .mcp.json. Claude Code expands ${STAQLY_API_KEY} from the environment, so the key
stays out of git:
{
"mcpServers": {
"staqly": {
"type": "http",
"url": "https://app.staqly.ai/mcp",
"headers": { "Authorization": "Bearer ${STAQLY_API_KEY}" }
}
}
}Try it
Ask Claude in plain language:
"Create a collection called Product updates." "Draft five posts about the new release into it, one per weekday morning, for my X channel." "What is scheduled this week?"
More in Example prompts.
To refill a collection on a timer, run Claude from cron: claude -p "If list_requested_work shows a schedule asking for posts, write three drafts into its collection."