MCP docs

Hosted MCP

JSON-RPC at https://app-stage.librebase.xyz/api/mcp. Agents never receive tokens in RPC bodies; a signed-in human clicks Approve at https://app-stage.librebase.xyz/mcp/authorize.

Quick links

Auth flow

SaaS MCP is JSON-RPC at https://app-stage.librebase.xyz/api/mcp (GET https://app-stage.librebase.xyz/api/mcp for discovery). Alias: https://app-stage.librebase.xyz/mcp. 1. tools/call auth_status. 2. If unauthenticated, tools/call auth_start. Pass access=read|write and resources=[projects,keys,logs,instances,hosts,members] for the permissions you need; omit them to request full read/write on every area. The payload includes showToHuman — your next message to the human MUST be that URL on its own first line, then the userCode. Do not bury them in a status report. 3. Open that URL (https://app-stage.librebase.xyz/mcp/authorize) in the browser, review the requested permissions, and click Approve. 4. tools/call auth_poll. Send the mcp-session-id response header back, or pass deviceCode. Repeat while status is waiting_for_user (ok:true). That is not a failure and does not need an MCP key. Hosted sessions persist across Studio rebuilds; the token is never returned in JSON-RPC. 5. Write path (human Approve required): org_whoami → host_list → instance_create(hostId) → instance_launch → project_create → sqlite_import or supabase_import (preview then write, project DB only) → knowledge_bootstrap then knowledge_put/search (durable project notes in the project DB) → app_deploy (appId template or image) → instance_health → report URL. Hermes dogfood (LIB-55): hermes_bootstrap → hermes_gap_upsert → hermes_sync_linear (Linear key stays on the server). Read-only tokens must auth_start again with access=write. auth_logout drops the session token. Do not paste an MCP key into chat or config for interactive use. Do not send the operator to accounts.x.ai or Grok OAuth. Do not call admin_login / admin_setup on the hosted SaaS MCP.

Hosted vs local stdio

Prefer hosted HTTP when the client can POST JSON-RPC. Local python3 -m librebase_mcp adds stdio-only tools (migration_apply, sql_execute, …). Hosted exposes org/project/instance/host tools plus project-instance SQL (run_sql, schema_migrate, …) — never against the SaaS control-plane database.

See also /for-agents for copy-paste MCP config.