Get the FREE Ultimate OpenClaw Setup Guide →

code-scanner

CLI & MCP server for scanning code definitions (.gitignore aware, LLM output)

Installation
Run this command in your terminal to add the MCP server to Claude Code.
Run in terminal:
Command
claude mcp add --transport stdio ixe1-code-scanner-server node build/index.js

How to use

code-scanner-server provides a dual-mode solution: a CLI tool for local code scanning and an MCP server interface that can be consumed by AI assistants or editors through standard input/output. It uses Tree-sitter to parse multiple languages (JavaScript, TypeScript, C#, PHP, CSS, Python) and extracts definitions such as classes, functions, methods, variables, and interfaces. Results can be emitted in XML, Markdown, or JSON, with filtering options for definition types, modifiers, name patterns, and file paths. The MCP server mode accepts the same options as the CLI (via an input schema) and returns a structured list of definitions for a given directory, facilitating integration with other tools and workflows. To use the MCP server in an editor or automation layer, configure your MCP client to run the server executable and pass the required directory and optional filters; the server will respond with the requested definitions in the chosen output format.

How to install

Prerequisites:

  • Node.js and npm installed on your system

Installation steps:

  1. Clone the repository (optional):
# git clone <repository_url>
# cd code-scanner-server
  1. Install dependencies:
npm install
  1. Build the TypeScript project to generate the runnable index:
npm run build

This produces the executable JavaScript file at build/index.js. 4. (Optional) Run in MCP mode directly after build:

node build/index.js
  1. If you need continuous development:
npm run watch

This will rebuild on file changes.

Additional notes

Tips and considerations:

  • The MCP server reads input via standard input/output, matching the CLI options to an input schema. When used with an MCP client, ensure the directory path is absolute and the worker has permissions to read the project files.
  • The scanner respects .gitignore rules by default, avoiding ignored files unless explicitly overridden.
  • Output verbosity levels are fixed in the CLI; in MCP mode, you control detail via the detailLevel option (minimal, standard, detailed).
  • If you plan to integrate with an editor, point the MCP client at the built index.js path (build/index.js) and provide the directory to scan; you may also pass includePaths, excludePaths, and other filters as needed.
  • Common issues: missing language parsers for certain languages may yield partial results; ensure Tree-sitter parsers for target languages are supported in the build, and keep dependencies up to date with npm install.

Related MCP Servers

Sponsor this space

Reach thousands of developers