SCAST MCP server

Static Code Analysis and Visualization. Convert Code to UML and Flow Diagram and explain by AI.
Back to servers
Setup instructions
Provider
David King
Release date
Mar 22, 2025
Language
TypeScript
Stats
24 stars

This MCP server transforms source code into UML diagrams and flowcharts through static analysis, helping you visualize and understand code structure more effectively.

Installation

To set up the SCAST MCP server:

  1. Clone the repository:

    git clone https://github.com/davidkingzyb/SCAST.git
    
  2. Navigate to the project directory and install dependencies:

    cd SCAST
    npm install
    
  3. Configure the MCP server in your AI client:

    {
      "mcpServers": {
        "scast": {
          "command": "node",
          "args": [
            "/YOUR_INSTALL_DIR/SCAST/mcp/index.js",
            "/YOUR_WORKSPACE/",
            "C:\\Users\\DKZ\\OTHER_ALLOWED_DIR\\"
          ]
        }
      }
    }
    

    Replace the paths with your actual installation directory and the directories containing code you want to analyze.

Usage

Running as a Server

You can run SCAST as a standalone server:

npm run server

Alternatively, you can use it directly in your browser by opening the SCAST.html file after downloading the repository.

MCP Tools

SCAST provides two main tools through its Model Context Protocol implementation:

scast_analysis

This tool analyzes and summarizes code through visualization:

  • Performs static analysis on your code
  • Generates AST (Abstract Syntax Tree) representations
  • Creates visual charts including UML diagrams and flowcharts
  • Returns a keyword list with class and method names plus explanations
  • Provides a link to view detailed charts in your browser

scast_retriever

This tool helps with code analysis and retrieval:

  • Performs static analysis on your source code folder
  • Enables keyword-based searching through the AST tree
  • Uses a RAG (Retrieval-Augmented Generation) method to answer questions
  • Can find source code at the definition point of a class, method, or field name

Supported Languages

SCAST currently supports:

  • JavaScript (using acorn parser)
  • TypeScript (using TypeScript compiler)
  • C# (using a custom parser)
  • Python (using a custom parser)

Visualization Types

The tool provides multiple visualization options:

  • UML diagrams
  • Mermaid flowcharts
  • Force Directed Graphs
  • Multiple D3 graph types:
    • Indented tree
    • Tidy tree
    • Cluster tree
    • Radial tidy tree
    • Radial cluster tree
    • Force directed tree
    • Edge bundling

Integration with Ollama

SCAST can be integrated with Ollama AI:

  1. Install Ollama
  2. See the AI integration details in the js/ai.js file

This integration enhances the code analysis capabilities by leveraging AI to better understand and explain the code structure.

How to install this MCP server

For Claude Code

To add this MCP server to Claude Code, run this command in your terminal:

claude mcp add-json "scast" '{"command":"node","args":["/YOUR_INSTALL_DIR/SCAST/mcp/index.js","/YOUR_WORKSPACE/","C:\\Users\\DKZ\\OTHER_ALLOWED_DIR\\"]}'

See the official Claude Code MCP documentation for more details.

For Cursor

There are two ways to add an MCP server to Cursor. The most common way is to add the server globally in the ~/.cursor/mcp.json file so that it is available in all of your projects.

If you only need the server in a single project, you can add it to the project instead by creating or adding it to the .cursor/mcp.json file.

Adding an MCP server to Cursor globally

To add a global MCP server go to Cursor Settings > Tools & Integrations and click "New MCP Server".

When you click that button the ~/.cursor/mcp.json file will be opened and you can add your server like this:

{
    "mcpServers": {
        "scast": {
            "command": "node",
            "args": [
                "/YOUR_INSTALL_DIR/SCAST/mcp/index.js",
                "/YOUR_WORKSPACE/",
                "C:\\Users\\DKZ\\OTHER_ALLOWED_DIR\\"
            ]
        }
    }
}

Adding an MCP server to a project

To add an MCP server to a project you can create a new .cursor/mcp.json file or add it to the existing one. This will look exactly the same as the global MCP server example above.

How to use the MCP server

Once the server is installed, you might need to head back to Settings > MCP and click the refresh button.

The Cursor agent will then be able to see the available tools the added MCP server has available and will call them when it needs to.

You can also explicitly ask the agent to use the tool by mentioning the tool name and describing what the function does.

For Claude Desktop

To add this MCP server to Claude Desktop:

1. Find your configuration file:

  • macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
  • Windows: %APPDATA%\Claude\claude_desktop_config.json
  • Linux: ~/.config/Claude/claude_desktop_config.json

2. Add this to your configuration file:

{
    "mcpServers": {
        "scast": {
            "command": "node",
            "args": [
                "/YOUR_INSTALL_DIR/SCAST/mcp/index.js",
                "/YOUR_WORKSPACE/",
                "C:\\Users\\DKZ\\OTHER_ALLOWED_DIR\\"
            ]
        }
    }
}

3. Restart Claude Desktop for the changes to take effect

Want to 10x your AI skills?

Get a free account and learn to code + market your apps using AI (with or without vibes!).

Nah, maybe later