Developer guide
API, SDK, CLI, and MCP
Choose a stable, publicly safe interface for services, scripts, and agents.
API and SDK
Backend's public gateway uses :4320 for HTTP, tRPC, and Agent SSE. The SDK communicates through HTTP only and contains no database or brain credentials.
import { createDraPubSdk } from '@drapub/sdk'
const client = createDraPubSdk({
baseUrl: process.env.DRAPUB_API_URL ?? 'http://localhost:4320',
apiKey: process.env.DRAPUB_API_KEY,
})client exposes typed workspace, knowledge, task, review, and publishing methods. Never expose a long-lived API key in browser code.
CLI
CLI output remains stable and scriptable. Prefer JSON output in automation, check non-zero exit codes, and preserve human review for commands with external effects.
MCP and Agent Skill
MCP tools and local Skillpack call Backend and hold no GBrain database credentials. Cloud agents use task-scoped tokens that can access only the MCP and model gateway authorized for the current task.