Local Search MCP Server

Local Search MCP Server

Enables semantic search across indexed documents using vector embeddings. Index GitHub repositories and URLs to perform natural language queries with AI-enhanced contextual results.

Category
访问服务器

README

npm version Node.js Version License: MIT

Local Search MCP Server

A Model Context Protocol (MCP) server that enables AI assistants to perform semantic search across indexed documents using vector embeddings. Index documents from GitHub repositories and URLs to power natural language queries with contextual results.

Table of Contents

Features

  • Semantic Search: Natural language queries over indexed documents using transformer embeddings
  • Repository Indexing: Clone and index GitHub repositories with configurable file patterns
  • File Downloads: Fetch and index files from URLs with automatic processing
  • Async Processing: Non-blocking operations with job progress tracking
  • SQLite Storage: Efficient vector storage with optimized similarity search
  • MCP Protocol: Full compatibility with Claude Desktop and other MCP applications

Quick Start

The fastest way to get started is using npx (no cloning or building required):

# Run directly with npx
npx -y local-search-mcp

# Or install globally
npm install -g local-search-mcp

MCP Configuration (npx)

Add to Claude Desktop's claude_desktop_config.json:

{
  "mcpServers": {
    "local-search": {
      "command": "npx",
      "args": ["-y", "local-search-mcp"],
      "env": {
        "MCP_DATA_FOLDER": "/optional/custom/data/path",
        "MCP_DOCS_FOLDER": "/optional/custom/docs/path"
      }
    }
  }
}

Installation

Prerequisites

  • Node.js >= 18.0.0
  • npm or yarn package manager
  • Git for cloning repositories (development only)

Option 1: NPM Package (Recommended)

# Install globally
npm install -g local-search-mcp

# Or use directly with npx (no installation needed)
npx local-search-mcp

Option 2: From Source (Development)

# Clone the repository
git clone https://github.com/PatrickRuddiman/local-search-mcp.git
cd local-search-mcp

# Install dependencies
npm install

# Build the project
npm run build

MCP Configuration

For NPM package installation:

{
  "mcpServers": {
    "local-search": {
      "command": "npx",
      "args": ["-y", "local-search-mcp"],
      "env": {
        "MCP_DATA_FOLDER": "/optional/custom/data/path",
        "MCP_DOCS_FOLDER": "/optional/custom/docs/path"
      }
    }
  }
}

For source installation:

{
  "mcpServers": {
    "local-search": {
      "command": "node",
      "args": ["/absolute/path/to/local-search-mcp/build/index.js"],
      "env": {
        "MCP_DATA_FOLDER": "/optional/custom/data/path",
        "MCP_DOCS_FOLDER": "/optional/custom/docs/path"
      }
    }
  }
}

Usage

Once configured, the server provides semantic search capabilities within Claude Desktop and other MCP-compatible applications.

Tools

The Local Search MCP Server provides 7 tools for document indexing and semantic search:

🔍 Search Tools

search_documents

Perform AI-enhanced semantic search with content classification, domain detection, and intelligent recommendations.

Parameters:

  • query (required): Natural language search query
  • options (optional): Search configuration object
    • limit (number, default: 10): Maximum results to return
    • minScore (number, default: 0.7): Minimum similarity score (0-1)
    • includeMetadata (boolean, default: true): Include metadata in results
    • domainFilter (array): Filter by technology domains (e.g., ["javascript", "python"])
    • contentTypeFilter (array): Filter by content type ("code", "docs", "config", "mixed")
    • languageFilter (array): Filter by programming language (e.g., ["typescript", "javascript"])
    • minQualityScore (number): Minimum content quality score (0-1)
    • minAuthorityScore (number): Minimum source authority score (0-1)

Example:

{
  "query": "async await promises javascript",
  "options": {
    "limit": 5,
    "domainFilter": ["javascript"],
    "contentTypeFilter": ["code", "docs"]
  }
}

get_file_details

Retrieve detailed content of a specific file with surrounding chunk context.

Parameters:

  • filePath (required): Absolute path to file
  • chunkIndex (optional): Specific chunk to retrieve with surrounding context
  • contextSize (number, default: 3): Number of chunks to include before and after target chunk

📦 Content Management Tools

fetch_repo

Clone a Git repository (GitHub, Azure DevOps, etc.) using repomix, convert to markdown, and add to searchable index. Returns job ID for progress tracking.

