secondbrain-mcp

v0.0.5
secondbrain-mcp Checked 22 hours ago Published 8 days ago

secondbrain-mcp MCP server

A Model Context Protocol (MCP) server for managing WorkFlowy-based second brain structures, with specialized support for Brainlift documents and surgical content editing. You need a WorkFlowy account with your content organized in a hierarchical structure (see WorkFlowy Structure below). Add this to your Claude Desktop config file:

Summary extracted from the README.

SecondBrain MCP Server

A Model Context Protocol (MCP) server for managing WorkFlowy-based second brain structures, with specialized support for Brainlift documents and surgical content editing.

Installation

npm install -g secondbrain-mcp

Or run directly without installing:

npx secondbrain-mcp

Configuration

Prerequisites

You need a WorkFlowy account with your content organized in a hierarchical structure (see WorkFlowy Structure below).

Environment Variables

Variable Required Description
WORKFLOWY_USERNAME Yes Your WorkFlowy email address
WORKFLOWY_PASSWORD Yes Your WorkFlowy password
WORKFLOWY_ROOT_NODE Yes The name of the root node in your WorkFlowy tree (e.g., "My Second Brain")

Adding to Claude Desktop

Add this to your Claude Desktop config file:

  • macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
  • Windows: %APPDATA%/Claude/claude_desktop_config.json
{
  "mcpServers": {
    "secondbrain-mcp": {
      "command": "npx",
      "args": ["secondbrain-mcp"],
      "env": {
        "WORKFLOWY_USERNAME": "your-email@example.com",
        "WORKFLOWY_PASSWORD": "your-password",
        "WORKFLOWY_ROOT_NODE": "your-root-node-name"
      }
    }
  }
}

Adding to Claude Code

Add with the CLI:

claude mcp add secondbrain-mcp -- npx secondbrain-mcp

Then set the required environment variables in your shell or .env file.

Adding to Cursor / VS Code

Add to your .cursor/mcp.json or .vscode/mcp.json:

{
  "mcpServers": {
    "secondbrain-mcp": {
      "command": "npx",
      "args": ["secondbrain-mcp"],
      "env": {
        "WORKFLOWY_USERNAME": "your-email@example.com",
        "WORKFLOWY_PASSWORD": "your-password",
        "WORKFLOWY_ROOT_NODE": "your-root-node-name"
      }
    }
  }
}

Development

# Install dependencies
npm install

# Build the project
npm run build

# Start stdio transport (default)
npm run start

# Start SSE transport wrapper
npm run start:sse

Features

🧠 WorkFlowy Integration

  • Connect to WorkFlowy accounts for second brain management
  • Navigate organizational structures (Departments β†’ People β†’ Content)
  • Read and update content with surgical precision

🎯 Path-Based Targeting

  • Update specific sub-nodes without affecting other content
  • Navigate to any depth in hierarchical structures
  • Safe, surgical editing prevents accidental data loss

πŸ“š Brainlift Structure Support

  • Built-in validation for Brainlift document structure
  • DOK framework support (DOK1-Facts, DOK2-Summaries, DOK3-Insights, DOK4-SPOVs)
  • Section-specific editing (Owner, Purpose, Experts, Knowledge Tree)

πŸ›‘οΈ Safety Features

  • Content preservation with targeted updates
  • Structure validation and helpful feedback
  • Full-content replacement write tool removed for safety

Available Tools

Core Navigation

  • list-departments - List all departments in the organization
  • list-persons - List all people in a specific department

Content Reading

  • get-markdown - Get full person content as markdown
  • get-markdown-at-path - Read content from specific paths
  • get-brainlift-section - Read specific Brainlift sections

Content Writing

  • set-markdown-at-path - Update content at specific paths (with Brainlift validation)
  • create-markdown-at-path - Create missing path nodes, then write content at target path
  • set-brainlift-section - Specialized Brainlift section editing

Analysis Tools

  • analyze-logs - Analyze and categorize security logs
  • compare-baseline - Compare anomaly vs baseline log data
  • example_tool - Example tool for testing

Note: tool loading is auto-discovered at runtime. Use npm run build and startup logs to confirm the active tool set in your environment.

Project Structure

