Token导航 LogoToken导航TokenDH.com
Bear Wisdom logo
开发工具未说明官方级别未说明来源级核验

Bear Wisdom

MCP Server

BearWisdom是一个代码智能引擎,能够构建对代码库的结构化理解,并通过CLI、MCP服务器、Web UI和Claude Code代理提供快速搜索和分析功能。

工具数

0

提示词数

0

GitHub Stars

1

资源数

0
代码分析代码导航RustClaudeClaude

安装说明

本站只整理中文说明和来源信息,不托管安装包,也不代用户安装。

作者 / 组织

MariusAlbu

提供方

MariusAlbu

最后核验

2026/5/17 20:19

快速接入

先看主来源和安装命令,再打开仓库或文档;下面只保留这个条目的关键接入事实。

详细介绍

BearWisdom

Structural code intelligence that's un-bear-ably fast.

31 languages. Cross-framework graph. Hybrid search. One index.

Features · Quick Start · Web Explorer · CLI Reference · Architecture · MCP Server · Benchmarks

______________________________________________________________________

这是什么?

熊智慧是 代码智能引擎 它构建了对整个代码库的结构理解——符号、边、调用层次结构、概念和跨语言流——并使其在毫秒内可搜索。

它通过以下方式解析您的代码 树保姆,将所有内容存储在本地SQLite图形数据库中,并通过CLI、MCP服务器、web UI和Claude Code代理公开结果。把它想象成一只熊,它和你的代码库一起冬眠,醒来时知道一切都在哪里。

为什么是“熊智慧”? 因为理解代码不需要 *灰熊* 努力让熊来抬重物。

特性

熊的必需品

  • 31种语言 --C#、TypeScript、JavaScript、Python、Rust、Go、Java、C/C++、Ruby、PHP、Kotlin、Swift、Scala、Haskell、Elixir、Dart、Lua、R、HTML、CSS、JSON、YAML、Bash、SQL、Markdown、XML、Dockerfile等
  • 结构图 --存储在SQLite中的符号、边(调用、继承、实现、type_ref、实例化)、概念和注释
  • 5优先级分解器 --命名空间导入、范围分析、限定名匹配、文件路径关联和基于类型的推理
  • 跨框架连接器 --Spring Boot,Django。NET DI、EF Core、gRPC、GraphQL、Electron IPC、Tauri IPC、React/Zustand和HTTP API路由
  • 智能上下文 --用自然语言描述任务,并获取与之最相关的排名符号和文件,为LLM上下文窗口做好准备
  • 完整跟踪 --端到端执行流跟踪,从任何符号或自动检测的入口点遍历调用图和跨框架流边缘(DI、HTTP、事件)
  • 流动可视化 --web资源管理器中的Sankey图显示了具有点击到引脚突出显示、深度控制和特定符号跟踪的架构流

难以置信的搜索

  • FTS5符号搜索 --BM25对所有符号名称和限定名称的全文搜索进行了排名
  • 模糊查找器 --文件(Ctrl+P)和符号(Ctrl+T)的核动力模糊匹配
  • 内容搜索 --FTS5三元组索引,用于跨文件内容的子字符串搜索
  • grep --具有范围过滤的gitignore感知正则表达式/文字搜索
  • 混合搜索 --通过互易秩融合融合FTS5+ONNX矢量嵌入
  • 语义搜索 --通过CodeRankEmbed嵌入进行自然语言查询

极化分析

  • 架构概述 --语言分解、热点检测、入口点发现
  • 爆炸半径 --“如果我更改X,什么会中断?”通过递归CTE图遍历
  • 调用层次结构 --具有边缘来源的呼入和呼出呼叫链
  • 完整跟踪 --从入口点到调用链和跨框架流边缘(DI、HTTP、事件、IPC)的端到端执行跟踪
  • 智能上下文 --LLM上下文窗口的排序符号的自然语言任务描述(多策略种子:FTS5原始、按关键字、LIKE回退)
  • 概念发现 --带成员分配的自动命名空间分组
  • 子图导出 --D3/Cytoscape可视化的过滤图导出

互动方式

接口说明
bw 命令行界面30多个用于脚本和代理的JSON输出命令
Web资源管理器基于Sankey流程图的React+D3力导向知识图
MCP 服务器Claude和其他LLM的模型上下文协议服务器
克劳德代码代理包装CLI的会话子代理

快速开始

