code-scanner-server
by Ixe1
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, operating as a CLI tool and an MCP server.
Last updated: N/A
What is 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).
How to use code-scanner-server?
The tool can be used in two modes: as a CLI tool by providing the --directory
argument, or as an MCP server by running it without the --directory
argument. In CLI mode, various options are available to filter and format the output. In MCP server mode, it listens for requests via standard input/output, accepting arguments corresponding to the CLI options in a JSON format.
Key features of code-scanner-server
Code Definition Extraction
Multi-Language Support (JavaScript, TypeScript, C#, PHP, CSS, Python)
.gitignore Aware
Flexible Filtering (by definition type, modifiers, name patterns, file path patterns)
Multiple Output Formats (Markdown, XML, JSON)
Configurable Detail Levels (minimal, standard, detailed)
Dual Mode Operation (CLI and MCP server)
Use cases of code-scanner-server
Automated code analysis
Integration with AI assistants for code understanding
Generating documentation from code
Identifying code structure and dependencies
FAQ from code-scanner-server
What languages are supported?
What languages are supported?
JavaScript, TypeScript, C#, PHP, CSS, and Python are supported via Tree-sitter.
How do I run the tool as a CLI?
How do I run the tool as a CLI?
Use the command node build/index.js --directory /path/to/your/codebase
.
How do I run the tool as an MCP server?
How do I run the tool as an MCP server?
Run the tool without the --directory
argument. Configure your MCP client to use the server.
What output formats are available?
What output formats are available?
Markdown, XML, and JSON are supported.
How do I filter the results?
How do I filter the results?
Use the various command-line options or the input schema properties in MCP server mode to include or exclude definitions based on type, modifiers, name patterns, and file paths.