Search Tools MCP Server

Search Tools MCP Server

Enables intelligent code analysis and search across repositories using the CodeRank algorithm (inspired by PageRank) to identify critical modules, trace dependencies, find code hotspots, and perform context-aware keyword searches with importance-ranked results.

Category
Visit Server

README

๐Ÿ” Search Tools MCP Server

โšก An intelligent Model Context Protocol (MCP) server that supercharges code analysis with advanced search capabilities and dependency mapping

๐ŸŒŸ Overview

The Search Tools MCP Server is a powerful toolkit that combines traditional code search with intelligent analysis algorithms. It leverages the CodeRank algorithm (inspired by PageRank) to identify the most critical modules in your codebase and provides sophisticated search capabilities that go beyond simple text matching.

๐ŸŽฏ Key Features

๐Ÿ”Ž Smart Search Capabilities

  • Contextual Keyword Search: Ripgrep-powered search with configurable context lines
  • Symbol Discovery: Extract and analyze functions, classes, methods, and modules
  • Usage Tracking: Find where symbols are used across your codebase
  • Priority-Ranked Results: Search results ranked by code importance

๐Ÿง  Intelligence & Analysis

  • CodeRank Algorithm: Identify the most critical modules using network analysis
  • Dependency Mapping: Trace complex dependency chains and impact analysis
  • Hotspot Detection: Find code areas that are both highly connected and frequently used
  • Refactoring Impact: Analyze the potential impact of code changes

๐ŸŽจ Advanced Filtering

  • Symbol type filtering (functions, methods, classes)
  • File inclusion/exclusion patterns
  • External module dependency tracking
  • Markdown documentation analysis

๐Ÿ› ๏ธ Installation

Prerequisites

  • Python 3.13+
  • uv package manager
  • kit CLI tool (for symbol analysis)
  • ripgrep (for fast text search)

Setup

# Clone the repository
git clone <repository-url>
cd search-tools

# Install dependencies
uv sync

โš™๏ธ Configuration

Adding to Cursor/Windsurf

Add the following configuration to your mcp.json file:

{
  "mcpServers": {
    "search-tools": {
      "command": "/path/to/uv",
      "args": [
        "run",
        "--directory",
        "/path/to/search-tools",
        "main.py"
      ]
    }
  }
}

For macOS users with Homebrew:

{
  "mcpServers": {
    "search-tools": {
      "command": "/Users/yourusername/.local/bin/uv",
      "args": [
        "run",
        "--directory",
        "/path/to/your/search-tools/directory",
        "main.py"
      ]
    }
  }
}

To add to claude code:

claude mcp add-json search-tools '{"type":"stdio","command":"/Users/yourusername/.local/bin/uv","args":[ "run", "--directory", "/path/to/your/search-tools/directory", "main.py"]}'

๐Ÿ“ Finding Your Paths

To find the correct paths for your system:

# Find uv location
which uv

# Get absolute path to search-tools directory  
pwd  # (run this from the search-tools directory)

๐Ÿš€ Available Tools

๐Ÿ” contextual_keyword_search

Search for keywords with configurable context lines around matches.

Parameters:

  • keyword: Search term (case insensitive)
  • working_directory: Absolute path to search directory
  • num_context_lines: Lines of context (default: 2)

๐Ÿ—๏ธ get_repo_symbols

Extract symbols (functions, classes, methods) from your codebase.

Parameters:

  • repo: Repository path
  • working_directory: Command execution directory
  • keep_types: Filter by symbol types
  • file_must_contain/file_must_not_contain: File filtering

๐Ÿ“Š get_symbol_usages

Find where specific symbols are used throughout your codebase.

Parameters:

  • repo: Repository path
  • symbol_name_or_substring: Symbol to search for
  • working_directory: Command execution directory
  • symbol_type: Optional type filter

๐ŸŽฏ coderank_analysis

Analyze repository importance using the CodeRank algorithm.

Parameters:

  • repo_path: Repository to analyze
  • external_modules: Comma-separated external dependencies
  • top_n: Number of top modules to return (default: 10)
  • analyze_markdown: Include markdown files
  • output_format: "summary", "detailed", or "json"

๐Ÿ”ฅ find_code_hotspots

