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 "Deploy 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 Server show 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.
Inputs: Items (required).
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.
Inputs: AbsolutePaths (required), StartLine, EndLine.
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.
Inputs: AbsolutePaths (required).
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 3 tools
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
Related MCP Connectors
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.
Code intelligence platform for AI agents. 20 tools for architecture, security & impact analysis.
Related MCP Servers
- FlicenseNot gradedqualityBmaintenanceA 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.921-
- 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 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.12MIT
- FlicenseNot gradedqualityDmaintenanceAnalyzes Java codebases using an internal Knowledge Graph stored in SQLite, enabling symbol search, endpoint tracing, and impact analysis without requiring AI APIs.-