Talk to VibeHub from code.
One REST surface, one TypeScript SDK, one MCP server. Capture sessions from any agent, attach them to commits, query your vibes, and trigger workflows.
Capture a commit in three calls.
The most common API flow: open a session, append messages, and attach it to a commit.
bash# 1) Start a session
curl -X POST https://vibehub.co/api/sdk/sessions \
-H "Authorization: Bearer vbh_..." \
-H "Content-Type: application/json" \
-d '{"source":"cursor","model":"claude-opus-4-7"}'
# → { "session": { "id": "ses_…", "status": "open" } }
# 2) Append a message
curl -X POST https://vibehub.co/api/sdk/sessions/ses_…/attach \
-H "Authorization: Bearer vbh_..." \
-H "Content-Type: application/json" \
-d '{
"sha": "1a2b3c4d…",
"projectId": "prj_…",
"message": "feat: add waitlist"
}'Prefer the SDK or the MCP server for any non-trivial integration — both wrap this surface and add idempotency keys, retries, and types.
Bearer tokens, vbh_ prefix.
Every API call carries a token from the dashboard at Settings → API tokens. The plaintext is shown once at creation — store it like any other secret.
httpPOST /api/sdk/sessions HTTP/1.1
Host: vibehub.co
Authorization: Bearer vbh_3f9c…b21
Content-Type: application/json
{ "source": "cursor" }- PREFIXTokens start with
vbh_. Anything else is rejected. - STORAGEOnly the sha-256 hash is stored. Treat tokens as you would any API key.
- REVOKE
DELETE /api/cli/tokens/:idor the dashboard. - DASHBOARDBrowser-based UI requests use session cookies — same surface, different auth.
@vibehub/sdk for TypeScript.
A tiny, typed wrapper around the REST surface. Works in Node 18+, Bun, Deno, and the browser.
Install
npm i @vibehub/sdk
# or
pnpm add @vibehub/sdk
bun add @vibehub/sdkCreate a client
tsimport { createClient } from "@vibehub/sdk";
const vb = createClient({
apiUrl: "https://vibehub.co",
token: process.env.VIBEHUB_TOKEN!,
});End-to-end capture
ts// 1) start a session
const session = await vb.startSession({
source: "cursor",
model: "claude-opus-4-7",
externalId: "cursor-chat-123", // idempotency key
});
// 2) stream messages
await vb.appendMessages(session.id, [
{ role: "user", content: "fix the foo bug" },
{ role: "assistant", content: "Looking at src/foo.ts…" },
]);
// 3) attach to a commit
await vb.attachToCommit(session.id, {
sha: "1a2b3c4d…",
projectId: "prj_…",
message: "fix: foo bug",
});One-shot capture
For agents that already have the whole conversation in memory by the time they commit.
tsawait vb.captureCommit({
projectId,
sha,
message: "feat: thing",
committedAt: new Date(),
diff: gitDiff,
filesChanged: 3,
insertions: 42,
deletions: 7,
conversation: {
source: "windsurf",
messages: [
{ role: "user", content: "…" },
{ role: "assistant", content: "…" },
],
},
});Method index
startSession(input)Open a session. Idempotent via externalId.
appendMessages(id, msgs)Append one or many messages; sequence is server-assigned.
getSession(id, { includeMessages? })Fetch a session with optional messages.
listSessions({ status?, projectId?, limit? })List the authenticated user's sessions.
updateSession(id, patch)Patch summary, status, or endedAt.
attachToCommit(id, params)Close the session and link it to a git commit.
captureCommit(input)Bulk POST: commit + conversation in one call.
createProject(input)Register a repo. Idempotent by (owner, slug).
listProjects()List the user's projects.
Endpoint reference.
All endpoints are JSON-in / JSON-out, return standard HTTP status codes, and live under https://vibehub.co.
Projects
/api/projectsList the user's projects.
/api/projectsCreate or reuse a project by (owner, slug).
/api/projects/:slug/branchesList remote branches for a project.
/api/projects/:slug/mirrorLink or refresh a GitHub mirror.
Vibes & commits
/api/vibesBrowse vibes (filter by project, tag, builder).
/api/vibes/:idFetch a single vibe with its bundle.
/api/cli/commitsRegister a commit (used by vb push). Bulk capture supported.
/api/cli/commits/:shaFetch a commit by SHA.
Sessions (SDK & MCP backend)
/api/sdk/sessionsOpen a new session, or reuse one by externalId.
/api/sdk/sessions/:idFetch a session, optionally with messages.
/api/sdk/sessions/:idPatch summary, status, or endedAt.
/api/sdk/sessions/:id/attachClose the session and link it to a commit.
Workflows & runs
/api/workflowsList workflows.
/api/workflowsCreate a new workflow.
/api/workflows/:idFetch a workflow and its triggers.
/api/workflows/:id/triggerTrigger a run with typed inputs.
/api/runsList recent runs across workflows.
/api/runs/:idFetch a single run with logs.
Collections, builders, activity
/api/collectionsList the user's collections.
/api/collectionsCreate a collection.
/api/collections/:id/vibesAdd a vibe to a collection.
/api/buildersBrowse public builders & profiles.
/api/builders/:id/followFollow / unfollow a builder.
/api/activityActivity feed for the authenticated user.
/api/analyticsProject-level analytics summary.
Agent (dashboard chat)
/api/agent/chatStream a chat turn (Server-Sent Events).
/api/agent/toolsList tools the agent has access to.
/api/agent/metricsPer-conversation usage metrics.
/api/agent/conversationsList the user's agent conversations.
/api/agent/conversations/:idFetch a conversation with its turns.
Account & tokens
/api/meThe authenticated user's profile.
/api/cli/tokensList the user's API tokens (metadata only).
/api/cli/tokensMint a new token. The plaintext is returned once.
/api/cli/tokens/:idRevoke a token.
/api/cli/projectsCLI-shaped list of projects (used by vb).
/api/cli/branchesCLI-shaped branch listing.
/api/cli/mirrorsList linked GitHub mirrors.
/api/cli/mirrors/pushTrigger a mirror push.
Billing & misc
/api/billing/checkoutStart a Stripe checkout session.
/api/billing/portalOpen the customer portal.
/api/billing/webhookStripe webhook receiver.
/api/notificationsIn-app notifications feed.
/api/signupsPublic waitlist signup endpoint.
/api/healthService health probe.
Errors, idempotency & rate limits.
Predictable failure modes and replay safety for any integration that can't afford double-writes.
- Status codes —
200/201success,400validation,401bad token,403not your resource,404not found,409conflict (e.g. project slug taken),429rate-limited. - Error body — always
{ "error": "human-readable", "code"?: "snake_case_key" }. - Idempotency — session creation accepts an
externalId; commit registration is idempotent by SHA + project. - Rate limits — soft cap of 60 req/min per token on writes, 300 req/min on reads. Hard limits live on Team plans.
- SDK —
VibeHubErrorcarries.statusand the parsed.body.
Model Context Protocol server.
vibehub-mcp is a stdio MCP server. Drop it into any MCP-capable IDE and the agent gains a small toolbelt that records the chat and attaches it to commits.
Install
# install globally
npm i -g vibehub-mcp
# or run on demand
npx vibehub-mcpThe server reads two env vars: VIBEHUB_API_URL (defaults to https://vibehub.co) and VIBEHUB_TOKEN (required — same vbh_… token as the SDK).
How sessions work
A session is an open conversation. It starts open, accumulates messages, and becomes attached when linked to a commit. The current session id is persisted at ~/.vibehub/mcp-state.json so tools like vibehub_append_message can omit sessionId.
Encourage the agent to actually use these tools by adding an instruction to your project rules file (.cursorrules, AGENTS.md, etc) — see the patterns below.
The vibehub_* toolbelt.
Every MCP-capable agent that mounts the server sees these tools. They map 1:1 onto SDK calls and persist the “current session” locally so the agent doesn't need to thread an id everywhere.
vibehub_start_sessionOpen a new session and remember it as current. Call once per chat.
vibehub_append_messageAppend a single user/assistant/tool/system message.
vibehub_append_messagesBatch-append messages (useful for backfilling).
vibehub_attach_to_commitClose the session and link it to a SHA. Creates the commit row if needed.
vibehub_current_sessionReturn the active session id, status, and message count.
vibehub_list_projectsList the user's VibeHub projects (id, slug, name).
vibehub_create_projectCreate (or reuse) a project by name. Sets visibility.
Suggested agent instructions
Paste into your IDE's system prompt, project rules, or AGENTS.md:
Use the `vibehub_*` tools to record this conversation.
• Call vibehub_start_session once at the start with source set to the IDE name.
• After every assistant response, call vibehub_append_message with role
"assistant" and the response content.
• When the user commits, call vibehub_attach_to_commit with the SHA.IDE configuration.
Anywhere that accepts a stdio MCP server command + args + env, the same three lines work.
Cursor
~/.cursor/mcp.json
json{
"mcpServers": {
"vibehub": {
"command": "npx",
"args": ["-y", "vibehub-mcp"],
"env": {
"VIBEHUB_API_URL": "https://vibehub.co",
"VIBEHUB_TOKEN": "vbh_…"
}
}
}
}Claude Desktop
~/Library/Application Support/Claude/claude_desktop_config.json
json{
"mcpServers": {
"vibehub": {
"command": "npx",
"args": ["-y", "vibehub-mcp"],
"env": {
"VIBEHUB_API_URL": "https://vibehub.co",
"VIBEHUB_TOKEN": "vbh_…"
}
}
}
}Windsurf · Continue.dev · Zed
Any MCP-capable IDE uses the same command + args + env shape — the exact config file changes, but the contents don't.
json{
"command": "npx",
"args": ["-y", "vibehub-mcp"],
"env": {
"VIBEHUB_API_URL": "https://vibehub.co",
"VIBEHUB_TOKEN": "vbh_…"
}
}For zero-friction commits, point your IDE's commit flow at vb commit --attach-session <id> — the CLI calls attach_to_commit for you.