Skip to main content
Glama

Grep MCP Server

by 247arjun

grep_count

Count occurrences of a specific pattern in files or directories using regex or plain text, with options for case sensitivity, whole-word matches, and per-file counts.

Instructions

Count the number of matches for a pattern

Input Schema

NameRequiredDescriptionDefault
by_fileNoShow count per file when searching directories
case_sensitiveNoWhether the search should be case sensitive
file_extensionsNoOnly search files with these extensions
patternYesRegular expression pattern or plain text to count
targetYesFile or directory path to search in
whole_wordsNoMatch whole words only

Input Schema (JSON Schema)

{ "$schema": "http://json-schema.org/draft-07/schema#", "additionalProperties": false, "properties": { "by_file": { "default": false, "description": "Show count per file when searching directories", "type": "boolean" }, "case_sensitive": { "default": false, "description": "Whether the search should be case sensitive", "type": "boolean" }, "file_extensions": { "description": "Only search files with these extensions", "items": { "type": "string" }, "type": "array" }, "pattern": { "description": "Regular expression pattern or plain text to count", "type": "string" }, "target": { "description": "File or directory path to search in", "type": "string" }, "whole_words": { "default": false, "description": "Match whole words only", "type": "boolean" } }, "required": [ "pattern", "target" ], "type": "object" }
Install Server

Other Tools from Grep MCP Server

Related Tools

    MCP directory API

    We provide all the information about MCP servers via our MCP API.

    curl -X GET 'https://glama.ai/api/mcp/v1/servers/247arjun/mcp-grep'

    If you have feedback or need assistance with the MCP directory API, please join our Discord server