Parameters:

  • repoUrl (required): Git repository URL
  • branch (optional): Branch/tag/commit, defaults to main/master
  • options (optional): Repository processing options
    • includePatterns (array, default: ["/*.md", "/.mdx", "**/.txt", "/*.json", "/.rst", "**/.yml", "**/*.yaml"]): File patterns to include
    • excludePatterns (array, default: ["/node_modules/"]): File patterns to exclude
    • outputStyle (string, default: "markdown"): Output format (fixed to markdown)
    • removeComments (boolean, default: false): Remove comments from code files
    • showLineNumbers (boolean, default: true): Show line numbers in output

Example:

{
  "repoUrl": "https://github.com/microsoft/TypeScript",
  "branch": "main",
  "options": {
    "includePatterns": ["**/*.md", "**/*.ts"],
    "excludePatterns": ["**/node_modules/**", "**/tests/**"]
  }
}

fetch_file

Download a single file from a URL and add it to the searchable index. Returns job ID for progress tracking.

Parameters:

  • url (required): URL of file to download
  • filename (required): Desired filename for saving
  • options (optional): Download options
    • overwrite (boolean, default: true): Whether to overwrite existing files
    • indexAfterSave (boolean, default: true): Automatically index after download
    • maxFileSizeMB (number, default: 1024): Maximum file size in MB

remove_file

Delete a file and all its associated chunks and embeddings from the index.

Parameters:

  • filePath (required): Absolute path to file to remove

flush_all

Flush the entire database and all downloaded files. WARNING: This action is irreversible and will delete all indexed content, documents, and cached files.

Parameters: None

What gets deleted:

  • All vector embeddings and document chunks from the database
  • All recommendation and learning data
  • All downloaded files from the fetched directory
  • All cloned repositories from the repositories directory
  • All temporary files from the temp directory
  • All active background jobs are cancelled

Example:

{
  "name": "flush_all",
  "arguments": {}
}

⚙️ Job Management Tools

get_job_status

Get status and progress of an async job by ID with real-time accurate progress.

Parameters:

  • jobId (required): Job ID returned from fetch_* operations

Returns:

  • Job status: "running", "completed", or "failed"
  • Progress percentage (0-100)
  • Duration and timestamps
  • Error message if failed
  • Result data if completed

list_active_jobs

List all currently active (running) jobs with their status and progress.

Parameters: None

Returns:

  • List of active jobs with progress
  • Job statistics (total, completed, failed, average duration)
  • Real-time progress updates

Documentation

For detailed technical documentation:

Development

npm install
npm run build
npm run dev  # Development with hot reload

Configuration

Environment Variables

Set optional environment variables for custom paths:

  • MCP_DATA_FOLDER - Custom database and logs directory (defaults to platform-specific user data folder)
  • MCP_DOCS_FOLDER - Custom document storage directory (defaults to platform-specific user documents folder)

Supported File Types

The server processes these file types:

  • Documentation: .md, .txt, .rst, .yaml, .yml
  • Data: .json, .csv
  • Code: .js, .ts, .py, .java, .c, .cpp, .html, .css
  • Files up to 1GB are supported

Acknowledgments

Release Process

This project uses automated semantic versioning and publishing through GitHub Actions and semantic-release.

Commit Message Format

Follow Conventional Commits specification:

<type>[optional scope]: <description>

[optional body]

[optional footer(s)]

Types that trigger releases:

  • feat: - New features (minor version bump)
  • fix: - Bug fixes (patch version bump)
  • perf: - Performance improvements (patch version bump)
  • BREAKING CHANGE: - Breaking changes (major version bump)

Other types (no release):

  • docs: - Documentation changes
  • style: - Code formatting
  • refactor: - Code refactoring
  • test: - Adding tests
  • chore: - Build process or auxiliary tool changes

Contributing

  1. Fork the repository
  2. Create a feature branch with descriptive name
  3. Make changes following conventional commit format
  4. Submit a pull request targeting the main branch
  5. Ensure all CI checks pass before requesting review

Author

Patrick Ruddiman
GitHub

License

MIT - see LICENSE for details.

推荐服务器

Baidu Map

Baidu Map

百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。

官方
精选
JavaScript
Playwright MCP Server

Playwright MCP Server

一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。

官方
精选
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。

官方
精选
本地
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。

官方
精选
本地
TypeScript
VeyraX

VeyraX

一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。

官方
精选
本地
graphlit-mcp-server

graphlit-mcp-server

模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。

官方
精选
TypeScript
Kagi MCP Server

Kagi MCP Server

一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。

官方
精选
Python
e2b-mcp-server

e2b-mcp-server

使用 MCP 通过 e2b 运行代码。

官方
精选
Neon MCP Server

Neon MCP Server

用于与 Neon 管理 API 和数据库交互的 MCP 服务器

官方
精选
Exa MCP Server

Exa MCP Server

模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。

官方
精选