Get the FREE Ultimate OpenClaw Setup Guide →

repomix-reader

A simple Model Context Protocol (MCP) server for reading and grep-searching Repomix output files. This MCP provides secure file access by restricting operations to a pre-selected set of Repomix output files specified at startup.

Installation
Run this command in your terminal to add the MCP server to Claude Code.
Run in terminal:
Command
claude mcp add --transport stdio wolfgang-check24-repomix-reader-mcp npx repomix-reader-mcp /path/to/first-repomix-output.xml /path/to/second-repomix-output.xml

How to use

Repomix Reader MCP provides a secure, ID-based interface to read and grep search Repomix output files. At startup you specify which Repomix output files should be accessible, and the MCP server assigns numeric IDs to those files for subsequent operations. You can list the available files, read sections by line range, and perform grep-like pattern searches with optional context around matches. This design makes it easy to integrate into MCP clients without exposing raw file paths. To use it, configure an MCP client to point at this server using the available file IDs, then issue the provided tools (list_repomix_files, read_repomix_output, grep_repomix_output) via the MCP protocol to interact with the files you approved at startup. The server supports outputs in various formats (XML, Markdown, plain text) as generated by Repomix, and enforces access only to the pre-approved set.

You can start by listing available files after initialization to confirm the IDs and descriptions, then read specific sections of a file by ID and line range, or run a regex search across a file with optional context lines. The grep tool supports standard JavaScript regular expressions and lets you tune contextLines and maxMatches to control output volume. This setup is particularly helpful for automated analyses or integration into a larger data-processing pipeline where exposing full file paths would be undesirable.

How to install

Prerequisites:

  • Node.js (recommended LTS) and npm installed on your system
  • Access to the MCP project repository and network to install dependencies

Step-by-step installation:

  1. Install dependencies

    npm install
    
  2. Build the project (transpile TypeScript to JavaScript or prepare production assets)

    npm run build
    
  3. Run the MCP server (example) You can run directly via Node after build, or use npx as described in the usage section.

    • If running directly from the built output:
      node build/index.js /path/to/repomix-output1.xml /path/to/repomix-output2.xml
      
  4. (Optional) Run in development mode (if a dev script is provided) and verify the server starts correctly:

    npm run dev
    

Notes:

  • Ensure at least one Repomix output file path is provided when starting the server.
  • The server will restrict access to the provided files and will not traverse other paths.

Additional notes

Tips and considerations:

  • At startup, pass all Repomix output files you want to expose to the MCP; only these will be accessible via the MCP tools.
  • Use list_repomix_files to retrieve IDs and descriptions before attempting read or grep operations.
  • When grep-ing, tune contextLines to balance readability and output volume, and set maxMatches to avoid excessive results in large files.
  • If you need to rotate available files, restart the MCP server with an updated list of allowed files.
  • Security: The MCP server is designed to restrict file access to the pre-approved list; do not expose the server to untrusted clients.
  • Supported file formats include XML, Markdown, and plain text; the tools operate on the content regardless of format as long as it is treated as readable text.

Related MCP Servers

Sponsor this space

Reach thousands of developers