Code Scanner Server MCP server

Code Scanner Server MCP server

code-scanner-server•byixe1

An MCP server and CLI tool that scans code files with Tree-sitter to extract definitions and return LLM-friendly XML, Markdown, or JSON output.

License: GNU General Public License v3.0•Runtime: Awaiting documentation review•Category: developer tools

WHAT IT DOES

  • •Extracts definitions such as functions, classes, variables, interfaces, and methods from source code using Tree-sitter.
  • •Parses JavaScript, TypeScript, C#, PHP, CSS, and Python files.
  • •Respects .gitignore rules and supports filtering by definition type, modifiers, name regular expressions, and file path patterns.
  • •Produces results in Markdown, XML, or JSON with configurable minimal, standard, or detailed verbosity.

BEST FOR

  • •Giving AI assistants a structural overview of a codebase through the scan_code tool.
  • •Filtering a scan down to specific definition types, visibility modifiers, or name patterns.
  • •Scanning a project directory from the command line and emitting detailed JSON.

ABOUT CODE-SCANNER-SERVER

Code Scanner Server MCP server is cataloged as an MCP server attributed to ixe1. An MCP server and CLI tool that scans code files with Tree-sitter to extract definitions and return LLM-friendly XML, Markdown, or JSON output. It is categorized under developer tools. See the capability inspector for recorded interfaces and their independent review status; consult upstream documentation for the current interface.

HOW TO INSTALL

Installation configuration is not reviewed. No executable setup is offered for this entry; inspect the source repository before proceeding.

LICENSE

Catalog license label: GNU General Public License v3.0. Check the source repository's current license and terms before using, modifying or distributing this software.

能力检查器

能力定义尚未审核。未核验的采集内容不会作为可信接口展示。

Tools (0)

暂无可展示的已审核记录。这不表示上游不支持此能力。

Resources (0)

暂无可展示的已审核记录。这不表示上游不支持此能力。

Prompts (0)

暂无可展示的已审核记录。这不表示上游不支持此能力。

NEWSLETTER - COMING LATER

Newsletter subscriptions are not open yet

Email delivery is not connected. This page does not collect email addresses or create subscriptions.

Browse the registry for current listings instead.

Community Reviews

Coming later

Reviews for Code Scanner Server MCP server are not available yet

Review publishing and storage are not connected. This page does not collect or publish ratings or comments, including after sign-in.

FREQUENTLY ASKED QUESTIONS

What is the required input for the scan_code MCP tool?

The directory property is required; other arguments correspond to the CLI filtering and output options.

How does the tool start in MCP server mode?

Running it without the --directory argument starts it as an MCP server communicating over standard input/output.

Does the scanner honor .gitignore files?

Yes, it automatically respects rules defined in .gitignore files.

上游原版 README

在 GitHub 查看同一版本原文

README.md · 91bdcd9856bd · 采集于 2026-11-13 10:52:10 UTC

保留上游原文,不做 AI 改写。为安全起见过滤脚本、表单和不安全链接。

当前显示最后一次成功采集的文档快照,请以来源页面为准。

MseeP.ai Security Assessment Badge

Code Scanner Server MCP server

code-scanner-server

A CLI tool and MCP server that scans code files for definitions (classes, functions, etc.), respects .gitignore, provides line numbers, and outputs LLM-friendly formats (XML/Markdown).

This project provides a versatile code scanning tool built with TypeScript and Node.js. It leverages the Tree-sitter parsing library to analyze source code and extract structural information. It can operate both as a command-line interface (CLI) tool and as an MCP (Model Context Protocol) server.

Note: This tool is under active development. While core functionality is operational, some features or specific language parsers may not be fully tested and might contain bugs or limitations.

Features

  • Code Definition Extraction: Identifies functions, classes, variables, interfaces, methods, etc.
  • Multi-Language Support: Parses JavaScript (.js, .jsx), TypeScript (.ts, .tsx), C# (.cs), PHP (.php), CSS (.css), and Python (.py) via Tree-sitter.
  • .gitignore Aware: Automatically respects rules defined in .gitignore files.
  • Flexible Filtering: Filter results by definition type, modifiers (public, private), name patterns (regex), and file path patterns.
  • Multiple Output Formats: Generates results in Markdown (default), XML, or JSON.
  • Configurable Detail Levels: Output verbosity: minimal, standard (default), detailed.
  • Dual Mode Operation: Run as a standalone CLI tool or as an integrated MCP server.

Usage Modes

1. Command-Line Interface (CLI)

Run the scanner directly from your terminal. This mode requires the --directory argument specifying the target codebase.

Basic Usage:

node build/index.js --directory /path/to/your/codebase

Common Options:

  • -d, --directory <path>: (Required) Absolute or relative path to the directory to scan.
  • -p, --patterns <patterns...>: Glob patterns for file extensions (e.g., "**/*.ts" "**/*.js"). Defaults to JS, TSX, CS, PHP, CSS, PY files.
  • -f, --format <format>: Output format (xml, markdown, json). Default: markdown.
  • -l, --detail <level>: Level of detail (minimal, standard, detailed). Default: standard.
  • --include-types <types...>: Only include specific definition types (e.g., class, method).
  • --exclude-types <types...>: Exclude specific definition types.
  • --include-modifiers <modifiers...>: Only include definitions with specific modifiers (e.g., public).
  • --exclude-modifiers <modifiers...>: Exclude definitions with specific modifiers.
  • --name-pattern <regex>: Include definitions matching a JavaScript regex pattern.
  • --exclude-name-pattern <regex>: Exclude definitions matching a JavaScript regex pattern.
  • --include-paths <paths...>: Additional file path patterns (glob) to include.
  • --exclude-paths <paths...>: File path patterns (glob) to exclude.
  • -h, --help: Display detailed help information for all options.

