Skip to main content
Glama

brainforge-mcp

PyPI Python License: MIT

MarkdownノートをAI駆動のナレッジグラフに変えましょう。

Andrej Karpathy氏のLLM WikiパターンをMCPサーバーとして実装したプロジェクトです。Markdown形式のWikiをナレッジグラフに変換し、あらゆるLLMクライアントから探索・分析できるようにします。

コアコンセプト

[원본 자료]  →  [AI가 유지하는 위키]  →  [지식 그래프]  →  [LLM이 탐색·분석]
 논문, 기사       sources/                 graph.json       MCP 도구로 질의
 메모, 영상       concepts/                                  인과 관계 추적
                  entities/                                  건강 진단

MCPツールがすること: ナレッジグラフの探索、ノード分析、因果関係の追跡、Wikiの健全性診断 LLMがすること: 原文の読み込み → 要約 → Wikiページの作成 → Wikiリンク/因果関係の挿入

つまり、brainforge-mcpは**Wikiの「目」であり、LLMはWikiの「手」**です。


Related MCP server: vault-master-mcp

A-to-Zの例:論文1本からナレッジグラフまで

Step 0: インストール + 初期化

uvx brainforge-mcp init ~/my-brain

生成される構造:

my-brain/
├── raw/              # 불변 원본 (사용자가 넣는 곳)
│   ├── papers/
│   ├── articles/
│   ├── transcripts/
│   └── notes/
├── wiki/             # AI가 유지하는 위키
│   ├── sources/
│   ├── concepts/
│   ├── entities/
│   ├── syntheses/
│   ├── index.md
│   └── log.md
└── output/           # 블로그, 포트폴리오 등

Step 1: MCPクライアントへの登録

Claude Desktop (claude_desktop_config.json):

{
  "mcpServers": {
    "wiki": {
      "command": "uvx",
      "args": ["brainforge-mcp", "--vault", "~/my-brain/wiki"]
    }
  }
}

Kiro / Cursor / VS Code (mcp.json):

{
  "mcpServers": {
    "wiki": {
      "command": "uvx",
      "args": ["brainforge-mcp", "--vault", "~/my-brain/wiki"]
    }
  }
}

Step 2: 原文資料の追加

論文のPDFをMarkdownに変換し、raw/papers/に保存します:

# 예: marker로 PDF → 마크다운 변환
marker_single "lora-paper.pdf" --output_dir ~/my-brain/raw/papers/

または、Web記事を直接Markdownとして保存:

<!-- raw/articles/2026-04-17_lora-explained.md -->
---
title: "LoRA 논문 쉽게 설명하기"
source: https://example.com/lora
date: 2026-04-17
type: article
---

# LoRA 논문 쉽게 설명하기
LLM의 가중치를 Freeze하고 저랭크 행렬만 학습하여...

Step 3: LLMへのインジェスト依頼 (LLMの作業)

チャットで以下のように依頼します:

"raw/articles/2026-04-17_lora-explained.md를 읽고 위키에 인제스트해줘"

LLMが原文を読み込み、以下のファイルを作成します:

wiki/sources/lora-explained.md (ソースの要約):

---
title: "LoRA 논문 쉽게 설명하기"
created: 2026-04-17
updated: 2026-04-17
tags: [LoRA, Fine-Tuning, PEFT]
sources: [raw/articles/2026-04-17_lora-explained.md]
---

# LoRA 논문 쉽게 설명하기

## Kernel
모델 가중치를 Freeze하고 저랭크 행렬만 학습하여 VRAM 절감.

## 핵심 주장
1. Fully Fine-Tuning 대비 VRAM 대폭 절감
2. 성능은 동등하거나 우수
...

wiki/concepts/lora.md (概念ページ):

---
title: LoRA (Low-Rank Adaptation)
created: 2026-04-17
updated: 2026-04-17
tags: [개념, Fine-Tuning, PEFT]
sources: [raw/articles/2026-04-17_lora-explained.md]
---

# LoRA (Low-Rank Adaptation)

## Kernel
가중치 행렬 W를 직접 업데이트하지 않고, 저랭크 행렬 LoRA_A·LoRA_B만 학습.

> [!causal] 인과 관계
> [[lora]] →(가능하게 함)→ [[fine-tuning]]의 효율적 수행
> 신뢰도: 높음 | 출처: [[lora-explained]]

## 관련
[[fine-tuning]], [[transformer]], [[quantization]]

Step 4: グラフの構築 (MCPツール)

チャットで以下を実行:

"위키 그래프 재빌드해줘"

→ rebuild_graph ツールが呼び出され、wiki/ 内のMarkdownからWikiリンクと因果関係を解析して graph.json を生成します。

Step 5: ナレッジの探索 (MCPツール)

グラフが作成されたので、探索が可能です:

"LoRA가 내 위키에서 어떤 위치야?"

→ explain_node("LoRA") を呼び出し:

## LoRA (Low-Rank Adaptation)
카테고리: concepts | 태그: Fine-Tuning, PEFT

### 위치 분석
- 연결도: 9 (상위 26%) → 중간 연결자
- 인과 역할: 기반 기술 — 다른 1개 개념을 가능하게 함

### 인과 요약
- LoRA →(가능하게 함)→ Fine-Tuning의 효율적 수행

### 성장 제안
- 인과 관계 callout 추가 권장 (현재 1개)
"위키 상태 어때?"

→ graph_summary() を呼び出し:

## 위키 건강 리포트

### 규모: 초기 단계
- 실제 페이지: 5개 (concepts 2, sources 1, entities 1)
- 밀도: 2.4 엣지/노드 → 낮은 밀도 — 위키링크 추가 권장

