Overview
What is mcp-code-search-server?
mcp-code-search-server is an MCP (Model Context Protocol) server that helps large language models (LLMs) find the location of relevant code within files and supports returning complete function definitions. It uses ripgrep to search for identifiers (variables, functions, classes, etc.) in a codebase and returns their full definitions, not just references.
How to use mcp-code-search-server?
Install with npm install mcp-code-search-server or pnpm install mcp-code-search-server. Run as a CLI tool with npx mcp-code-search-server. It can be integrated as an MCP server in LLM tools by configuring a command that launches npx -y mcp-code-search-server over stdio.
Key features of mcp-code-search-server
- Searches code identifiers using ripgrep
- Supports JavaScript/TypeScript, Java, and Python parsing
- Extracts complete variable, function, and class definitions
- Automatically detects and handles multiple file encodings (UTF-8, GBK, Big5, etc.)
- Smart default filtering excludes common non-code directories and file types
Use cases of mcp-code-search-server
- An LLM needs to locate and understand a specific function implementation in a large codebase
- A developer uses an LLM-based coding assistant to retrieve full class definitions during refactoring
- An automated code review tool searches for all usages and definitions of a variable
- A language model analyzes dependencies by retrieving complete definitions of imported symbols
FAQ from mcp-code-search-server
What does mcp-code-search-server do?
It helps LLMs find the exact location of code identifiers (e.g., function names, variables, classes) in files and returns the complete definition, not just the line where it appears.
What programming languages are supported?
JavaScript/TypeScript, Java, and Python are explicitly supported for code parsing.
How do I install mcp-code-search-server?
Use npm install mcp-code-search-server or pnpm install mcp-code-search-server. Then run it with npx mcp-code-search-server.
What transport protocol does mcp-code-search-server use?
It communicates with the LLM via the stdio interface following the Model Context Protocol.
Does mcp-code-search-server filter out non-code files?
Yes. It provides default configuration to exclude common non-code directories and file types, with smart filtering.