先决条件

  • 1.75+(2021年版)
  • Node.js 18+(适用于网络浏览器,可选)
  • ONNX 运行时 (AI搜索/语义嵌入所需)

- 通过Python安装: pip install onnxruntime 并设置 ORT_DYLIB_PATHonnxruntime 该软件包内的共享库,或从下载独立版本 和点 ORT_DYLIB_PATHonnxruntime.dll / libonnxruntime.so / libonnxruntime.dylib - 没有 ORT_DYLIB_PATH 发动机正常启动,但 bw hybrid, bw embed,web UI中的AI搜索将返回错误

构建

# Clone the repo
git clone https://github.com/MariusAlbu/BearWisdom.git
cd BearWisdom

# Build all crates
cargo build --release

# The CLI binary is at:
./target/release/bw --help

为项目建立索引

# Full index with concept discovery + automatic embedding (if ORT_DYLIB_PATH is set)
bw open /path/to/your/project

# Check index stats
bw status /path/to/your/project

索引存储在 /.bearwisdom/index.db --一个SQLite文件。添加 .bearwisdom/ 到你的项目 .gitignore.

对于AI搜索, bw open 在索引后自动计算CodeRankEmbed嵌入 ORT_DYLIB_PATH 已设置。您还可以独立运行嵌入:

# Download the CodeRankEmbed model first (one time)
# Place it at 
/models/CodeRankEmbed  OR  ~/.bearwisdom/models/CodeRankEmbed

# Compute embeddings independently
bw embed /path/to/your/project

搜索

# Find symbols by name
bw search-symbols /path/to/project "ProductService"

# Fuzzy find files (like Ctrl+P)
bw fuzzy-files /path/to/project "ProdServ"

# Fuzzy find symbols (like Ctrl+T) — yes, it's *fuzzy*, like a bear
bw fuzzy-symbols /path/to/project "GetById"

# Grep across files
bw grep /path/to/project "TODO" --case-insensitive

# Content search (trigram, min 3 chars)
bw search-content /path/to/project "repository"

# Hybrid search (FTS + embeddings when model is available)
bw hybrid /path/to/project "authentication middleware"

导航

# Go to definition
bw definition /path/to/project "ProductService"

# Find all references
bw references /path/to/project "IProductRepository"

# List symbols in a file
bw file-symbols /path/to/project "Services/ProductService.cs"

# Full symbol detail
bw symbol-info /path/to/project "ProductService"

分析

# Architecture overview
bw architecture /path/to/project

# Blast radius — what breaks if I change this?
bw blast-radius /path/to/project "Product" --depth 3

# Who calls this?
bw calls-in /path/to/project "GetById"

# What does this call?
bw calls-out /path/to/project "PlaceOrder"

# Cross-language flow trace
bw trace-flow /path/to/project "Controllers/OrderController.cs" 45

概念

# Discover namespace concepts automatically
bw discover-concepts /path/to/project

# List concepts
bw concepts /path/to/project

# Show concept members
bw concept-members /path/to/project "MyApp.Services"

# Export graph filtered by concept
bw export-graph /path/to/project --filter "@MyApp.Services"

Web资源管理器

BearWisdom包括一个基于网络的知识图谱浏览器。这是一个React+D3应用程序,可以让你直观地探索结构图。

# Build the frontend (one time)
cd web && npm install && npm run build && cd ..

# Start the server
cargo run -p bearwisdom-web --release -- --static-dir web/dist

# Open http://localhost:3030

你能做什么

  • 浏览 您的文件系统,并选择一个项目进行索引
  • 探索 力导向知识图——拖动、缩放、平移、悬停以突出显示连接
  • 按概念筛选 --单击侧边栏中的概念以隔离该子图
  • 搜索6种方式 --符号、模糊、文件、内容、Grep和AI搜索选项卡
  • 启用AI搜索 --web UI有一个“启用AI搜索”按钮,可按需触发嵌入计算(需要 ORT_DYLIB_PATH 在服务器环境中设置)
  • 检查符号 --单击节点以查看其签名、文档、传入/传出呼叫
  • 查看源代码 --file/content/grep结果打开一个带有行突出显示的完整代码查看器
  • 调整细节面板的大小 --拖动左边缘为代码审查腾出空间
  • “流”选项卡 --Sankey图显示了跨代码库的端到端执行流。从特定符号或自动检测的入口点进行跟踪。单击节点以固定路径,悬停以探索连接。深度滑块控制轨迹深度。节点颜色表示符号类型(类、方法、接口)

