Skip to main content
Glama

🚦 分支思维 MCP 工具

变更日志 问题 Node.jsTypeScript微胶囊钙MIT 许可证@dagrejs/graphlibml-k均值lru缓存@xenova/变形金刚@modelcontextprotocol/sdk粉笔美人鱼下午

新功能 (2025-04):

  • 高级可视化:聚类(k-means/度)、中心性覆盖、边缘捆绑以及任务和优先级的代理覆盖

  • 代理缓存和预取:用于嵌入、摘要、分析和主动代理缓存预热的 LRU+TTL 缓存

  • 增强分析:实时、多分支和 focusNode 支持;代理优化元数据

  • 为代理和用户升级文档和入职培训


特征

  • 🌳**分支管理:**创建、聚焦和导航多条思路

  • 🔗**交叉引用:**跨分支链接相关想法(输入、评分)

  • 💡 **AI Insights:**自动洞察和摘要生成

  • 🧠**语义搜索:**使用嵌入查找相关想法

  • 📊高级可视化:

    • 节点聚类(k-means/度)

    • 中心性覆盖(接近度、中介度)

    • 边缘捆绑

    • 任务覆盖(状态、优先级、下一步行动)

    • 所有节点/边的代理覆盖和元数据

    • FocusNode 和多分支可视化

  • Agentic 缓存和预取:

    • 用于嵌入、摘要、分析的 LRU+TTL 缓存

    • 代理工作流程的主动缓存预热

  • 🗂️**持久存储:**可查询、可扩展,并且永远不会丢失任何想法

  • 🔄**实时和多分支:**实时可视化和分析多个分支和节点

  • 🛠️**生产级:**强大的错误处理、性能优化以及代理/人性化的 API


Related MCP server: Thought Space - MCP Advanced Branch-Thinking Tool

🛠️ 技术栈

  • Node.js (18 岁以上)

  • TypeScript (4.x)

  • @dagrejs/graphlib :图形结构、算法和分析

  • ml-kmeans :可视化聚类

  • lru-cache :用于嵌入、摘要、分析的 LRU+TTL 缓存

  • @xenova/transformers :嵌入和摘要管道

  • @modelcontextprotocol/sdk :MCP 协议和代理集成

  • chalk :CLI 输出样式

  • 美人鱼:甘特图/路线图可视化

  • pnpm :快速依赖管理


路线图(甘特图)

gantt
    title Branch-Thinking MCP Roadmap (2025)
    dateFormat  YYYY-MM-DD
    section Q2 2025
    Advanced Visualization/Analytics :done,      vis1, 2025-04-01,2025-04-20
    Agentic Cache & Prefetch         :done,      cache1, 2025-04-10,2025-04-22
    Enhanced Agentic Docs            :done,      doc1, 2025-04-15,2025-04-25
    Real-time Collaboration          :active,    collab1, 2025-04-20,2025-06-01
    Web Visualization Dashboard      :active,    webviz1, 2025-04-25,2025-06-15
    section Q3 2025
    Plugin System                    :planned,   plugin1, 2025-06-15,2025-07-15
    Mobile/Tablet UI                 :planned,   mobile1, 2025-07-01,2025-08-01
    AI Branch Merging                :planned,   merge1, 2025-07-15,2025-08-15
    Knowledge Base Sync              :planned,   sync1, 2025-08-01,2025-09-01

目录


为什么要采用分支思维?

  • **Agentic 设计:**专为人类和 AI 工作流程打造 - 每个命令都对代理友好。

  • **真正的分支:**并行组织、交叉链接和推理想法、代码和任务。

  • **AI-Native:**开箱即用的语义搜索、自动摘要和洞察生成。

  • **持久且可视化:**永远不会失去任何想法——一切都是可查询的、可可视化的和可扩展的。

概括

Branch-Thinking MCP 工具是一个先进的代理平台,用于管理、可视化和推理分支思维、任务、代码和知识。它使 AI 代理和人类能够使用强大的基于分支的范式来组织复杂的项目、交叉链接想法并自动生成洞察。凭借语义搜索、可视化和持久任务/代码管理功能,它专为下一代协作和自主工作流而设计。

Branch-Thinking MCP 工具是一个先进的代理平台,用于管理、可视化和推理分支思维、任务、代码和知识。它使 AI 代理和人类能够使用强大的基于分支的范式来组织复杂的项目、交叉链接想法并自动生成洞察。凭借语义搜索、可视化和持久任务/代码管理功能,它专为下一代协作和自主工作流而设计。


架构与流程

