HS

haacked/spelungit

开发工具

本页由 AI 翻译,技术细节请以原文为准。 查看原文

30 stars 2 forks 质量 65 趋势 11MIT

一个用于自然语言搜索git历史的MCP服务器

概览

一个用于使用语义搜索探索 Git 提交历史的模型上下文协议(MCP)服务器。通过自然语言命令搜索提交,比如“搜索 git 历史以了解为何添加此类?” - :对Git提交历史进行自然语言查询 - : 自动检测并隔离不同仓库 - : 开箱即用,支持SQLite + 本地嵌入 - : 为代码变更和技术内容优化的混合嵌入 - : 处理复杂的Git设置,包括工作树 - : Claude代码自动配置 - 自动下载和安装Spelungit - 搭建Python虚拟环境 - 安装依赖(句子变换器、SQLite、numpy)- 自动配置Claude代码 - 测试安装 对于开发者或偏好克隆该仓库的用户: 添加到你的Claude Code配置中(~/.config/claude/claude_desktop_config.json): 1. - 使用自然语言进行搜索提交 2.- 索引用于搜索的仓库 3.

概述(AI 翻译)

一个用于探索 Git 提交历史的模型上下文协议(MCP)服务器,使用 语义搜索。通过提交搜索,使用自然语言命令,如 “搜索git历史记录,看看为什么会添加这个课程?”

✨ 特色

  • ** 🔍 语义搜索**:基于Git提交历史的自然语言查询
  • ** 🌳 多存储库支持**:自动检测并隔离不同仓库
  • ** ⚡ 零配置安装**:开箱即用,支持SQLite + 本地嵌入
  • ** 🎯 代码感知搜索**:针对代码变更和技术内容优化的混合嵌入
  • ** 📊 Git 工作树支持 **:处理复杂的 Git 设置,包括工作树
  • ** 🚀 Claude 代码集成**:Claude 代码的自动配置

🚀 快速安装

单线安装(推荐给终端用户):

该命令将:

  • 自动下载并安装Spelungit
  • 建立 Python 虚拟环境
  • 安装依赖关系(句子变换器、SQLite、numpy)
  • 自动配置 Claude 代码
  • 测试安装

要求:Python 3.8+ 和 curl/wget

🔧 高级安装

选项1:克隆并安装

本页由 AI 翻译,技术细节请以原文为准。

README

以下为原文 README 节选,完整内容请查看原文。

Spelungit MCP Server

A Model Context Protocol (MCP) server for exploring Git commit history using semantic search. Search through commits with natural language commands like “Search git history to find out why was this class added?”

✨ Features

  • 🔍 Semantic Search: Natural language queries over Git commit history
  • 🌳 Multi-Repository Support: Automatically detects and isolates different repositories
  • ⚡ Zero-Config Installation: Works out of the box with SQLite + local embeddings
  • 🎯 Code-Aware Search: Hybrid embeddings optimized for code changes and technical content
  • 📊 Git Worktree Support: Handles complex Git setups including worktrees
  • 🚀 Claude Code Integration: Automatic configuration for Claude Code

🚀 Quick Install

One-line installation (recommended for end users):

curl -sSL https://raw.githubusercontent.com/haacked/spelungit/main/install-remote.sh | bash

This command will:

  • Download and install Spelungit automatically
  • Set up a Python virtual environment
  • Install dependencies (sentence-transformers, SQLite, numpy)
  • Configure Claude Code automatically
  • Test the installation

Requirements: Python 3.8+ and curl/wget

🔧 Advanced Installation

Option 1: Clone and Install

For developers or users who prefer to clone the repository:

git clone https://github.com/haacked/spelungit.git
cd spelungit
./install.sh

Option 2: Manual Installation

# Create virtual environment
python -m venv venv
source venv/bin/activate  # On Windows: venv\Scripts\activate

# Install dependencies
pip install -r requirements.txt

# Test the installation
python -m spelungit.server --test

Add to your Claude Code configuration (~/.config/claude/claude_desktop_config.json):

{
  "mcpServers": {
    "spelungit": {
      "command": "/path/to/venv/bin/python",
      "args": ["-m", "spelungit.server"],
      "env": {
        "PYTHONPATH": "/path/to/spelungit/src"
      }
    }
  }
}

📖 Usage

Available Tools

  1. search_commits - Search commits using natural language
  2. index_repository - Index a repository for search
  3. repository_status - Check indexing status
  4. get_database_info - View database statistics
  5. search_blame - Search code blame data using natural language
  6. who_wrote - Find authors who wrote code matching a query
  7. configure_auto_update - Configure automatic index update behavior
  8. get_auto_update_config - Get current automatic index update configuration

Example Queries

# Search for authentication-related changes
search_commits(query="authentication login changes", limit=5)

# Find database migration commits
search_commits(query="database schema migration", author_filter="john")

# Look for bug fixes
search_commits(query="fix error exception handling")

# Search blame information for specific code
search_blame(query="authentication middleware setup")
在 GitHub 查看完整 README

安装

This server does not publish a one-line install command.

Open the repository installation guide 新手?先看 mcpskill.org 教程 →

配置

{ "mcpServers": { "spelungit": { "command": "/path/to/venv/bin/python", "args": ["-m", "spelungit.server"], "env": { "PYTHONPATH": "/path/to/spelungit/src" } } } }