mcp-repo-context

mcp-repo-context

A Weaviate-backed MCP server that gives Claude Code agents semantic search over your repository's PR review comments and source code.

Category
访问服务器

README

mcp-repo-context

A Weaviate-backed MCP server that gives Claude Code agents semantic search over your repository's PR review comments and source code.

What it does

  • Extracts PR review comments from GitHub and chunks your source code into functions/classes/types
  • Embeds everything into Weaviate via the text2vec-transformers module (runs locally, no API keys)
  • Serves 6 MCP tools that Claude Code agents can call during peer reviews and solution planning

MCP Tools

Tool Description
search_similar_reviews Semantic search across past PR review comments
get_review_patterns_for_file Find review feedback related to a specific file
get_ticket_review_history All review comments for a specific ticket
search_codebase Semantic search across source code chunks
get_file_chunks Get all functions/classes in a file
get_module_overview List all code in a module

Prerequisites

  • Weaviate running with the text2vec-transformers module enabled and reachable at WEAVIATE_HOST:WEAVIATE_PORT (defaults: localhost:8080 HTTP, localhost:50052 gRPC). Any deployment works — a standalone docker compose stack, a hosted instance, etc.
  • Python 3 with pip (needs weaviate-client>=4.0.0)
  • Node.js >= 18
  • Claude Code CLI (claude)
  • GitHub CLI (gh), authenticated — only required if you extract fresh review data

Quick Start

The setup script is designed to be run from the root of the repo you want to index. It verifies Weaviate connectivity, optionally ingests data, builds the MCP server, and registers it with Claude Code.

Option A: Register against already-ingested Weaviate

cd /path/to/your-repo
/path/to/mcp-repo-context/setup.sh

Option B: Ingest pre-built JSONL first, then register

cd /path/to/your-repo
/path/to/mcp-repo-context/setup.sh --data-dir ./data

The --data-dir flag points at a directory containing review-comments.jsonl and/or codebase-chunks.jsonl (schema is defined by ingest.py).

Option C: Extract fresh data from GitHub, ingest, then register

cd /path/to/your-repo
REVIEW_AUTHORS=your-github-username /path/to/mcp-repo-context/setup.sh --extract

This runs extract-review-comments.py and extract-codebase.py against the current repo, writes JSONL into ./data/, ingests into Weaviate, and registers the MCP server.

Configuration

All scripts read configuration from environment variables.

Weaviate connection

Variable Default Description
WEAVIATE_HOST localhost Weaviate host
WEAVIATE_PORT 8080 Weaviate HTTP port
WEAVIATE_GRPC_PORT 50052 Weaviate gRPC port

Extraction (when using --extract)

Variable Default Description
GITHUB_REPO Auto-detected via gh GitHub repo in owner/repo format
REVIEW_AUTHORS All humans (bots excluded) Comma-separated GitHub usernames to include
TICKET_PATTERN [A-Z]+-\d+ Regex to extract ticket IDs from PR titles
SOURCE_GLOBS **/*.ts, **/*.vue, **/*.js JSON array of [label, glob] pairs
EXCLUDE_DIRS node_modules,dist,... Comma-separated directories to skip

How it works

  1. Weaviate stores the data. Two collections are created by ingest.py — one for review comments, one for codebase chunks. Vectors are generated at ingest time by Weaviate's text2vec-transformers module, so no embeddings live in the JSONL.
  2. Extraction is optional. The repo ships with extract-review-comments.py and extract-codebase.py for generating JSONL from scratch, but you can also hand-author JSONL files if you already have the data.
  3. The MCP server runs on the host. setup.sh runs npm install && npm run build against mcp-server/ and registers the compiled build/index.js with Claude Code via claude mcp add. No Docker is required for the server itself.
  4. Queries go through a Python bridge. The Node MCP server spawns query-review-knowledge.py / query-codebase.py via execFile, passing JSON args and reading JSON results from stdout. This keeps the Weaviate client in Python while the MCP protocol is served over stdio from Node.

After setup

The setup script registers an MCP server named review-knowledge. To use its tools in Claude Code, allowlist the tool IDs in your Claude Code permissions:

mcp__review-knowledge__search_similar_reviews
mcp__review-knowledge__get_review_patterns_for_file
mcp__review-knowledge__get_ticket_review_history
mcp__review-knowledge__search_codebase
mcp__review-knowledge__get_file_chunks
mcp__review-knowledge__get_module_overview

Then restart Claude Code. Verify registration with claude mcp list.

License

MIT — see LICENSE.

推荐服务器

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 模型以安全和受控的方式获取实时的网络信息。

官方
精选