brain-operator-mcp

brain-operator-mcp

A TypeScript MCP server that lets ChatGPT and other MCP clients read and safely modify TheBrain through the TheBrain REST API.

Category
Visit Server

README

Brain Operator MCP

A TypeScript MCP server that lets ChatGPT and other MCP clients read and safely modify TheBrain through the TheBrain REST API.

Setup

npm install
cp .env.example .env
# edit .env and set THEBRAIN_API_KEY
npm run dev

The server defaults to:

  • GET /health
  • POST /mcp
  • TheBrain Cloud API base URL: https://api.bra.in

Health

curl http://localhost:3000/health

Expected:

{
  "ok": true,
  "name": "brain-operator-mcp",
  "version": "0.1.0"
}

MCP Inspector

npm run inspect

Use http://localhost:3000/mcp as the Streamable HTTP endpoint.

ChatGPT App Endpoint

For development, expose the local server through HTTPS:

npm run dev
ngrok http 3000

Then add this MCP server endpoint in ChatGPT developer mode:

https://<ngrok-subdomain>.ngrok.app/mcp

If MCP_API_TOKEN is set, clients must send:

Authorization: Bearer <MCP_API_TOKEN>

Tools

Read-only:

  • health_check
  • list_brains
  • get_brain
  • search_thoughts
  • get_thought
  • get_thought_graph
  • get_note
  • list_attachments

Safe writes:

  • create_thought
  • update_thought
  • create_link
  • append_note
  • add_url_attachment

Plan workflow:

  • create_change_plan
  • get_change_plan
  • discard_change_plan
  • commit_change_plan

Safety

  • Never put a real API key in source, docs, tests, logs, screenshots, or commits.
  • Single-step write tools respect WRITE_TOOLS_ENABLED.
  • Destructive tools are not registered in v0.1.
  • Batch writes must be created as a plan, reviewed by the user, then committed by planId.
  • Notes are append-only and limited by MAX_NOTE_CHARS.
  • URL attachments reject local and private-network hosts.

Manual Smoke Tests

Read-only:

Call list_brains.
Pick a brainId.
Call search_thoughts with queryText = "test".
Call get_thought on one result.

Single-step write:

Call create_thought:
- name: "[MCP_TEST] Brain Operator Smoke Test"
- label: "Created by brain-operator-mcp smoke test"

Call append_note on created thought:
- markdown: "This is a smoke test note."

Batch plan/commit:

The example below uses redacted placeholders. Do not paste private source notes into public docs, issues, or screenshots.

{
  "title": "[MCP_TEST] Redacted Import",
  "changes": [
    {
      "id": "c1",
      "op": "create_thought",
      "clientRef": "t_root",
      "name": "[MCP_TEST] REDACTED_ROOT_TOPIC",
      "label": "[REDACTED_LABEL]"
    },
    {
      "id": "c2",
      "op": "create_thought",
      "clientRef": "t_core_loop",
      "name": "[MCP_TEST] REDACTED_CHILD_TOPIC"
    },
    {
      "id": "c3",
      "op": "create_link",
      "fromRef": "t_root",
      "toRef": "t_core_loop",
      "relation": "child"
    },
    {
      "id": "c4",
      "op": "append_note",
      "targetRef": "t_root",
      "markdown": "[REDACTED_MARKDOWN_CONTENT]"
    }
  ]
}

Then call commit_change_plan with:

{
  "planId": "returned_plan_id",
  "confirm": true
}

Common Errors

  • BRAIN_ID_REQUIRED: pass brainId or set THEBRAIN_DEFAULT_BRAIN_ID.
  • WRITE_DISABLED: set WRITE_TOOLS_ENABLED=true when you intentionally want writes.
  • UNSAFE_URL: use a public http or https URL.
  • PLAN_NOT_PENDING: the plan was already committed, discarded, or expired.

Verification

npm run typecheck
npm run lint
npm test
npm run build

Recommended Servers

playwright-mcp

playwright-mcp

A Model Context Protocol server that enables LLMs to interact with web pages through structured accessibility snapshots without requiring vision models or screenshots.

Official
Featured
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

An AI-powered tool that generates modern UI components from natural language descriptions, integrating with popular IDEs to streamline UI development workflow.

Official
Featured
Local
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

Enables interaction with Audiense Insights accounts via the Model Context Protocol, facilitating the extraction and analysis of marketing insights and audience data including demographics, behavior, and influencer engagement.

Official
Featured
Local
TypeScript
VeyraX MCP

VeyraX MCP

Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.

Official
Featured
Local
graphlit-mcp-server

graphlit-mcp-server

The Model Context Protocol (MCP) Server enables integration between MCP clients and the Graphlit service. Ingest anything from Slack to Gmail to podcast feeds, in addition to web crawling, into a Graphlit project - and then retrieve relevant contents from the MCP client.

Official
Featured
TypeScript
Kagi MCP Server

Kagi MCP Server

An MCP server that integrates Kagi search capabilities with Claude AI, enabling Claude to perform real-time web searches when answering questions that require up-to-date information.

Official
Featured
Python
Neon Database

Neon Database

MCP server for interacting with Neon Management API and databases

Official
Featured
E2B

E2B

Using MCP to run code via e2b.

Official
Featured
Exa Search

Exa Search

A Model Context Protocol (MCP) server lets AI assistants like Claude use the Exa AI Search API for web searches. This setup allows AI models to get real-time web information in a safe and controlled way.

Official
Featured
Qdrant Server

Qdrant Server

This repository is an example of how to create a MCP server for Qdrant, a vector search engine.

Official
Featured