### 약점
- 미해결 노드 3개 (37.5%)
- 인과 비율 5.0% — callout 추가 권장

### 다음 행동
1. 미해결 페이지 생성: transformer(2연결), quantization(1연결)

特徴

  • 🔗 Wikiリンク + 因果関係 に基づくナレッジグラフの自動構築

  • 🧠 意味解釈 — 単なる「接続数9」ではなく「上位26%のハブ」といった文脈分析

  • 📊 健全性診断 — Wikiの強み/弱み/次のアクションを具体的に提案

  • ⚡ 因果チェーンの追跡 — 概念間の「なぜ」というつながりを上流/下流で分析

  • 🔌 MCP標準 — Claude Desktop、Cursor、Kiro、VS Codeなどどこでも動作

ツール一覧

ツール

説明

呼び出し元

explain_node

ノードプロファイル — 位置分析、因果的役割、成長の提案

LLMが自動呼び出し

find_path

2つの概念間の最短経路 — 接続強度、媒介ノードの解釈

LLMが自動呼び出し

causal_chain

因果ネットワーク — 上流/下流、関係の自然言語解釈

LLMが自動呼び出し

graph_summary

Wiki健全性レポート — 規模、密度、アクション提案

LLMが自動呼び出し

rebuild_graph

グラフの再構築 — Markdown変更後の更新

LLMが自動呼び出し

注意: Wikiページの作成/修正はMCPツールではなく、LLMが直接ファイルに書き込みます。 brainforge-mcpは「読み取り + 分析」に特化しており、「書き込み」はLLMの役割です。

因果関係の表記

Wikiリンク([[]])は接続のみを表現します。「なぜ」つながるのかは、因果関係のcalloutで明示します:

> [!causal] 인과 관계
> [[메타러닝]] →(가능하게 함)→ [[DiscoRL]]의 RL 규칙 자동 발견
> 신뢰도: 높음 | 출처: [[discovering-sota-rl-algorithms]]

サポートされている関係タイプ:

  • →(可能にする)→ / →(性能向上)→ / →(性能低下)→

  • →(基盤となる)→ / →(発展させる)→ / →(代替する)→

  • →(含む)→ / →(適用される)→

既存のObsidianボルトへの適用

すでにObsidianを使用している場合は、ボルト内に wiki/ フォルダを作成し、--vault オプションで指定すればOKです。既存の [[Wikiリンク]] を自動的に解析します。

ライセンス

MIT


Inspired by Andrej Karpathy's LLM Wiki idea.

Available Tools

5 tools
causal_chainC

특정 노드와 관련된 모든 인과 관계를 조회한다.

Inputs: query (required). Returns: result

explain_nodeC

노드의 상세 정보와 연결 관계를 조회한다. 노드 이름이나 ID의 일부를 입력하면 해당 노드의 카테고리, 파일 경로, 태그, 나가는/들어오는 엣지 목록을 반환한다.

Inputs: query (required). Returns: result

find_pathB

두 노드 사이의 최단 경로를 BFS로 탐색한다.

Inputs: start (required), end (required). Returns: result

graph_summaryB

현재 위키 그래프의 전체 요약 통계를 반환한다.

Inputs: no named parameters. Returns: result

rebuild_graphB

위키 마크다운을 파싱하여 그래프를 재빌드한다.

Inputs: no named parameters. Returns: result

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    TDQS

    A3.5/5.0

    Scored across 5 tools

    Disambiguation5/5

    Each tool has a clearly distinct purpose with no overlap: causal_chain retrieves causal relationships, explain_node provides node details, find_path finds paths between nodes, graph_summary gives overall statistics, and rebuild_graph rebuilds the graph. An agent can easily tell them apart based on their specific functions.

    Naming Consistency5/5

    All tool names follow a consistent snake_case pattern with clear verb_noun structures (e.g., causal_chain, explain_node, find_path, graph_summary, rebuild_graph). The naming is uniform and predictable throughout the set.

    Tool Count5/5

    With 5 tools, the count is well-scoped for a wiki graph management server. Each tool serves a distinct and necessary function, covering key operations like querying, explaining, pathfinding, summarizing, and rebuilding without being excessive or insufficient.

    Completeness4/5

    The tool set provides strong coverage for core wiki graph operations, including querying nodes and relationships, pathfinding, and graph maintenance. A minor gap exists in update or delete operations for nodes or edges, but agents can work around this using rebuild_graph for modifications.

    Maintenance

    ActivityInactive
    ResponsivenessNo recent community issues

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      C
      quality
      F
      maintenance
      An MCP server that integrates the zk note-taking system with LLMs, enabling users to search, read, create, and manage notes. It provides tools for link analysis, tag management, and complex note queries to interact with local knowledge bases.
      5
      1
      MIT
    • A
      license
      Not graded
      quality
      D
      maintenance
      An MCP server that treats Obsidian vaults as knowledge graphs, enabling AI agents to traverse wikilinks, assemble token-budgeted context, and search with backlink awareness.
      3 npm
      1
      MIT
    • A
      license
      Not graded
      quality
      D
      maintenance
      MCP server for persistent, compounding markdown wikis maintained by LLMs. Enables incremental knowledge base building with interlinked pages, search, and raw source management.
      1
      MIT
    • A
      license
      Not graded
      quality
      C
      maintenance
      MCP server that turns a Markdown folder (e.g. Obsidian vault) into a second brain, capturing readings and ideas, connecting them as concepts, and resurfacing related notes on demand.
      47 npm
      MIT