Example (Scan TypeScript files in src, output detailed JSON):

node build/index.js -d ./src -p "**/*.ts" -f json -l detailed

2. MCP Server Mode (scan_code tool)

If run without the --directory argument, the tool starts as an MCP server, listening for requests via standard input/output. This allows integration with MCP clients like AI assistants.

  • Tool Name: scan_code
  • Description: Scans a specified directory for code files and returns a list of definitions according to the provided filters.
  • Input Schema: Accepts arguments corresponding to the CLI options. The directory property is required.
    {
      "type": "object",
      "properties": {
        "directory": { "type": "string", "description": "Absolute path to the directory to scan." },
        "filePatterns": { "type": "array", "items": { "type": "string" }, "description": "Glob patterns for files.", "default": ["**/*.js", ..., "**/*.py"] },
        "outputFormat": { "type": "string", "enum": ["xml", "markdown", "json"], "default": "markdown" },
        "detailLevel": { "type": "string", "enum": ["minimal", "standard", "detailed"], "default": "standard" },
        "includeTypes": { "type": "array", "items": { "type": "string" } },
        "excludeTypes": { "type": "array", "items": { "type": "string" } },
        "includeModifiers": { "type": "array", "items": { "type": "string" } },
        "excludeModifiers": { "type": "array", "items": { "type": "string" } },
        "namePattern": { "type": "string", "description": "Regex pattern for names." },
        "excludeNamePattern": { "type": "string", "description": "Regex pattern to exclude names." },
        "includePaths": { "type": "array", "items": { "type": "string" } },
        "excludePaths": { "type": "array", "items": { "type": "string" } }
      },
      "required": ["directory"]
    }
    
  • Example Usage with AI Assistant: "Use code-scanner-server scan_code on directory /path/to/project outputting xml format."

Installation

  1. Prerequisites: Ensure you have Node.js and npm installed.
  2. Clone (Optional): If you don't have the code, clone the repository.
    # git clone <repository_url>
    # cd code-scanner-server
    
  3. Install Dependencies:
    npm install
    
  4. Build: Compile the TypeScript code.
    npm run build
    
    This creates the executable JavaScript file at build/index.js.

Configuration (MCP Server)

To use the MCP server mode, add it to your MCP client's configuration file (e.g., claude_desktop_config.json for the desktop app or cline_mcp_settings.json for the VS Code extension).

Important: Replace /path/to/code-scanner-server in the example below with the absolute path to this project's directory on your system.

Example (claude_desktop_config.json / cline_mcp_settings.json):

{
  "mcpServers": {
    "code-scanner-server": {
      "command": "node",
      "args": [
        "/absolute/path/to/your/code-scanner-server/build/index.js" // <-- Replace this path! (e.g., "C:\\Users\\YourUser\\Projects\\code-scanner-server\\build\\index.js" on Windows)
      ],
      "env": {},
      "disabled": false,
      "autoApprove": [] // Add tool names here for auto-approval if desired
    }
  }
}

Remember to restart your MCP client application (IDE, Desktop App) after modifying the configuration for changes to take effect.

Development

  • Watch Mode: Automatically rebuild the project when source files change:
    npm run watch
    
  • Debugging (MCP Mode): Debugging MCP servers over stdio can be complex. Use the MCP Inspector tool for easier debugging:
    npm run inspector
    
    This starts the server with the Node.js inspector attached and provides a URL to connect debugging tools (like Chrome DevTools).

Acknowledgments

This project was significantly developed with the assistance of AI, primarily using Google's Gemini 2.5 Pro model accessed via the Roo Code extension for Visual Studio Code.

License

This project is licensed under the GNU General Public License v3.0 - see the LICENSE file for details.

Install configuration

Are you the maintainer?

Claim this server with your GitHub account to request manual ownership verification.

README Embed Badge
Markdown

Link to the catalog listing for Code Scanner Server MCP server from your README. This badge does not certify ownership, compatibility or security.

[![MCP catalog listing](https://img.shields.io/badge/MCP-awesome--mcp-orange?style=flat-square)](https://awesome-mcp.com/servers/code-scanner-server)

REPOSITORY STATS

GitHub StarsUnavailable
ForksUnavailable

Public repository statistics could not be verified. Check the configured source address; unavailable counts are not zero.

下载与拉取统计

来源、范围和时段分别列出;不相加,不代表安装人数、活跃用户或安全审核。

尚无已审核的包 / 镜像标识,暂不展示下载统计。

Related developer tools MCP Servers

Alternative and complementary servers in the same category

View all in developer tools →
Postbye
postbye-mcp•postbye-team

A directory listing describing a cancellation-letter and mailing-address service. The configured public GitHub repository returned 404 during source verification.

Repository stats unavailable
Developer Tools
Singapore Proxy MCP
singapore-proxy-mcp•Xavierfok

A hosted MCP service for browsing and searching through Singapore mobile-network proxies.

0
Developer Tools

A directory listing describing a Markdown-to-PDF service. The configured public GitHub repository returned 404 during source verification.

Repository stats unavailable
Developer Tools