Skip to main content
Glama
MCP Code Flow Analyzer
by bsdnn

MCP Code Flow Analyzer

An MCP (Model Context Protocol) server for analyzing and tracing business code flows across your codebase. Helps developers quickly understand the complete execution path of features from frontend to backend to database.

Features

  • Business Flow Tracing: Follow function calls from entry points through the entire codebase

  • Multi-Language Support: TypeScript, JavaScript

  • Smart Symbol Extraction: Automatically identifies functions, classes, variables, and imports

  • Call Graph Analysis: Builds and traverses function call relationships

  • Clickable Links: Generate VSCode and GitHub links for quick navigation

  • Flexible Configuration: YAML-based project configuration

Related MCP server: trazabilidad-mcp

Installation

npm install
npm run build

Usage

1. Configure Your Project

Create a .flowanalysis.yaml file:

version: '1.0'
project:
  name: "my-project"
  languages: [typescript]
  rootPath: "."
sourceConfig:
  include: ["src/**/*.ts"]
  exclude: ["**/*.test.ts", "node_modules/**"]
analysisConfig:
  maxCallDepth: 10
  crossFileAnalysis: true
linkConfig:
  vscode: { enabled: true }
  github:
    enabled: true
    repository: "https://github.com/owner/repo"

2. Configure in VSCode

{
  "modelContextProtocol": {
    "servers": {
      "code-flow-analyzer": {
        "command": "node",
        "args": ["/path/to/mcp-server/dist/index.js"],
        "env": { "PROJECT_ROOT": "${workspaceFolder}" }
      }
    }
  }
}

MCP Tools

  • traceBusinessFlow — Trace the complete execution path from an entry point

  • findCallers — Find all functions that call a given function

  • getProjectInfo — Get metadata about the project and analysis results

  • generateFlowDiagram — Generate a Mermaid call graph diagram

Architecture

MCP Server (index.ts)
├── Project Config Manager
├── Code Analysis Manager
│   ├── Parser Factory
│   │   ├── TypeScript Parser
│   └── Symbol Table
├── Call Graph Analyzer
└── Link Generators
    ├── VSCode Link Generator
    └── GitHub Link Generator

Development

npm run build      # Build
npm run typecheck  # Type check
npm run start      # Run server
npm run dev        # Build + run

License

MIT

Available Tools

7 tools
findCallersA

Find all functions that call a given function (reverse call graph)

Inputs: functionName (required).

generateFlowDiagramB

Generate a Mermaid call graph diagram for a function. Output renders in any markdown viewer (GitHub, VSCode, etc.).

Inputs: entryPoint (required), mode.

getCriticalPointsA

Get all critical operations (database reads/writes, HTTP requests, file I/O, exec calls) reachable from a function. This is the unique value of MCP vs raw search — it semantically classifies what each function actually DOES.

Inputs: entryPoint.

getProjectInfoB

Get project statistics: file count, symbol count, critical point count, languages detected

Inputs: no named parameters.

searchSymbolsA

Fuzzy search for symbols. Supports partial names, Chinese keywords ("登录", "支付"), and CamelCase prefixes.

Inputs: query (required).

traceBusinessFlowA

Trace the complete business flow chain from an entry point. Returns real call graph (parsed from function bodies), critical operations (DB/HTTP/file I/O), and a Mermaid diagram. Supports fuzzy matching and Chinese keywords like "登录"/"支付".

Inputs: entryPoint (required).

whoTriggersA

Reverse trace: find all entry points (controllers/public methods) that eventually call a given function. Answers questions like "what endpoints write to the order table?" by reverse-BFS from a critical operation.

Inputs: functionName (required).

Tool Schema Changelog

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

Loading tool schema changelog…

    TDQS

    A3.9/5.0

    Scored across 7 tools

    Disambiguation4/5

    Most tools have distinct purposes, but there is some overlap between findCallers and whoTriggers, and between generateFlowDiagram and traceBusinessFlow. Descriptions help differentiate, but agents might occasionally confuse them.

    Naming Consistency5/5

    All tool names follow a consistent verb_noun pattern in camelCase (e.g., findCallers, generateFlowDiagram), making them predictable and easy to understand. 'whoTriggers' is slightly different but still verb-like.

    Tool Count5/5

    With 7 tools, the server is well-scoped, covering essential code flow analysis functions without being overwhelming. Each tool serves a clear role.

    Completeness4/5

    The tool set covers search, call graph analysis, critical point detection, and visualization. Minor gaps exist, such as lacking a tool for comparing flows or detailed function metadata, but it sufficiently handles core analysis tasks.

    Maintenance

    ActivityInactive
    ResponsivenessNo recent community issues

    Related MCP Connectors

    Related MCP Servers

    • F
      license
      Not graded
      quality
      D
      maintenance
      An MCP server that transforms codebases into intelligent, queryable knowledge bases, enabling AI assistants to perform semantic search, explore architecture, and analyze code relationships.
      166
      -
    • F
      license
      Not graded
      quality
      B
      maintenance
      MCP server that exposes code tracing capabilities including journey flows, HTTP seams, and findings from indexed projects, allowing AI assistants to query software architecture.
      -
    • A
      license
      A
      quality
      D
      maintenance
      An MCP server that extracts complete knowledge from any codebase — architecture, patterns, dependencies, API surface. Combines static analysis with AI-powered deep interpretation.
      8
      MIT
    • F
      license
      Not graded
      quality
      D
      maintenance
      MCP server for AI coding agents that builds a complete code structure graph and semantic vector index, enabling fast querying of code entities, relationships, and impact analysis.
      20 npm
      11
      -