flowchart TD
    User([User/Agent 🤖])
    CLI([CLI/API])
    BM[BranchManager 🧠]
    EmbCache[[Embedding/Summary Cache]]
    Storage[(Persistent Storage 💾)]
    Viz([Visualization/Analytics])
    Tasks([Task Extraction])
    Snippets([Code Snippet Storage])

    User-->|Commands/Queries|CLI
    CLI-->|Manage/Query|BM
    BM-->|Cache|EmbCache
    BM-->|Save/Load|Storage
    BM-->|Visualize|Viz
    BM-->|Tasks|Tasks
    BM-->|Snippets|Snippets
    BM-->|Results|CLI
    CLI-->|Output|User

快速入门

几秒钟内即可启动并运行:

pnpm install  # Recommended for speed (or npm install)
pnpm build
node dist/index.js --help  # See available commands

入门

1. 克隆并安装

git clone https://github.com/your-org/branch-thinking-mcp.git
cd branch-thinking-mcp
pnpm install  # Or npm install
pnpm build   # Or npm run build

2.配置(可选)

对于 Claude Desktop 集成,请添加到您的claude_desktop_config.json

"branch-thinking": {
  "command": "node",
  "args": [
    "/your-custom-mcp-dir-here/branch-thinking/dist/index.js"
  ]
}

3. 运行

node dist/index.js

实际使用方法

1. 知识捕获与链接

# Batch capture meeting notes
add-thought dev "Discussed semantic search improvements" note
add-thought dev "Agreed to refactor API" decision
# Link related thoughts
link-thoughts t1 t2 supports "API refactor supports search improvements"

2. 代理任务提取

# Extract and manage tasks from a research branch
extract-tasks research
list-tasks research open
update-task-status task-1 in_progress

3. 可视化洞察

# Generate and interpret a knowledge graph
visualize dev
# Review AI-generated summary
summarize-branch dev

🧑‍💻 实例:Agentic 工作流

# 1. Create a new branch for your project or idea
create-branch "AI Research"

# 2. Add thoughts and observations
add-thought [branchId] "Explore semantic search for agent workflows" analysis
add-thought [branchId] "Test cross-linking and summarization" observation

# 3. Link related thoughts
link-thoughts [thoughtId1] [thoughtId2] supports "Thought 2 validates Thought 1"

# 4. See your knowledge graph
visualize [branchId]

# 5. Extract tasks and get AI review
extract-tasks [branchId]
review-branch [branchId]

[branchId][thoughtIdX]替换为listhistory中的实际 ID。


命令参考

分支机构管理

命令

描述

list

显示所有分支及状态

focus [branchId]

将焦点切换到分支

history [branchId?]

显示思想历史

summarize-branch [branchId?]

分支机构的AI摘要

review-branch [branchId?]

分支机构的AI审查

visualize [branchId?]

连接可视化图表

思想与洞察管理

命令

描述

insights [branchId?]

获取人工智能生成的洞察

crossrefs [branchId?]

显示交叉引用

hub-thoughts [branchId?]

列出中心想法

semantic-search [query]

寻找类似的想法

link-thoughts [from] [to] [type] [reason?]

链接两个想法

add-snippet [content] [tags]

保存代码片段

snippet-search [query]

搜索代码片段

doc-thought [thoughtId]

记录一个想法

任务管理

命令

描述

extract-tasks [branchId?]

提取可操作的项目

list-tasks [branchId] [status] [assignee] [due]

列出/过滤任务

update-task-status [taskId] [status]

更新任务状态

summarize-tasks [branchId]

总结任务

人工智能与知识

命令

描述

ask [question]

知识库的AI答案

最佳实践

  • 始终从create-branch开始以确保上下文清晰。

  • 使用listfocus在项目或思路之间进行导航。

  • 利用summarize-branch和添加一些想法后的insights来获取 AI 生成的上下文。

  • 使用link-thoughts明确地连接想法、任务或代码,以获得更丰富的语义图。

  • 代码更改后,始终运行pnpm lintpnpm build以尽早发现错误。

  • 将复杂的目标分解为一系列的思想/任务/洞察命令。

  • 迭代和调整:使用摘要、评论和可视化的反馈来改进下一步行动。

  • 明确指定参数(branchId、status、assignee等)以获得精确的结果。

  • 使用交叉引用和多跳链接来培养创造力和沟通思想。

  • 提示代理(Claude、GPT-4 等)“逐步思考”或“使用思路链”以获得最佳结果。

