code-scanner-server

code-scanner-server

2

Code-scanner-server is a CLI tool and MCP server designed to scan code files for definitions, observe .gitignore rules, and provide outputs in formats suitable for large language models. It supports multiple languages and can extract functions, classes, and more, with versatile filtering and output options.

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).

Features

  • Code Definition Extraction: Identifies functions, classes, interfaces, etc.
  • Multi-Language Support: JavaScript, TypeScript, C#, PHP, CSS, Python.
  • .gitignore Aware
  • Flexible Filtering: By definition type, modifiers, names, paths.
  • Multiple Output Formats: Markdown, XML, JSON.
  • Configurable Detail Levels: Minimal, standard, detailed.
  • Dual Mode Operation: CLI tool or MCP server.

Installation

  1. Prerequisites: Node.js and npm.
  2. Clone: Clone and navigate to the repo.
  3. Install Dependencies: npm install
  4. Build: Compile TypeScript with npm run build.

Usage Modes

1. Command-Line Interface (CLI)

  • Run via terminal with --directory argument.
  • Example: node build/index.js --directory /path/to/codebase

2. MCP Server Mode

  • Starts without --directory argument, listens for requests.