Skip to main content
Glama

Code Search MCP is a high-performance Model Context Protocol server that enables LLMs to intelligently search and analyze codebases across 12 programming languages with comprehensive AST search support for 15 languages. Built on our universal-ctags wrapper, ripgrep, and ast-grep, it provides fast symbol search, structural AST pattern matching, text search, file search, and dependency analysis with persistent caching for 80%+ faster startup times.

Code Search MCP supports 12 programming languages with full symbol indexing and intelligent search capabilities.

The server exposes the following tools through the Model Context Protocol interface.

Search code using Abstract Syntax Tree analysis for structural pattern matching that goes beyond simple text search.

AST Search Examples:

// Find async functions without await { "rule": { "all": [ { "pattern": "async function $NAME($$$) { $$$ }" }, { "not": { "has": { "pattern": "await $$$", "stopBy": "end" } } } ] } } // Find React components using useEffect without dependencies { "rule": { "all": [ { "pattern": "useEffect($$$)" }, { "not": { "pattern": "useEffect($CALLBACK, [$$$DEPS])" } } ] } } // Find functions with console.log inside { "rule": { "pattern": "console.log($$$)", "inside": { "pattern": "function $NAME($$$) { $$$ }", "stopBy": "end" } } }

Supported Languages (15 Total):

All AST language packages are bundled with the server - no additional installation required!

Automatically identify technologies, frameworks, and tools used in your projects with intelligent file-based detection.

Scan Modes: Fast (config files only) • Thorough (includes dependency analysis)

The persistent caching system delivers dramatic performance improvements for repeated searches.

Average improvement: 94.5% time saved

Prerequisites

Install the required dependencies:

# Install universal-ctags (required for symbol search) # macOS brew install universal-ctags # Ubuntu/Debian sudo apt-get install universal-ctags # Windows (via Chocolatey) choco install universal-ctags # Install ripgrep (required for text search) # macOS brew install ripgrep # Ubuntu/Debian sudo apt-get install ripgrep # Windows (via Chocolatey) choco install ripgrep # ast-grep is bundled with the MCP server - no separate installation needed!

Install the MCP Server

# Clone the repository git clone https://github.com/GhostTypes/code-search-mcp.git cd code-search-mcp # Install dependencies npm install # Build the project npm run build

Security Model

All tools accept absolute path parameters and validate them against allowed workspaces configured at startup.

Add to your MCP settings file (e.g., claude_desktop_config.json):

{ "mcpServers": { "code-search": { "command": "node", "args": [ "/path/to/code-search-mcp/dist/index.js", "--allowed-workspace", "/path/to/your/project1", "--allowed-workspace", "/path/to/your/project2" ] } } }

Configuration Options

# Clone the repository git clone https://github.com/GhostTypes/code-search-mcp.git cd code-search-mcp # Install dependencies npm install # Build the project npm run build # Run tests npm test # Run integration tests npm run test:integration

The server is built with a modular architecture for maintainability and extensibility.

Contributions are welcome! Please feel free to submit issues or pull requests.

MIT License - see LICENSE for details

-
security - not tested
-
license - not tested
-
quality - not tested

Latest Blog Posts

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/LLMTooling/code-search-mcp'

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