{"_id":"@atef_andrus/mcp-ripgrep","_rev":"3-6349ff33f88d1340064a975bf7857aae","name":"@atef_andrus/mcp-ripgrep","dist-tags":{"latest":"1.2.0"},"versions":{"1.0.0":{"name":"@atef_andrus/mcp-ripgrep","version":"1.0.0","keywords":["mcp","ripgrep","rg","search","model-context-protocol"],"author":{"name":"AtefAndrus"},"license":"MIT","_id":"@atef_andrus/mcp-ripgrep@1.0.0","maintainers":[{"name":"atef_andrus","email":"nagami.dev@gmail.com"}],"homepage":"https://github.com/AtefAndrus/mcp-ripgrep#readme","bugs":{"url":"https://github.com/AtefAndrus/mcp-ripgrep/issues"},"bin":{"mcp-ripgrep":"dist/index.js"},"dist":{"shasum":"f08e0fc309d62cf7eddc1ed2736c46dc405f07c6","tarball":"https://registry.npmjs.org/@atef_andrus/mcp-ripgrep/-/mcp-ripgrep-1.0.0.tgz","fileCount":36,"integrity":"sha512-MiGeSw68OsDL5OJl0dblYx5ZNqY15rpYqfAeQ0okXA7al/7eHZDlDBG12ahmLJCYARXLMS9HN2/SyNG/A2lEJQ==","signatures":[{"sig":"MEQCIBUqPrc5/Zo6z/QgaSre+IkXdeFqG24WWoVlAUUCxl/kAiB/p+BgCyaRLzEv7zHN+QLxcu/sXWfzqAbXUl7YMbzD5A==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@atef_andrus%2fmcp-ripgrep@1.0.0","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":52674},"main":"dist/index.js","type":"module","types":"./dist/index.d.ts","engines":{"node":">=22"},"exports":{".":"./dist/index.js"},"gitHead":"fe3c942da898e798aaa4836281c264a522653e29","scripts":{"dev":"bun run src/index.ts","lint":"biome check . && tsc --noEmit","test":"bun test","build":"tsc","check":"biome check .","start":"node dist/index.js","format":"biome check --write .","validate":"bun test && biome check . && tsc --noEmit","typecheck":"tsc --noEmit","prepublishOnly":"tsc"},"_npmUser":{"name":"atef_andrus","email":"nagami.dev@gmail.com"},"repository":{"url":"git+https://github.com/AtefAndrus/mcp-ripgrep.git","type":"git"},"_npmVersion":"10.9.4","description":"MCP server providing ripgrep search capabilities","directories":{},"_nodeVersion":"22.22.0","dependencies":{"zod":"^3.24.0","@modelcontextprotocol/sdk":"^1.26.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"@types/bun":"latest","typescript":"^5.8.0","@types/node":"^22.0.0","@biomejs/biome":"^1.9.0"},"_npmOperationalInternal":{"tmp":"tmp/mcp-ripgrep_1.0.0_1771614898422_0.22197460383779632","host":"s3://npm-registry-packages-npm-production"}},"1.1.0":{"name":"@atef_andrus/mcp-ripgrep","version":"1.1.0","keywords":["mcp","ripgrep","rg","search","model-context-protocol"],"author":{"name":"AtefAndrus"},"license":"MIT","_id":"@atef_andrus/mcp-ripgrep@1.1.0","maintainers":[{"name":"atef_andrus","email":"nagami.dev@gmail.com"}],"homepage":"https://github.com/AtefAndrus/mcp-ripgrep#readme","bugs":{"url":"https://github.com/AtefAndrus/mcp-ripgrep/issues"},"bin":{"mcp-ripgrep":"dist/index.js"},"dist":{"shasum":"7ad2c405b1d4b7121f00d83fdb7c0270684b1b0e","tarball":"https://registry.npmjs.org/@atef_andrus/mcp-ripgrep/-/mcp-ripgrep-1.1.0.tgz","fileCount":48,"integrity":"sha512-OiD50PLs0GzTNfc5PlEKo8v7MrJzUlV49r4jeIjucSmMkI6AP7EHe/LJch0n7HZ2AsTqo1RkEkZRtA10D2W2OA==","signatures":[{"sig":"MEUCICMFwyrAQxAPIFM5boG7ym1WjirsEm1idtevSsYuIp94AiEAhAks2/YnoTEn9nANPNR7+BVkKaVtZnZLCCbOFHskWzY=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@atef_andrus%2fmcp-ripgrep@1.1.0","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":80485},"main":"dist/index.js","type":"module","types":"./dist/index.d.ts","engines":{"node":">=22"},"exports":{".":"./dist/index.js"},"gitHead":"6b86f143571c01cfdaa5b1724c1233a21048bf7d","scripts":{"dev":"bun run src/index.ts","lint":"biome check . && tsc --noEmit","test":"bun test","build":"tsc","check":"biome check .","start":"node dist/index.js","format":"biome check --write .","validate":"bun test && biome check . && tsc --noEmit","typecheck":"tsc --noEmit","prepublishOnly":"tsc"},"_npmUser":{"name":"GitHub Actions","email":"npm-oidc-no-reply@github.com","trustedPublisher":{"id":"github","oidcConfigId":"oidc:f25119eb-ba54-4a53-9b9d-fa7e01fcb085"}},"repository":{"url":"git+https://github.com/AtefAndrus/mcp-ripgrep.git","type":"git"},"_npmVersion":"11.6.2","description":"MCP server providing ripgrep search capabilities","directories":{},"_nodeVersion":"24.13.0","dependencies":{"zod":"^3.24.0","@modelcontextprotocol/sdk":"^1.26.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"@types/bun":"latest","typescript":"^5.8.0","@types/node":"^22.0.0","@biomejs/biome":"^1.9.0"},"_npmOperationalInternal":{"tmp":"tmp/mcp-ripgrep_1.1.0_1771683109893_0.9789242317543023","host":"s3://npm-registry-packages-npm-production"}},"1.2.0":{"name":"@atef_andrus/mcp-ripgrep","version":"1.2.0","description":"MCP server providing ripgrep search capabilities","type":"module","main":"dist/index.js","exports":{".":"./dist/index.js"},"bin":{"mcp-ripgrep":"dist/index.js"},"engines":{"node":">=22"},"author":{"name":"AtefAndrus"},"repository":{"type":"git","url":"git+https://github.com/AtefAndrus/mcp-ripgrep.git"},"homepage":"https://github.com/AtefAndrus/mcp-ripgrep#readme","publishConfig":{"access":"public"},"scripts":{"build":"tsc","start":"node dist/index.js","dev":"bun run src/index.ts","test":"bun test","typecheck":"tsc --noEmit","check":"biome check .","format":"biome check --write .","lint":"biome check . && tsc --noEmit","validate":"bun test && biome check . && tsc --noEmit","prepublishOnly":"tsc"},"dependencies":{"@modelcontextprotocol/sdk":"^1.26.0","zod":"^3.24.0"},"devDependencies":{"@biomejs/biome":"^1.9.0","@types/bun":"latest","@types/node":"^22.0.0","typescript":"^5.8.0"},"keywords":["mcp","ripgrep","rg","search","model-context-protocol"],"license":"MIT","gitHead":"2da279646929235dbbfb23435728539b3b44cab6","types":"./dist/index.d.ts","_id":"@atef_andrus/mcp-ripgrep@1.2.0","bugs":{"url":"https://github.com/AtefAndrus/mcp-ripgrep/issues"},"_nodeVersion":"24.13.0","_npmVersion":"11.6.2","dist":{"integrity":"sha512-gbEUnAMQ6zgvEckr5QXqvuds52nR8wGb5bmtG67EYpRYN3ufrha9HhJNBdEtQvNaNOtyjMV1eRiA1iYGxIxSnA==","shasum":"269f66c198088b64b0e16eacd2543cd0a615c1c5","tarball":"https://registry.npmjs.org/@atef_andrus/mcp-ripgrep/-/mcp-ripgrep-1.2.0.tgz","fileCount":48,"unpackedSize":81928,"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@atef_andrus%2fmcp-ripgrep@1.2.0","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEYCIQDeFFf90DmVsssWmShRG2Wq20zwma6B9S/8he3aRwyfSwIhAK6xtxsAqnv5W64XOwg54AnsHb9KEhVKARv7EDcVPrTJ"}]},"_npmUser":{"name":"GitHub Actions","email":"npm-oidc-no-reply@github.com","trustedPublisher":{"id":"github","oidcConfigId":"oidc:f25119eb-ba54-4a53-9b9d-fa7e01fcb085"}},"directories":{},"maintainers":[{"name":"atef_andrus","email":"nagami.dev@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/mcp-ripgrep_1.2.0_1771698538739_0.667594643585047"},"_hasShrinkwrap":false}},"time":{"created":"2026-02-20T19:14:58.344Z","modified":"2026-02-21T18:28:59.205Z","1.0.0":"2026-02-20T19:14:58.560Z","1.1.0":"2026-02-21T14:11:50.035Z","1.2.0":"2026-02-21T18:28:58.903Z"},"bugs":{"url":"https://github.com/AtefAndrus/mcp-ripgrep/issues"},"author":{"name":"AtefAndrus"},"license":"MIT","homepage":"https://github.com/AtefAndrus/mcp-ripgrep#readme","keywords":["mcp","ripgrep","rg","search","model-context-protocol"],"repository":{"type":"git","url":"git+https://github.com/AtefAndrus/mcp-ripgrep.git"},"description":"MCP server providing ripgrep search capabilities","maintainers":[{"name":"atef_andrus","email":"nagami.dev@gmail.com"}],"readme":"# @atef_andrus/mcp-ripgrep\n\n[![npm version](https://img.shields.io/npm/v/@atef_andrus/mcp-ripgrep)](https://www.npmjs.com/package/@atef_andrus/mcp-ripgrep)\n[![CI](https://github.com/AtefAndrus/mcp-ripgrep/actions/workflows/ci.yml/badge.svg)](https://github.com/AtefAndrus/mcp-ripgrep/actions/workflows/ci.yml)\n[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)\n\nAn MCP server that provides [ripgrep](https://github.com/BurntSushi/ripgrep) search capabilities.\n\n## Prerequisites\n\n- [ripgrep](https://github.com/BurntSushi/ripgrep) (`rg`) installed and available on PATH\n- Node.js 22+ or Bun 1.3+\n\n## Installation\n\n```bash\nnpm install @atef_andrus/mcp-ripgrep\n```\n\n## Usage\n\n### Use as an MCP Server\n\nAdd the following to your MCP client configuration:\n\n```json\n{\n  \"mcpServers\": {\n    \"ripgrep\": {\n      \"command\": \"npx\",\n      \"args\": [\"@atef_andrus/mcp-ripgrep\"]\n    }\n  }\n}\n```\n\n### Startup Options\n\n| Option | Description |\n|---|---|\n| `--allow-dir <path>` | Restrict search scope to the specified directory (can be specified multiple times) |\n| `--max-result-chars <number>` | Maximum characters in results. Truncates at line boundaries when exceeded (default: 50,000) |\n| `--max-output-bytes <number>` | Maximum bytes of ripgrep output. Terminates the process and truncates results when exceeded (default: 20 MB) |\n\nConfiguration example with startup options:\n\n```json\n{\n  \"mcpServers\": {\n    \"ripgrep\": {\n      \"command\": \"npx\",\n      \"args\": [\n        \"@atef_andrus/mcp-ripgrep\",\n        \"--allow-dir\", \"/home/user/project\",\n        \"--max-result-chars\", \"50000\",\n        \"--max-output-bytes\", \"20000000\"\n      ]\n    }\n  }\n}\n```\n\n### Tools\n\n| Tool | Description |\n|---|---|\n| `search` | Pattern search with regex, literal strings, multiline matching, OR matching, context lines, and various filters. Prepends a summary of match count and file count to results |\n| `search-and-replace` | Search-and-replace preview (read-only). Supports multiline matching and capture groups ($1, ${name}) |\n| `search-count` | Count matches per file (by line count or total matches). Supports sorting results |\n| `search-files` | List files that match or do not match a pattern |\n| `list-files` | List all files within the search scope |\n| `list-file-types` | List file types supported by ripgrep |\n\n### Key Parameters\n\n| Parameter | Description |\n|---|---|\n| `pattern` | Search pattern (regex by default) |\n| `path` | Directory or file to search |\n| `fixedStrings` | Treat the pattern as a literal string |\n| `caseSensitive` | `true` = case-sensitive, `false` = case-insensitive, omitted = smart-case |\n| `fileType` | Filter by file type (e.g., `\"ts\"`, `[\"ts\", \"js\"]`). String or array |\n| `fileTypeNot` | Exclude file types (e.g., `\"json\"`, `[\"json\", \"md\"]`). String or array |\n| `glob` | Filter by glob pattern (e.g., `\"*.test.ts\"`, `[\"src/**\", \"!vendor/**\"]`). String or array |\n| `includeHidden` | Include hidden files |\n| `followSymlinks` | Follow symbolic links |\n| `maxDepth` | Maximum directory traversal depth |\n| `noIgnore` | Ignore .gitignore rules and search files that are normally excluded |\n| `multiline` | Enable multiline matching (function signatures, import blocks, etc.) |\n| `additionalPatterns` | Additional patterns for OR matching (array) |\n| `sortBy` | Sort results. search / search-files / list-files: `\"path\"` `\"modified\"` `\"created\"`. search-count: `\"path\"` `\"count\"` `\"count-asc\"` |\n| `maxCharacters` | Maximum characters in results. Truncates at line boundaries and appends a summary when exceeded |\n\n### Parameter Support by Tool\n\n<!-- params-table-start -->\n| Parameter | `list-file-types` | `list-files` | `search` | `search-and-replace` | `search-count` | `search-files` |\n|---|:---:|:---:|:---:|:---:|:---:|:---:|\n| `pattern` | - | - | o | o | o | o |\n| `path` | - | o | o | o | o | o |\n| `fixedStrings` | - | - | o | o | o | o |\n| `caseSensitive` | - | - | o | o | o | o |\n| `wordMatch` | - | - | o | o | o | o |\n| `multiline` | - | - | o | o | - | - |\n| `fileType` | - | o | o | o | o | o |\n| `fileTypeNot` | - | o | o | o | o | o |\n| `glob` | - | o | o | o | o | o |\n| `maxResults` | - | - | o | o | - | - |\n| `contextLines` | - | - | o | - | - | - |\n| `beforeContext` | - | - | o | - | - | - |\n| `afterContext` | - | - | o | - | - | - |\n| `invertMatch` | - | - | o | - | - | o |\n| `includeHidden` | - | o | o | o | o | o |\n| `followSymlinks` | - | o | o | o | o | o |\n| `maxDepth` | - | o | o | o | o | o |\n| `additionalPatterns` | - | - | o | - | - | - |\n| `jsonOutput` | - | - | o | - | - | - |\n| `maxColumns` | - | - | o | - | - | - |\n| `noIgnore` | - | o | o | o | o | o |\n| `sortBy` | - | o | o | - | o | o |\n| `maxCharacters` | o | o | o | o | o | o |\n| `replacement` | - | - | - | o | - | - |\n| `onlyMatching` | - | - | - | o | - | - |\n| `countMode` | - | - | - | - | o | - |\n| `includeZero` | - | - | - | - | o | - |\n<!-- params-table-end -->\n\n## Development\n\n```bash\n# Install dependencies\nbun install\n\n# Run tests\nbun test\n\n# Type check\nbunx tsc --noEmit\n\n# Lint and format\nbunx biome check --write .\n\n# Build\nbunx tsc\n\n# Start in development mode\nbun run dev\n```\n\n## Security\n\n- This server passes arguments as an array via `spawn(\"rg\", args)` (no shell interpolation). Patterns and paths are placed after a `--` separator to prevent flag injection.\n- The `--allow-dir` option restricts the search scope to specified directories. Paths are resolved to absolute paths using `path.resolve()` and validated via prefix matching.\n- **Limitation**: When `followSymlinks` is enabled, symbolic links may allow access to directories outside the allowed scope. Be aware of this when using `--allow-dir` together with `followSymlinks`.\n\n## License\n\nMIT\n","readmeFilename":"README.md"}