Identify critical code areas combining connectivity and usage frequency.

Parameters:

  • repo_path: Repository path
  • working_directory: Command execution directory
  • min_connections: Minimum import connections (default: 5)
  • include_external: Include external dependencies
  • top_n: Number of hotspots to return (default: 20)

๐ŸŒ trace_dependency_impact

Trace dependency chains and analyze refactoring impact.

Parameters:

  • repo_path: Repository path
  • target_module: Module to analyze
  • working_directory: Command execution directory
  • analysis_type: "dependency", "refactoring", or "both"
  • max_depth: Maximum trace depth (default: 3)
  • change_type: "modify", "split", "merge", or "remove"

๐ŸŽช smart_code_search

Enhanced search combining ripgrep with CodeRank prioritization.

Parameters:

  • keyword: Search term (supports regex)
  • repo_path: Repository path
  • working_directory: Command execution directory
  • rank_results: Sort by module importance
  • context_lines: Context lines around matches (default: 3)
  • max_results: Maximum results to return (default: 20)

๐Ÿงช Development & Testing

Running the Server

# Development mode
uv run mcp dev main.py

# Testing with MCP Inspector
npx @modelcontextprotocol/inspector python main.py

๐Ÿ”ง Dependencies

  • mcp[cli]: Model Context Protocol framework
  • cased-kit: Symbol analysis toolkit
  • networkx: Graph analysis for CodeRank algorithm

๐ŸŽจ Algorithm Details

CodeRank Algorithm

The CodeRank algorithm treats your codebase as a directed graph where:

  • Nodes: Python modules, classes, functions, methods
  • Edges: Import relationships and dependencies
  • Weights: Different weights for internal vs external dependencies

This creates a ranking system that identifies the most "central" and important parts of your codebase, similar to how PageRank identifies important web pages.

๐Ÿ’ก Use Cases

  • ๐Ÿ” Code Exploration: Quickly understand large codebases
  • ๐Ÿ—๏ธ Refactoring Planning: Identify high-impact areas before changes
  • ๐Ÿ“š Documentation: Find the most important modules to document first
  • ๐Ÿ› Bug Investigation: Focus on critical code paths
  • ๐Ÿ‘ฅ Code Review: Prioritize review efforts on important modules

๐Ÿค Contributing

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

๐Ÿ“„ License

This project is open source. Please check the license file for details.


<div align="center">

๐Ÿ”ฎ Powered by the CodeRank Algorithm & Model Context Protocol

Making code search intelligent, one repository at a time

</div>

Recommended Servers

playwright-mcp

playwright-mcp

A Model Context Protocol server that enables LLMs to interact with web pages through structured accessibility snapshots without requiring vision models or screenshots.

Official
Featured
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

An AI-powered tool that generates modern UI components from natural language descriptions, integrating with popular IDEs to streamline UI development workflow.

Official
Featured
Local
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

Enables interaction with Audiense Insights accounts via the Model Context Protocol, facilitating the extraction and analysis of marketing insights and audience data including demographics, behavior, and influencer engagement.

Official
Featured
Local
TypeScript
VeyraX MCP

VeyraX MCP

Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.

Official
Featured
Local
graphlit-mcp-server

graphlit-mcp-server

The Model Context Protocol (MCP) Server enables integration between MCP clients and the Graphlit service. Ingest anything from Slack to Gmail to podcast feeds, in addition to web crawling, into a Graphlit project - and then retrieve relevant contents from the MCP client.

Official
Featured
TypeScript
Kagi MCP Server

Kagi MCP Server

An MCP server that integrates Kagi search capabilities with Claude AI, enabling Claude to perform real-time web searches when answering questions that require up-to-date information.

Official
Featured
Python
E2B

E2B

Using MCP to run code via e2b.

Official
Featured
Neon Database

Neon Database

MCP server for interacting with Neon Management API and databases

Official
Featured
Exa Search

Exa Search

A Model Context Protocol (MCP) server lets AI assistants like Claude use the Exa AI Search API for web searches. This setup allows AI models to get real-time web information in a safe and controlled way.

Official
Featured
Qdrant Server

Qdrant Server

This repository is an example of how to create a MCP server for Qdrant, a vector search engine.

Official
Featured