API, SDK, CLI and MCP
Integrate with the Go REST API and native CLI.
Updated
Production API: https://api.drapub.com; local development: http://127.0.0.1:4320. Go Backend enforces workspace and authentication boundaries.
# From the repository root
bun run cli --help
bun run cli workspace list
bun run cli kb list
bun run cli api /v1/knowledge-bases
bun run cli mcp serveConfigure DRAPUB_API_BASE_URL, DRAPUB_API_KEY or DRAPUB_TOKEN, and DRAPUB_WORKSPACE_ID, or use drapub auth login. Check exit codes in scripts. Legacy Bun commands are retired; use drapub api for native endpoints without a dedicated command.
import { createDraPubRestClient } from "@drapub/sdk/go-api";
const client = createDraPubRestClient({
baseUrl: "https://api.drapub.com",
getToken: async () => currentSessionToken,
getWorkspaceId: () => currentWorkspaceId,
fetchImpl: fetch,
});
const knowledgeBases = await client.get<unknown>("/v1/knowledge-bases");Inject your session and workspace state. Prefer the typed operation API and Go-generated contracts; go-agent provides streaming. Never embed a long-lived API key in browser code. The independent Go SDK lives in apps/drapub-client.
drapub mcp serve exposes knowledge, document, search and chat tools; chat tools create session or message records. Run bun run skillpack:check to validate payloads and bun run skillpack:install:local to install them. Clients access APIs, never the business database.