安全

  • 所有持久数据都存储在本地(默认:项目目录或MCP_STORAGE_PATH

  • 除非配置,否则无外部 API 调用

  • 代理/用户负责存储想法和任务的隐私

  • 要报告安全问题,请打开问题或向维护人员发送电子邮件。

故障排除和常见问题解答

**问:该工具没有响应!**答:检查 MCP 服务器日志并确保配置正确。

**问:如何重置存储?**答:删除或移动持久存储目录(参见配置)。

**问:如何添加新命令?**答:在src/index.ts中扩展handleCommand并在 README 中记录。

可访问性和国际化

  • 所有徽章/图像都有描述性替代文本。

  • 英语是默认语言;欢迎提供翻译贡献。

  • 如果您想帮助本地化此工具,请打开 PR 或问题。

贡献

欢迎贡献代码、提交问题和功能请求!请在 GitHub 上提交 PR 或问题。

  1. Fork此仓库

  2. 创建新分支( git checkout -b feature/your-feature

  3. 提交你的更改

  4. 推送到分支

  5. 打开拉取请求

参考文献和相关项目


致谢

  • 概念与测试: @ssdeanx

  • 核心代码生成: Claude、GPT-4 和 Cascade

  • 实施、修复和文档: @ssdeanx


执照

麻省理工学院

Available Tools

1 tool
branch-thinkingC

Branch-Thinking Tool

Purpose: Use branching commands to create, navigate, and analyze thought branches and tasks.

Usage: Provide a JSON payload with 'type' and relevant parameters in 'args' object. The tool returns an array of items in the format { type: string, text: string }.

Supported Commands:

  • create-branch: { type: 'create-branch', branchId }

  • focus: { type: 'focus', branchId }

  • add-thought: { type: 'add-thought', branchId, content }

  • semantic-search: { type: 'semantic-search', query, topN? }

  • extract-tasks: { type: 'extract-tasks', branchId? }

  • visualize: { type: 'visualize', branchId?, options? }

  • list-branches: { type: 'list-branches' }

  • history: { type: 'history', branchId }

  • insights: { type: 'insights', branchId }

  • crossrefs: { type: 'crossrefs', branchId }

  • hub-thoughts: { type: 'hub-thoughts', branchId }

  • link-thoughts: { type: 'link-thoughts', fromThoughtId, toThoughtId, linkType, reason? }

  • add-snippet: { type: 'add-snippet', content, tags, author? }

  • snippet-search: { type: 'snippet-search', query, topN? }

  • summarize-branch: { type: 'summarize-branch', branchId? }

  • doc-thought: { type: 'doc-thought', thoughtId }

  • review-branch: { type: 'review-branch', branchId? }

  • ask: { type: 'ask', question }

  • summarize-tasks: { type: 'summarize-tasks', branchId? }

  • advance-task: { type: 'advance-task', taskId, status }

  • assign-task: { type: 'assign-task', taskId, assignee }

  • reset-session: { type: 'reset-session' }

  • clear-cache: { type: 'clear-cache' }

  • get-cache-stats: { type: 'get-cache-stats' }

Visualization Options:

  • clustering: { type: 'clustering', algorithm? }

  • centrality: { type: 'centrality', metric? }

  • overlays: { type: 'overlays', features? }

  • analytics: { type: 'analytics', metrics? }

Example Calls and Expected Responses:

// Add a thought
{ "name": "branch-thinking", "args": { "type": "add-thought", "branchId": "research", "content": "Define MCP best practices" } }
// →
[{"type":"text","text":"Thought added to branch research."}]
// Get insights
{ "name": "branch-thinking", "args": { "type": "insights", "branchId": "research" } }
// →
[{"type":"text","text":"Insights for branch research: ['Best practices cluster around workflow safety and semantic search.', 'Cross-references indicate high reuse of planning patterns.']"}]
// Get cross-references
{ "name": "branch-thinking", "args": { "type": "crossrefs", "branchId": "research" } }
// →
[{"type":"text","text":"Cross-references for branch research: [{ from: 't1', to: 't3', type: 'supports', reason: 't1 evidence for t3' }, { from: 't2', to: 't4', type: 'related' }]"}]
// Extract tasks
{ "name": "branch-thinking", "args": { "type": "extract-tasks", "branchId": "research" } }
// →
[{"type":"text","text":"Tasks extracted: [{ id: 'task-123', content: 'Document MCP safety rules', status: 'open' }]"}]
// Summarize tasks
{ "name": "branch-thinking", "args": { "type": "summarize-tasks", "branchId": "research" } }
// →
[{"type":"text","text":"Task summary: 1 open, 2 in progress, 0 closed."}]
// Advance a task
{ "name": "branch-thinking", "args": { "type": "advance-task", "taskId": "task-123", "status": "in_progress" } }
// →
[{"type":"text","text":"Task task-123 status updated to in_progress."}]
// Assign a task
{ "name": "branch-thinking", "args": { "type": "assign-task", "taskId": "task-123", "assignee": "alice" } }
// →
[{"type":"text","text":"Task task-123 assigned to alice."}]
// Semantic search
{ "name": "branch-thinking", "args": { "type": "semantic-search", "query": "workflow planning", "topN": 3 } }
// →
[{"type":"text","text":"Top 3 semantic matches for 'workflow planning' returned."}]
// Link thoughts
{ "name": "branch-thinking", "args": { "type": "link-thoughts", "fromThoughtId": "t1", "toThoughtId": "t2", "linkType": "supports" } }
// →
[{"type":"text","text":"Linked thought t1 to t2 as 'supports'."}]
// Summarize branch
{ "name": "branch-thinking", "args": { "type": "summarize-branch", "branchId": "research" } }
// →
[{"type":"text","text":"Summary for branch research: ..."}]
// Review branch
{ "name": "branch-thinking", "args": { "type": "review-branch", "branchId": "research" } }
// →
[{"type":"text","text":"Branch research reviewed. 2 suggestions found."}]
ParametersJSON Schema
NameRequiredDescriptionDefault
contentNoThought content (string) or batch of thoughts (array of objects).
branchIdNoBranch ID to associate with the thought(s). If omitted, a new branch may be created or the active branch used.
parentBranchIdNoOptional: ID of the parent branch for hierarchical organization.
typeNoThought type: e.g., 'analysis', 'hypothesis', 'observation', 'task', etc. Used for filtering and scoring.
confidenceNoOptional: Confidence score (0-1) for the thought, for ranking or filtering.
keyPointsNoOptional: Key points or highlights extracted from the thought.
relatedInsightsNoOptional: IDs of related insights, for semantic linking.
crossRefsNoOptional: Array of cross-references to other branches, with type, reason, and strength.
commandNoOptional: Navigation or workflow command. Used for agentic/AI interactions.

TDQS

C2.8/5.0
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations provided, the description carries full burden for behavioral disclosure. While it lists commands and shows example responses, it lacks critical behavioral details: no information about permissions needed, whether operations are destructive, rate limits, error handling, or persistence behavior. The examples show return formats but don't explain system behavior comprehensively.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness3/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is well-structured with clear sections (Purpose, Usage, Supported Commands, Visualization Options, Examples). However, it's overly verbose with extensive example calls that could be condensed. The front-loaded purpose is clear, but the length could be optimized for better conciseness.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the tool's complexity (9 parameters, nested objects, no output schema, no annotations), the description is incomplete. While it documents commands and shows examples, it lacks crucial context about system behavior, error conditions, authentication requirements, and operational constraints. For such a sophisticated tool with multiple command types, more comprehensive documentation is needed.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100%, providing good documentation of all 9 parameters. The description adds some value by listing specific command types and their parameters in the 'Supported Commands' section, but this largely duplicates what's in the schema's command object. It doesn't provide additional semantic context beyond what the schema already documents well.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the tool's purpose as 'to create, navigate, and analyze thought branches and tasks' with specific verbs and resources. However, since there are no sibling tools mentioned, it cannot demonstrate differentiation from alternatives, preventing a perfect score.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides basic usage instructions ('Provide a JSON payload with type and args') but offers no guidance on when to use specific commands versus alternatives, no context about prerequisites, and no exclusions. It lists commands without explaining their appropriate contexts.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

TDQS

B3.2/5.0
Disambiguation5/5

The single tool 'branch-thinking' has no other tools to be confused with, so disambiguation is perfect. All functionality is contained within one tool, eliminating any possibility of misselection between multiple tools.

Naming Consistency5/5

With only one tool named 'branch-thinking', naming consistency is inherently perfect. There are no other tool names to compare against, so no inconsistency can exist in the tool set.

Tool Count2/5

The server has only one tool despite offering extensive functionality (over 20 commands). This is a significant mismatch as the domain suggests a need for multiple specialized tools (e.g., separate tools for branch management, task operations, search, etc.). A single tool forces all operations through one interface, which is inappropriate for the apparent scope.

Completeness5/5

The tool provides comprehensive coverage for thought branching and task management, including creation, navigation, analysis, visualization, task extraction, assignment, and various utility functions. No obvious gaps exist; it supports full lifecycle operations for branches, thoughts, and tasks within its domain.

Maintenance

ActivityInactive
ResponsivenessNo issues

Resources

Unclaimed servers have limited discoverability.

Looking for Admin?

If you are the server author, to access and configure the admin panel.

Related MCP Connectors

Related MCP Servers

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/ssdeanx/branch-thinking-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server