Local MCP (stdio and localhost)
Two ways to connect an AI agent on the same machine with no public HTTPS and no OAuth. These work with the Docker image (Running OpenBursar in Docker). For a site on Cloudflare, use Connect your AI assistant.
1. stdio: node dist/server.mjs mcp
Serves the same tools as the HTTP endpoint over the MCP stdio transport, against the local SQLite database.
- It never starts the HTTP server or the scheduler. It can run while the normal server is running against the same database file (SQLite WAL with a 5 s busy timeout).
- stdout carries only JSON-RPC; all logs (including Node's SQLite warning) go to stderr.
query_sqluses the same read-only, time-limited connection as the HTTP server.- Environment:
OB_DB_PATH(default/data/openbursar.db).BASE_URLis not needed. OWNER_PASSPHRASE(orOWNER_PASSPHRASE_FILE) is optional. Every read tool works without it. Therefreshtool syncs providers and must decrypt their stored secrets, so it works only when the passphrase is set; without itrefreshreturns an "unavailable" error that says so. The running server still syncs on its own schedule.
Config file clients
The example below is for Claude Desktop (claude_desktop_config.json). Many other clients that launch local servers use the same mcpServers shape; check your client's documentation for its file and format.
The compose file names the container openbursar; if you started it another way, use your container's name. The container already has OB_DB_PATH in its environment, and the passphrase file too when you started it from the compose file, so nothing else is needed:
{
"mcpServers": {
"openbursar": {
"command": "docker",
"args": ["exec", "-i", "openbursar", "node", "dist/server.mjs", "mcp"]
}
}
}
(-i keeps stdin open; do not pass -t.)
Command-line clients
Claude Code:
claude mcp add openbursar -- docker exec -i openbursar node dist/server.mjs mcp
2. localhost HTTP with a static token
Set MCP_TOKEN (a long random string) under environment: in docker-compose.yml and run docker compose up -d so the container picks it up (Running OpenBursar in Docker); /api/mcp then accepts Authorization: Bearer <MCP_TOKEN> without OAuth.
The token must be at least 16 characters; a shorter one is ignored. For example, with Claude Code:
export MCP_TOKEN=... # the MCP_TOKEN value you put in docker-compose.yml
claude mcp add --transport http openbursar http://localhost:3000/api/mcp \
--header "Authorization: Bearer $MCP_TOKEN"
Any client that lets you add an HTTP server with a custom header works the same way.
Only send the token to localhost on your own computer, or over HTTPS. Never send it over plain HTTP across a network: it is a static secret that gives full read access. Generate it randomly, for example with openssl rand -base64 32.