mcp-codesearch
Server Configuration
Describes the environment variables required to run the server.
| Name | Required | Description | Default |
|---|---|---|---|
| VECTOR_QDRANT_URL | No | Qdrant server URL | http://localhost:6333 |
| VECTOR_EMBEDDING_DIM | Yes | Vector dimension (must match your model, e.g., 768, 1536) | |
| VECTOR_EMBEDDING_URL | No | OpenAI-compatible embeddings API endpoint | http://localhost:8080 |
| VECTOR_EMBEDDING_MODEL | Yes | Embedding model name (e.g., nomic-embed-text, text-embedding-3-small) | |
| CODESEARCH_CHUNK_MAX_LINES | No | Max lines per fallback chunk | 500 |
| CODESEARCH_CHUNK_MIN_LINES | No | Merge chunks smaller than this | 10 |
| CODESEARCH_UPSERT_CONCURRENCY | No | Max concurrent upsert batches | 1 |
| CODESEARCH_CHUNK_OVERLAP_LINES | No | Overlap between fallback chunks | 25 |
| CODESEARCH_DELETION_CONCURRENCY | No | Concurrent Qdrant operations during incremental indexing | 50 |
| CODESEARCH_UPSERT_BATCH_TIMEOUT | No | Batch operation timeout (seconds) | 300 |
| CODESEARCH_CLASS_SPLIT_THRESHOLD | No | Lines threshold for splitting large classes | 50 |
| CODESEARCH_SEARCH_CACHE_MAX_SIZE | No | Max cached search results | 100 |
| CODESEARCH_SEARCH_CACHE_TTL_SECONDS | No | Search cache TTL (seconds) | 300 |
| CODESEARCH_SEARCH_CACHE_EVICTION_RATIO | No | Fraction of cache to evict when full | 0.2 |
Capabilities
Features and capabilities supported by this server
| Capability | Details |
|---|---|
| tools | {
"listChanged": false
} |
| prompts | {
"listChanged": false
} |
| resources | {
"subscribe": false,
"listChanged": false
} |
| experimental | {} |
Tools
Functions exposed to the LLM to take actions
| Name | Description |
|---|---|
| list_collectionsA | List all indexed codebases. Returns: List of collection names and their codebase paths |
| delete_collectionA | Delete index for a codebase. Args: path: Root path of codebase to remove from index collection_id: Direct collection ID (e.g., "codesearch_abc123") for orphan cleanup Returns: Confirmation message Note: Use collection_id to delete orphaned collections that show as "unknown" in list_collections. Either path or collection_id must be provided, but not both. |
| cleanup_orphansA | Find and delete orphaned collections whose codebase directory is gone. A collection is deleted only when its codebase path is known and confirmed absent on disk. Collections whose path cannot be determined (no stored or inferable path, or a backend error reading it) or whose path is currently inaccessible (for example on an unmounted removable or network volume) are kept and reported as skipped, never deleted, so a temporarily unavailable codebase is not mistaken for a deleted one. Run this while any removable or network volumes holding indexed codebases are mounted. Returns: Summary of cleaned up, skipped, and remaining collections |
| index_statusA | Check indexing status for a codebase. Args: path: Root path of codebase Returns: Status info: file count, last indexed, pending changes |
| force_reindexB | Force complete re-indexing of a codebase. Args: path: Root path of codebase Returns: Indexing result summary |
| preview_indexA | Preview what would be indexed without actually indexing. Args: path: Root path of codebase show_files: If True, list individual file paths limit: Max files to show when show_files=True Returns: Summary of what would be indexed |
| code_searchA | Semantic code search. Auto-indexes on first use, incrementally updates thereafter. Args: query: Natural language description of what you're looking for. Supports special syntax: - function:name or fn:name - search for specific function - class:name or cls:name - search for specific class - struct:name - search for specific struct (Rust, C, Go) - path:prefix - filter to paths starting with prefix - -path:pattern - exclude paths containing pattern path: Root path of codebase (defaults to current directory) mode: "file", "chunk" (function/class level), or "both" (combined) limit: Max results to return (default 10) language: Filter by language (python, typescript, etc.) path_prefix: Only return results from paths starting with prefix (e.g., "src/") exclude_paths: Exclude paths containing these strings (e.g., ["test", "vendor"]) output_format: Output format - "text", "json", or "markdown" Returns: Formatted search results with file paths and relevant code |
| search_multipleA | Search across multiple codebases concurrently. Each codebase is indexed (incrementally, when needed) and searched in parallel, so overall latency is bounded by the slowest codebase rather than the sum of them all. Args: query: Natural language description of what you're looking for paths: List of codebase paths to search (e.g., ["./repo1", "./repo2"]) mode: "file" for file-level, "chunk" for function/class level, "both" for combined limit: Max results per codebase (also the cap on fused results when global_ranking is True) language: Filter by language (python, typescript, etc.) output_format: Output format - "text", "json", or "markdown" global_ranking: When False (default), results are grouped under one "=== path ===" section per codebase. When True, results from every codebase are merged into a single list ranked across codebases with Reciprocal Rank Fusion and tagged by their source codebase — answering "across all my repos, where is the best match?". RRF fuses by rank position, so it is robust to the fact that raw similarity scores from different collections are not directly comparable. Returns: Results grouped per codebase (default) or a single globally-ranked list. |
| search_changedA | Search only in files that have changed since a given commit or time. The changed-file set is pushed into the retrieval layer as a Qdrant payload filter, so ranking happens within the changed files only and a match cannot be lost below a candidate pool. For very large change sets (over 500 files) the tool falls back to post-filtering a bounded candidate pool to keep filter payloads small. Args: query: Natural language description of what you're looking for path: Root path of git repository (defaults to current directory) since: Git revision or time to compare against (e.g., "HEAD~10", "main", "3.days.ago") limit: Max results to return (default 10) output_format: Output format - "text" (default), "json", or "markdown" Returns: Search results filtered to changed files |
| find_similarB | Find code similar to the provided snippet. Args: code: Code snippet to find similar code for path: Root path of codebase to search (defaults to current directory) limit: Max results to return (default 10) language: Filter by language (python, typescript, etc.) exclude_self: If True, excludes exact matches of the input code (default True) output_format: Output format - "text" (default), "json", or "markdown" Returns: Similar code snippets ranked by similarity score |
| find_referencesA | Find all usages/references of a symbol (function, class, variable). Args: symbol: Name of the function, class, or variable to find references for path: Root path of codebase to search (defaults to current directory) limit: Max results to return (default 20) include_definition: If True, includes the symbol's definition in results output_format: Output format - "text" (default), "json", or "markdown" Returns: List of code locations where the symbol is referenced |
Prompts
Interactive templates invoked by user choice
| Name | Description |
|---|---|
No prompts | |
Resources
Contextual data attached and managed by the client
| Name | Description |
|---|---|
No resources | |
Latest Blog Posts
- 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/michaelkrauty/mcp-codesearch'
If you have feedback or need assistance with the MCP directory API, please join our Discord server