MCPcopy Index your code
hub / github.com/davidkingzyb/SCAST

github.com/davidkingzyb/SCAST @main

Chat with this repo
repository ↗ · DeepWiki ↗ · + Follow
1,910 symbols 4,662 edges 27 files 141 documented · 7%
What it actually does AI analysis from the code graph — generated when you open this
loading…
README

🔱SCAST

代码静态分析可视化工具

2026/3/6 by DKZ

English/中文

🔱SCAST 可以将输入的代码转换为UML图和流程图,可用作整理流程架构,输出文档图表。

📺视频
📺教程
📺MCP

多种语言支持 - csharp - javascript - python - typescript - c - cpp - 使用 TreeSitter 你可以找到更多语言解析器,或定制自己的语言.

原理是将输入代码整理为AST树并对其进行静态分析,最后输出使用MermaidD3 输出可视化图表.

可以使用在线版本 online 或者下载源码双击SCAST.html文件在浏览器中使用.
对于开发者可使用 npm run server 将它部署在服务器中. 或者作为 MCP server 使用将它集成到你的 AI 客户端中.

scast_uml

MCP

mcp

  1. git clone https://github.com/davidkingzyb/SCAST.git 下载源码.
  2. npm install
  3. 在你的客户端设置
{
  "mcpServers": {
    "scast":{
      "command":"node",
      "args":[
        "/YOUR_INSTALL_DIR/SCAST/mcp/index.js",
        "/YOUR_WORKSPACE/",
        "C:\\Users\\DKZ\\OTHER_ALLOWED_DIR\\",
      ]
    }
  }
}

工具

scast_analysis:

SCAST 是一个帮助用户分析总结代码并将可视化的工具. 只需要提供源代码所在的文件夹路径, SCAST 会对文件夹下的源代码做静态分析,生成 AST 树, 帮助用户理解代码结构,解释代码的功能. 生成一系列的可视化图表, 如 UML 类图, AST tree 图 以及 Mermaid flowchart 图等. 最后返回一个keyword列表,包含所有类和方法名称和其功能解释,并附一个连接, 让用户在浏览器中查看图表详情.

scast_retriever

SCAST 是一个帮助用户分析总结代码并将可视化的工具. 需要提供源代码所在的文件夹路径, SCAST 会对文件夹下的源代码做静态分析,生成 AST 树, 帮助用户理解代码结构, 解释代码的功能. 使用 SCAST 分析完代码目录之后, 可以通过提供关键字在 AST 树中进行检索,用 RAG 的方法更好的回答用户的提问. 这个关键字可以是类名,方法名,或者是字段名称. SCAST 会找到其定义处的源代码并返回.

Ollama AI

请先安装ollama
ai.js中查看更多详情

ollama

Extension points exported contracts — how you extend this code

IAnimal (Interface)
(no doc) [2 implementers]
test/test.ts
ISpeak (Interface)
1. 接口 (interface)
test/test.cs

Core symbols most depended-on inside this repo

getChildByType
called by 87
js/TreeSitter.js
finishNode
called by 47
lib/filbert.js
marshalNode
called by 42
lib/TreeSitter/web-tree-sitter.js
startNode
called by 38
lib/json-viewer.bundle.js
raise
called by 37
lib/filbert.js
kw
called by 35
lib/acorn.js
next
called by 34
lib/filbert.js
is_punc
called by 33
js/SCAST.js

Shape

Function 1,405
Method 409
Class 94
Interface 2

Languages

TypeScript98%
Python1%
C#1%

Modules by API surface

lib/d3.min.js839 symbols
lib/TreeSitter/web-tree-sitter.js220 symbols
lib/json-viewer.bundle.js159 symbols
lib/highlight.min.js99 symbols
lib/filbert.js74 symbols
lib/SCASTPY.min.js65 symbols
js/SCASTPY.js65 symbols
lib/SCAST.min.js59 symbols
js/SCAST.js59 symbols
lib/acorn.js52 symbols
js/common.js38 symbols
test/test.ts20 symbols

For agents

$ claude mcp add SCAST \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact