codbrain Back to Home
MCP API Reference & Architecture

Model Context Protocol (MCP) Documentation

codbrain exposes 15 standard JSON-RPC HTTP Model Context Protocol tools to AI assistants (Claude Code, Cursor, Codex).

MCP HTTP Endpoint:
https://codbrain.online/api/mcp

One-Line MCP Integration

// Run in your terminal to connect Claude Code or Cursor to codbrain:

claude mcp add codbrain --transport http https://codbrain.online/api/mcp

The 15 MCP Tools Reference

Full tools inventory exposed over Model Context Protocol JSON-RPC.

15 Production Tools
brain_askDoctrine Query

Returns scope-aware operational rules and patterns tailored to the seller's target market.

Scope:Global + Local
get_procedureProcedures

Fetches step-by-step executable procedure checklists (e.g. choose-product, make-static-ads, build-cod-store).

Scope:Global Repo
get_templateTemplates

Returns signed 10-minute URL for pre-built headless store architecture (Gadget & Cosmetics engine).

Scope:Signed Bucket
check_economicsEconomics

Calculates unit economics, breaking points, CPL thresholds, and profit metrics from seller profile + reported outcomes.

Scope:Real-time Calc
check_setupEnvironment

Audits local host environment for required CLI tools (ffmpeg, node, vercel) and external integration keys.

Scope:Environment
get_profileAccount

Retrieves seller configuration parameters (target markets, target currency, average confirmation rate).

Scope:Private Profile
brain_notePrivate Wiki

Creates or updates private notes in the seller's isolated PostgreSQL database with category and graph links.

Scope:RLS Private
brain_recallPrivate Wiki

Queries the seller's private wiki notes by category, title, or graph links.

Scope:RLS Private
brain_indexPrivate Wiki

Returns full private wiki catalog with missing graph references and unexplored knowledge gaps.

Scope:RLS Private
brain_logPrivate Wiki

Append-only execution log tracking operational decisions, costs, and execution blockers.

Scope:RLS Private
contribute_lessonDistillation

Submits operational learnings, test failures, or market observations to the consensus distillation queue.

Scope:Public Queue
report_outcomeDistillation

Reports quantitative campaign performance (CR, delivery rate, CPA) to update benchmark consensus.

Scope:Public Queue
get_benchmarkAnalytics

Returns aggregate market benchmarks (locked until seller contributes consensus observations).

Scope:Consensus Lock
codbrain_startOnboarding

Returns initial protocol contract, writes CODBRAIN.md rules file to workspace root.

Scope:Workspace Init
list_templatesTemplates

Lists all available pre-packaged store engines with validation security gates.

Scope:Catalog

Security Sandbox Specifications

Local Agent Execution

codbrain returns facts, metrics, and templates. Shell commands and network calls are executed by your agent on your local machine under your control.

Supabase RLS Isolation

Seller databases are separated by PostgreSQL Row Level Security. Every note and execution log is bound to the authenticated API key payload.

Input Injection Firewall

scanForInjection audits all inbound text for shell command attempts, raw URLs, or secret token leaks before database insertion.