secondbrain-mcp/
β”œβ”€β”€ secondbrain-mcp-server.js     # SSE wrapper entrypoint
β”œβ”€β”€ src/
β”‚   β”œβ”€β”€ tools/                    # Maintained MCP tools in source
β”‚   β”‚   β”œβ”€β”€ GetMarkdownTool.ts           # Read full person content
β”‚   β”‚   β”œβ”€β”€ GetMarkdownAtPathTool.ts     # Read specific paths
β”‚   β”‚   β”œβ”€β”€ SetMarkdownAtPathTool.ts     # Update specific paths
β”‚   β”‚   β”œβ”€β”€ GetBrainliftSectionTool.ts   # Read Brainlift sections
β”‚   β”‚   β”œβ”€β”€ SetBrainliftSectionTool.ts   # Update Brainlift sections
β”‚   β”‚   β”œβ”€β”€ ListDepartmentsTool.ts       # List departments
β”‚   β”‚   β”œβ”€β”€ ListPersonsTool.ts           # List people in department
β”‚   β”‚   └── ExampleTool.ts               # Example/testing
β”‚   β”œβ”€β”€ secondBrain.ts            # Core WorkFlowy integration
β”‚   └── index.ts                  # Server entry point
β”œβ”€β”€ dist/                         # Compiled JavaScript
β”œβ”€β”€ BRAINLIFT_TOOLS_GUIDE.md      # Detailed Brainlift usage guide
β”œβ”€β”€ USAGE_EXAMPLES.md             # Path-based tools examples
β”œβ”€β”€ package.json
└── tsconfig.json

WorkFlowy Structure

The server expects this organizational structure in WorkFlowy:

Organization Root
β”œβ”€β”€ Department 1 (e.g., "Engineering")
β”‚   β”œβ”€β”€ Person 1 (e.g., "John Doe")
β”‚   β”‚   β”œβ”€β”€ BrainLifts
β”‚   β”‚   β”‚   β”œβ”€β”€ Brainlift 1: Title
β”‚   β”‚   β”‚   β”‚   β”œβ”€β”€ Owner
β”‚   β”‚   β”‚   β”‚   β”œβ”€β”€ Purpose
β”‚   β”‚   β”‚   β”‚   β”œβ”€β”€ DOK4 - SPOV
β”‚   β”‚   β”‚   β”‚   β”œβ”€β”€ DOK3 - Insights
β”‚   β”‚   β”‚   β”‚   β”œβ”€β”€ Experts
β”‚   β”‚   β”‚   β”‚   └── DOK2 - Knowledge Tree
β”‚   β”‚   β”‚   └── Brainlift 2: Title
β”‚   β”‚   └── Exploration
β”‚   β”‚       β”œβ”€β”€ Emerging Brainlifts
β”‚   β”‚       └── Sandbox
β”‚   └── Person 2
└── Department 2

Usage Examples

Basic Operations

// List all departments
list-departments({message: ""})

// List people in a department  
list-persons({departmentName: "Engineering"})

// Read full person content
get-markdown({
  departmentName: "Engineering",
  personName: "John Doe"
})

Path-Based Targeting

// Read specific Brainlift section
get-markdown-at-path({
  departmentName: "Engineering", 
  personName: "John Doe",
  path: ["BrainLifts", "Brainlift 1: My Project", "DOK4 - SPOV"]
})

// Update specific section without affecting others
set-markdown-at-path({
  departmentName: "Engineering",
  personName: "John Doe", 
  path: ["BrainLifts", "Brainlift 1: My Project", "DOK4 - SPOV"],
  markdown: "* New spiky point of view\n* Another provocative insight"
})

// Create path if needed, then write content
create-markdown-at-path({
  departmentName: "Engineering",
  personName: "John Doe",
  path: ["Exploration", "Q2 Themes", "AI Operations"],
  markdown: "* Candidate topic 1\n* Candidate topic 2"
})

Path matching is tolerant for common variants (for example Brainlifts vs BrainLifts, and & vs &).

Brainlift-Specific Operations

// Read Brainlift section (easier syntax)
get-brainlift-section({
  departmentName: "Engineering",
  personName: "John Doe",
  brainliftName: "Brainlift 1: My Project", 
  section: "Experts"
})

// Update Brainlift section with validation
set-brainlift-section({
  departmentName: "Engineering",
  personName: "John Doe",
  brainliftName: "Brainlift 1: My Project",
  section: "Experts", 
  content: "* Expert 1:\n  * who: Jane Smith, AI Researcher\n  * focus: Machine Learning\n  * why follow: Leading expert in neural networks\n  * where: Twitter @janesmith, LinkedIn"
})

Key Features & Benefits

🎯 Surgical Editing

  • Update specific Brainlift sections without affecting others
  • Navigate to any depth in the content hierarchy
  • Preserve existing content while making targeted changes

🧠 Brainlift Intelligence

  • Built-in validation for DOK framework (DOK1β†’DOK2β†’DOK3β†’DOK4)
  • Section-specific guidance (Owner, Purpose, SPOV, Insights, Experts, Knowledge Tree)
  • Automatic structure checking and helpful feedback

πŸ›‘οΈ Safety First

  • Full-content replacement write tool removed
  • Path validation prevents accidental overwrites
  • Clear error messages and structure guidance

πŸ“Š Content Quality

  • Real-time validation for Brainlift structure compliance
  • Suggestions for improving SPOV "spikiness"
  • Ensures proper expert profiles and source documentation

Documentation

Learn More