Skip to main content
← Back to Docs

Quickstart Guide

From zero to your first knowledge entry in 5 minutes.

1

Install the MCP server

Brain Protocol runs as an MCP server. Install it globally or use npx.

npx @brain-protocol/mcp --setup claude-desktop

Supported targets: claude-desktop,cursor,claude-code,windsurf,snak

2

Choose your mode

Local (SQLite)

Zero config. Data stored in ~/.brain-protocol/brain.db.

{
"mcpServers": {
"brain": {
"command":"npx",
"args": ["@brain-protocol/mcp"]
 }
 }
}

Cloud (PostgreSQL)

Multi-tenant, on-chain proofs, semantic search. Sign in to get an API key.

{
"mcpServers": {
"brain": {
"command":"npx",
"args": ["@brain-protocol/mcp"],
"env": {
"BRAIN_API_URL":"https://brain.api.vauban.tech",
"BRAIN_API_KEY":"brain_your-key"
 }
 }
 }
}

How to get an API key (cloud mode)

  1. Sign in with GitHub, Google, or a Starknet wallet
  2. Go to Admin API Keys
  3. Click Create Key and copy the key (shown once, prefixed brain_)
3

Archive your first entry

Use the archive_knowledge MCP tool or the SDK.

MCP Tool
// In Claude Desktop, Cursor, or any MCP client:
Use the archive_knowledge tool with:
 content:"Brain Protocol supports 38 MCP tools across 7 groups"
 category:"documentation"
 confidence: 0.95
TypeScript SDK
import { BrainClient } from"@brain-protocol/sdk";

const brain = new BrainClient({
 baseUrl:"https://brain.api.vauban.tech",
 apiKey:"your-api-key",
});

const entry = await brain.knowledge.create({
 content:"Brain Protocol supports 38 MCP tools across 7 groups",
 category:"documentation",
 confidence: 0.95,
});

console.log(entry.id); // UUID
4

Query your knowledge

MCP Tool
Use the query_knowledge tool with:
 q:"MCP tools"
 limit: 5
TypeScript SDK
const results = await brain.knowledge.query({
 q:"MCP tools",
 limit: 5,
});

// results.entries[0].content
//"Brain Protocol supports 38 MCP tools across 7 groups"
5

Create relationships

Link entries with typed edges to build a knowledge graph.

const edge = await brain.edges.create({
 source_id: entry1.id,
 target_id: entry2.id,
 edge_type:"derives_from",
 confidence: 0.9,
});

Edge types: derives_from, validates, extends,conflicts_with, implements, supersedes,tested_by, documented_by, optimizes,related_to

6

Prove on-chain (cloud mode)

Anchor critical knowledge with a Poseidon hash on Starknet. Returns a W3C Verifiable Credential.

const proof = await brain.knowledge.anchor(entry.id);

// proof.tx_hash — Starknet transaction
// proof.content_hash — Poseidon hash
// proof.verified_at — Timestamp

Next Steps

  • Explore the Knowledge Explorer dashboard
  • Check the SDK reference on npm for all methods
  • Use record_decision and get_memory_guidance for agent decision intelligence
  • Run npx @brain-protocol/mcp --check to verify your setup
ESC
Navigation
Admin
Docs
↑↓NavigateSelectescClose
Brain Protocol — Cryptographic Memory for AI Agents