发展

# Backend (auto-rebuilds on change)
cargo run -p bearwisdom-web -- --port 3030

# Frontend dev server (hot reload, proxies /api to :3030)
cd web && npm run dev
# Open http://localhost:5173

CLI参考

所有命令都将JSON输出到stdout。信封: {"ok": true, "data": {...}}{"ok": false, "error": "..."}.

全球标志: --full 恢复详细输出(签名、文档注释、子项)。

命令描述
`bw open
`全索引+概念发现+后索引嵌入
`bw status
`索引统计数据(只读)
`bw embed
`独立计算CodeRankEmbed嵌入
`bw architecture
`语言统计、热点、入口点
`bw search-symbols
`FTS5符号搜索
`bw fuzzy-files

|模糊文件查找器| | bw fuzzy-symbols

|模糊符号查找器| | bw search-content |FTS5三元组内容搜索| | bw grep

|正则表达式/文字grep| | bw hybrid |混合FTS+矢量搜索| | bw definition |转到定义| | bw references |查找所有参考文献| | bw file-symbols |文件中的符号| | bw symbol-info |完整的符号细节| | bw blast-radius |影响分析| | bw calls-in |来电层次结构| | bw calls-out |呼出层次结构| | bw trace-flow

|跨语言流| | bw full-trace [symbol] |端到端执行跟踪(调用图+流边)| | bw smart-context |LLM提示的智能上下文选择| | bw investigate |组合深潜(符号信息+呼叫者+被呼叫者+爆炸半径)| | bw complete-at

|范围感知符号完成| | bw diagnostics |文件诊断(未解析的引用、低置信度边)| | bw quality-check --baseline |根据质量基线进行回归测试| | bw import-scip --scip |导入SCIP指数以获得高置信度边缘| | bw concepts |列出概念| | bw discover-concepts |自动发现概念| | bw concept-members |概念成员| | bw export-graph ` |图形导出(JSON)|

建筑

架构图 以获得视觉概述。

bearwisdom/                    Core library — parser, indexer, query, search, bridge
  src/
    parser/                    Tree-sitter extractors (31 languages)
    indexer/                   Full + incremental indexing
    query/                     Architecture, blast radius, call hierarchy, full trace,
                               smart context, investigate, diagnostics, completion,
                               concepts, search, subgraph, definitions
    search/                    Grep, FTS5, fuzzy, hybrid, embeddings, vector store
    bridge/                    SCIP import, background enrichment
    connectors/                Cross-framework edge detection (Spring, Django, EF Core, etc.)
    db/                        SQLite schema, database management

bearwisdom-cli/                CLI binary (bw) — 30+ JSON commands
bearwisdom-mcp/                MCP server (bw-mcp) — tool registration
bearwisdom-web/                Web server (bw-web) — Axum HTTP + static files + Sankey flows
bearwisdom-profile/            Language detection, project scanning
bearwisdom-bench/              Benchmark harness

benchmarks/                    LLM benchmark runner (bw-bench) — API-based task evaluation
web/                           React + D3 frontend (Vite + TypeScript)
tests/                         Integration test suite
agents/                        Claude Code agent definitions

捆绑依赖关系

sqlite-vc 静态链接到BearWisdom二进制文件中。不 SQLITE_VEC_PATH 环境变量或外部 .dll/.so 需要——矢量搜索开箱即用。

ONNX 运行时 在运行时通过以下方式动态加载 load-dynamic 功能。集 ORT_DYLIB_PATH 在运行任何嵌入命令之前,请先访问共享库的路径。sqlite-vc处理存储;ONNX运行时处理推理。

数据库模式

SQLite数据库存储:

