Code Search MCP Server
Requires Node.js runtime (v18.0.0 or later) as a dependency for running the code search MCP server.
Provides enhanced code understanding capabilities for Spring Framework projects, including layer-aware ordering (Controller → Service → Impl → MQ → Mapper/Repository/DAO), annotation parsing, and dependency injection field detection for Java Spring applications.
Click on "Install Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@Code Search MCP Servershow me the outline of the UserController and UserService files"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
Code Search MCP Server
High-performance, batch-oriented MCP (Model Context Protocol) code understanding toolkit for AI agents, specially optimized for Java.
Designed to solve the challenge where AI agents get "lost" in large codebases or lack precise context. It focuses on deep parsing, parallel batch processing, and panoramic context to explore large codebases efficiently, significantly reducing token usage while improving logical understanding.
Use Cases
Panoramic Context: Read multiple files in one call with dependency context auto-expanded.
Structural Mapping: Build project outlines fast with deep Java annotation awareness.
Precise Surgery: Precisely locate classes/methods/definitions and return in batch.
Related MCP server: Knowledge Graph MCP Server
Core Tools
Tool | Capability | Notes |
| Panoramic context | Batch read with dependency + model field expansion |
| Structural outline | Batch outline extraction with Java annotation awareness |
| Precise location | Batch locate classes/methods/definitions |
Design Notes
stdio transport: JSON-RPC 2.0 via standard I/O.
Deterministic protocol: absolute paths only, no path wildcards.
Java outline enhancement: annotation backtracking merged into signatures.
Java Spring Deep Fit
More than just text search, it understands business logic:
Layer-Aware Ordering: Intelligent sorting (Controller → Service → Impl → MQ → Repository) so AI understands the business flow immediately.
Deep Annotation-Awareness: Instead of just seeing signatures, AI sees merged annotations (like
@Transactional,@PreAuthorize) to understand business semantics.Smart DI Parsing: Automatically identifies injected fields (dependencies), eliminating the need for AI to guess where
userServicecomes from.Project Structure: Full support for
src/main/javaand multi-module Maven/Gradle projects.
Requirements
Node.js v18.0.0 or later
Install & Build
npm install
npm run buildIntegration
"mcpServers": {
"code-search": {
"command": "node",
"args": ["{file}/code-search/index.js"]
}
}Tips
Prefer
view_files_full_contextfor full context in one call.Absolute paths are required for stability and reproducibility.
Complex queries should be split into precise calls.
Open Source
This project is open-sourced under the MIT License. You may use, modify, and distribute it under the license terms.
Available Tools
3 toolsview_code_itemsA
[Precise Code Retrieval] Best for cases where the file path and item name are known. Batch returns full definition blocks for classes/methods/functions. If the input is a Java interface and implementations exist, it will attempt to traverse to Impl classes and return same-named method snippets (multiple implementations are supported and labeled). It also parses fields referenced in the method snippet to infer their type-to-class paths. Ideal for interface/implementation comparison, fast location of key methods, and precise extraction before call-chain analysis; if the path or name is unknown, use file search tools first.
| Name | Required | Description | Default |
|---|---|---|---|
| Items | Yes | List of code items to query. |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
With no annotations provided, the description carries full burden and does well by disclosing key behavioral traits: batch processing, traversal to implementation classes for Java interfaces, support for multiple implementations with labeling, parsing of referenced fields to infer type-to-class paths, and specific use cases. It doesn't mention error handling or performance characteristics, keeping it from a perfect score.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is appropriately sized and front-loaded with the core purpose in the first sentence. Every sentence adds value: the second explains advanced features, the third states ideal use cases and alternatives. Minor deduction for slightly dense phrasing in the middle sentence.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Given the tool's complexity (with traversal, parsing, and batch features), no annotations, and no output schema, the description does well to cover purpose, usage, and key behaviors. It could be more complete by hinting at return format or error cases, but it provides substantial context for effective use.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema description coverage is 100%, so the schema already documents the single parameter 'Items' as an array of objects with 'File' and 'ItemName'. The description adds context about what constitutes valid inputs ('Absolute path', 'Exact name') and examples, but doesn't provide additional syntax or format details beyond what the schema implies. Baseline 3 is appropriate when schema does the heavy lifting.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states the tool's purpose with specific verbs ('retrieval', 'returns', 'parses') and resources ('full definition blocks for classes/methods/functions', 'method snippets', 'fields referenced'). It distinguishes from siblings by specifying this is for 'precise retrieval' when file path and item name are known, unlike file search tools mentioned.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description provides explicit guidance on when to use ('Best for cases where the file path and item name are known', 'Ideal for interface/implementation comparison, fast location of key methods, and precise extraction before call-chain analysis') and when not to use ('if the path or name is unknown, use file search tools first'), including clear alternatives.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
view_files_full_contextA
Code analysis tool with 'Panoramic Vision'. Optimized for Java/Spring to provide a bird's-eye view across multiple files. Key Effects:
[Dependency Transparency]: Automatically lists injected components (Service/Mapper/MQ) and resolves local imports to absolute paths.
[Model Auto-Expansion]: For any DTO/Entity/VO imported in the current file, it automatically extracts their fields and comments. You don't need to open those files separately to understand the data structure.
[Logic Flow Alignment]: Auto-sorts files by architectural role (Controller -> Service -> Mapper) to follow the business call chain.
[API Outline]: Provides method outlines for dependencies to understand their interface at a glance. Tips: (1) Batch related files (e.g. Controller+ServiceImpl) in one call. (2) NOT recommended to read DTO/VO/Entity/Query individually as they are auto-expanded when reading their consumers.
| Name | Required | Description | Default |
|---|---|---|---|
| AbsolutePaths | Yes | Absolute paths of files to analyze. | |
| StartLine | No | ||
| EndLine | No |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
With no annotations provided, the description carries the full burden of behavioral disclosure. It effectively describes key behavioral traits: automatic listing of injected components, resolution of imports, auto-expansion of model fields and comments, architectural sorting of files, and API outline generation. However, it lacks details on error handling, performance implications, or output format specifics, which prevents a perfect score.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is well-structured with bullet points and tips, making it easy to scan. However, it could be more concise by integrating the tips into the main points and avoiding marketing phrases like 'Panoramic Vision'. Every sentence adds value, but some redundancy exists in explaining auto-expansion benefits.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Given the complexity of the tool (multi-file code analysis with automatic expansions), no annotations, and no output schema, the description does a good job covering key functionalities and usage. However, it lacks details on output format, error cases, or limitations (e.g., file size constraints), which would enhance completeness for such a sophisticated tool.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema description coverage is low (33%), with only AbsolutePaths having a description. The tool description does not explain what AbsolutePaths, StartLine, or EndLine parameters mean or how they affect the analysis. It mentions analyzing 'multiple files' and 'batch related files', which loosely relates to AbsolutePaths, but adds minimal semantic value beyond the schema's basic documentation.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states the tool performs 'code analysis' with 'Panoramic Vision' to provide a 'bird's-eye view across multiple files', specifically optimized for Java/Spring. It distinguishes from siblings by emphasizing multi-file analysis with automatic dependency resolution and model expansion, unlike view_code_items or view_files_outlines which likely focus on single-file or structural overviews.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description provides explicit guidance on when to use this tool vs alternatives: it recommends batching related files (e.g., Controller+ServiceImpl) in one call and explicitly advises NOT to read DTO/VO/Entity/Query files individually since they are auto-expanded when reading their consumers. This clearly differentiates usage from sibling tools.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
view_files_outlinesA
[Deep Code Insight] Batch extraction of file structural outlines. The best tool for exploring global project structures, enhanced for Java with Spring annotation parsing (e.g., identifying API routes, Service components). Use this to concurrently fetch outlines for multiple files when building project maps, tracing interface logic, or performing large-scale code reviews.
| Name | Required | Description | Default |
|---|---|---|---|
| AbsolutePaths | Yes | List of absolute paths for target files. |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
With no annotations provided, the description carries the full burden of behavioral disclosure. It adds useful context about batch extraction, enhanced Java/Spring parsing, and concurrency, but does not cover critical aspects like performance characteristics, error handling, rate limits, or authentication needs. It adequately describes the operation but lacks depth on behavioral traits.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is appropriately sized and front-loaded, starting with a clear purpose and key features. Every sentence adds value, but it could be slightly more concise by avoiding redundancy (e.g., 'exploring global project structures' and 'building project maps' are similar). Overall, it's efficient with minimal waste.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Given the tool's complexity (batch extraction with enhanced parsing), no annotations, and no output schema, the description is moderately complete. It covers the purpose, usage context, and some behavioral insights, but lacks details on output format, error cases, or limitations. It's adequate but has clear gaps for effective agent use.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
The input schema has 100% description coverage, clearly documenting the single parameter 'AbsolutePaths'. The description adds no specific parameter semantics beyond what the schema provides, such as format examples or constraints. With high schema coverage, the baseline score of 3 is appropriate as the description does not compensate but relies on the schema.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states the tool's purpose with specific verbs ('batch extraction', 'fetch outlines') and resources ('file structural outlines', 'multiple files'), and distinguishes it from siblings by mentioning its focus on exploring global project structures and enhanced Java/Spring parsing capabilities, unlike the more granular view_code_items or comprehensive view_files_full_context.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description provides clear context for when to use this tool ('exploring global project structures', 'building project maps', 'tracing interface logic', 'large-scale code reviews') and implies it's for batch processing of multiple files. However, it does not explicitly state when not to use it or name specific alternatives beyond the general sibling tools, missing explicit exclusions.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
TDQS
The tools have distinct primary purposes: view_code_items for precise retrieval of known items, view_files_full_context for panoramic analysis with auto-expansion, and view_files_outlines for structural exploration. However, view_files_full_context and view_files_outlines both involve file-level analysis and could be confused in some scenarios, though their descriptions clarify different focuses (context vs. outlines).
All tool names follow a consistent verb_noun pattern with 'view_' prefix and descriptive suffixes (code_items, files_full_context, files_outlines). The naming is uniform and predictable, making it easy to understand the tool set's structure at a glance.
With 3 tools, the count is appropriate for a code search server, covering precise retrieval, contextual analysis, and structural outlines. It is slightly lean but reasonable, as each tool serves a clear and distinct function without obvious redundancy, though a few more specialized tools might enhance coverage.
The tools cover key aspects of code search and analysis, including retrieval, context, and structure, but there are notable gaps. For example, there is no tool for searching code by content (e.g., text search) or for updating/modifying code, which are common in code-related workflows. The surface is functional but incomplete for a full code interaction domain.
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Related MCP Connectors
Ground-truth code graph for your codebase: exact callers, callees, symbols & dependencies.
Code intelligence for coding agents: semantic, AST, graph, and full-text search. 279+ languages.
Deterministic context layer for your codebase: change impact, blast radius, answers with receipts.
Enterprise code intelligence for M&A, security audits, and tech debt. Hosted server with 200k free.
Related MCP Servers
- FlicenseNot gradedqualityFmaintenanceA high-performance CLI tool that provides semantic code search, advanced architectural analysis, and codebase indexing with vector embeddings across multiple programming languages. Enables AI assistants to understand and navigate large codebases through graph-based relationships and intelligent code pattern detection.872
- AlicenseAqualityDmaintenanceEnables fast code analysis and navigation through hybrid semantic search, graph-based relationship tracking, and structure exploration across multiple programming languages with optimized indexing for large codebases.83MIT
- AlicenseNot gradedqualityCmaintenanceEnables fast semantic code search and analysis across 15+ programming languages. Supports searching for functions and classes, tracing code usage, detecting syntax errors, and analyzing code quality and structure.3433GPL 3.0
- FlicenseNot gradedqualityDmaintenanceEnables LLMs to perform high-performance code search and analysis across multiple languages using symbol indexing, regex text search, and structural AST pattern matching. It also provides tools for technology stack detection and dependency analysis with persistent caching for optimized performance.7
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
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/raintear94/code-search-mcp'
If you have feedback or need assistance with the MCP directory API, please join our Discord server