目的
files带有路径、语言、内容哈希和时间戳的索引文件
symbols提取的符号(名称、限定名、种类、线条、签名、文件注释)
edges有信心的定向关系(调用、继承、实现、type_ref、实例化)
unresolved_refs待LSP/SCIP决议的参考文献
imports每个文件导入/使用指令,由5优先级解析器使用
routes框架连接器提取的HTTP路由端点
db_mappingsEF核心实体到表的映射
symbols_fts用于BM25排名符号搜索的FTS5虚拟表
annotations符号上附有自由形式的标记注释
concepts使用auto_pattern进行成员资格匹配的命名空间分组
concept_members符号到概念的分配(手动和自动)
lsp_edge_metaLSP解析边缘来源
fts_content用于文件内容搜索的FTS5三元组虚拟表
code_chunksAST感知块与符号边界对齐,用于嵌入
flow_edges跨语言流边缘(TS→C#、gRPC客户端→服务器等)
search_history最近和已保存的搜索,包括查询类型和范围

MCP 服务器

BearWisdom提供了一个MCP(模型上下文协议)服务器,该服务器将所有功能作为Claude Code和其他LLM代理的工具公开。服务器在启动时在后台对项目进行索引,并使所有查询工具立即可用。

设置

# Build the MCP server (release recommended — it runs as a long-lived process)
cargo build --release -p bearwisdom-mcp

# Register it for a specific project
./target/release/bw-mcp register --project /path/to/your/project

这写了一个 bearwisdom 进入 /.mcp.json下次在该项目目录中打开Claude Code时,MCP服务器会自动启动。

手动使用

# Run standalone (indexes current directory by default)
./target/release/bw-mcp

# Run for a specific project
./target/release/bw-mcp --project /path/to/your/project

# Unregister from a project
./target/release/bw-mcp unregister --project /path/to/your/project

服务器使用JSON-RPC(MCP协议)通过stdio进行通信。启动时,它会在后台运行一个完整的索引——索引期间的工具调用会短暂阻塞,直到当前批处理完成。

克劳德代码代理

agents/bearwisdom.md agent允许您通过对话方式查询任何代码库:

> /bearwisdom

You: What's the architecture of this project?
Bear: Running bw architecture... [shows language stats, hotspots, entry points]

You: Who calls ProductService?
Bear: Running bw calls-in ProductService... [shows call hierarchy]

You: What would break if I change the Order model?
Bear: Running bw blast-radius Order --depth 3... [shows impact analysis]

项目结构

板条箱类型描述
bearwisdomlib核心引擎——31语言解析器、图形数据库、混合搜索
bearwisdom-cli垃圾箱(bw)具有30多个JSON命令的CLI
bearwisdom-mcp垃圾箱(bw-mcp)LLM代理的MCP服务器
bearwisdom-web垃圾箱(bw-web)Axum HTTP服务器+React UI
bearwisdom-profilelib语言检测、项目扫描
bearwisdom-benchbin指数基准
bw-benchbinLLM基准运行器(in benchmarks/)

基准测试

BearWisdom包括一个基准线束(bw-bench)其比较了三种条件下的代码智能质量:

  • 主控程序:通过MCP协议的BearWisdom工具
  • 命令行界面:BearWisdom工具通过 bw CLI命令
  • 本土的:仅限标准读取/Grep/Glob工具

在4个项目(eShop、SimplCommerce、go-gitea、react-calcom)中进行了测试,每个项目有10个任务,涵盖6个类别:符号查找、跨文件引用、调用层次结构、影响分析、架构概述和代码导航。

# Generate tasks from a test project
bw-bench generate --project /path/to/project --output bench-results/tasks.json

# Run benchmarks (all conditions)
bw-bench run --tasks bench-results/tasks.json --model claude-sonnet-4-6 --output bench-results/

# Generate report
bw-bench report --results bench-results/

# Full pipeline (generate + run + report)
bw-bench full --project /path/to/project --model claude-sonnet-4-6 --output bench-results/

度量:精确度、召回率、F1、效率(惩罚工具调用计数)、令牌使用。需要 ANTHROPIC_API_KEY.

许可证

MIT许可证。看 许可证-麻省理工学院 了解详情。

______________________________________________________________________

Built with the patience of a bear and the precision of tree-sitter.

May your searches always be fuzzy in the right way. 🐻

目录标签

目录标签

代码分析代码导航RustClaude本地部署智能搜索结构理解跨语言支持

支持客户端

Claude

接入字段

传输方式(transport,传输协议)

未说明

鉴权方式(authType,认证方式)

none

工具数量(toolCount,工具数)

0

资源数量(resourceCount,资源数)

0

提示词数量(promptCount,提示词数)

0

权限和风险

未说明none部署方式未说明

接入前请确认传输方式、认证方式和部署位置,并根据实际工具能力限制访问范围。

安装前确认

不要直接授予不必要的文件、网络或账号权限;先核对安装命令和配置内容。

仍需确认:installCommand

来源信息

继续浏览同类 MCP