
najva-ai/sourcegraph-mcp
Developer tools이 페이지는 AI로 자동 번역되었습니다. 기술적인 세부 사항은 원문을 확인하세요. 원문 보기
najva-ai/sourcegraph-mcp는 https://github.com/najva-ai/sourcegraph-mcp.]에서 가져온 MCP 서버 후보입니다
개요
najva-ai/sourcegraph-mcp는 https://github.com/najva-ai/sourcegraph-mcp.]에서 가져온 MCP 서버 후보입니다
개요(AI 번역)
Sourcegraph를 사용하여 AI-enhanced 코드 검색 기능을 제공하는 모델 Context Protocol (MCP) 서버.
내용 표
- 개요
- 특징
- 필수
- 설치
- UV 사용 (추천)
- pip 사용
- Docker 사용
- 구성
- 필수 환경 변수
- 옵션 환경 변수
- AI Tools 사용
- 커서
- MCP 도구
- 검색
- 검색 prompt guide 사이트 맵
- 개발
- 안감 및 서식
개요
이 MCP 서버는 Sourcegraph, 여러 저장소와 codebases를 통해 검색 할 수있는 보편적 인 코드 검색 플랫폼입니다. 그것은 고급 쿼리 문법과 강력한 검색 기능을 제공합니다, 그것은 큰 codebases를 통해 코드 패턴을 찾아 이해하는 AI 조수에 이상적입니다.
특징
- ** 코드 검색**: Sourcegraph의 강력한 쿼리 언어를 사용하여 codebases의 검색
- Advanced Query Language: regex 패턴, 파일 필터, 언어 필터 및 불린 연산자 지원
- Repository Discovery: 이름과 구조를 탐구하여 저장소 찾기 -Content Fetching: 저장소 파일 및 디렉토리
이 페이지는 AI로 자동 번역되었습니다. 기술적인 세부 사항은 원문을 확인하세요.
README
원문 README의 일부입니다. 원문 보기.
Sourcegraph MCP Server
A Model Context Protocol (MCP) server that provides AI-enhanced code search capabilities using Sourcegraph.
Table of Contents
- Overview
- Features
- Prerequisites
- Installation
- Configuration
- Usage with AI Tools
- MCP Tools
- Development
Overview
This MCP server integrates with Sourcegraph, a universal code search platform that enables searching across multiple repositories and codebases. It provides powerful search capabilities with advanced query syntax, making it ideal for AI assistants that need to find and understand code patterns across large codebases.
Features
- Code Search: Search across codebases using Sourcegraph’s powerful query language
- Advanced Query Language: Support for regex patterns, file filters, language filters, and boolean operators
- Repository Discovery: Find repositories by name and explore their structure
- Content Fetching: Browse repository files and directories
- AI Integration: Designed for LLM integration with guided search prompts
Prerequisites
- Sourcegraph Instance: Access to a Sourcegraph instance (either sourcegraph.com or self-hosted)
- Python 3.10+: Required for running the MCP server
- UV (optional): Modern Python package manager for easier dependency management
Installation
Using UV (recommended)
# Install dependencies
uv sync
# Run the server
uv run python -m src.main
Using pip
# Create virtual environment
python -m venv venv
source venv/bin/activate # On Windows: venv\Scripts\activate
# Install package
pip install -e .
# Run the server
python -m src.main
Using Docker
# Build the image
docker build -t sourcegraph-mcp .
# Run the container with default ports
docker run -p 8000:8000 -p 8080:8080 \
-e SRC_ENDPOINT=https://sourcegraph.com \
-e SRC_ACCESS_TOKEN=your-token \
sourcegraph-mcp
# Or run with custom ports
docker run -p 9000:9000 -p 9080:9080 \
-e SRC_ENDPOINT=https://sourcegraph.com \
-e SRC_ACCESS_TOKEN=your-token \
-e MCP_SSE_PORT=9000 \
-e MCP_STREAMABLE_HTTP_PORT=9080 \
sourcegraph-mcp
Configuration
Required Environment Variables
SRC_ENDPOINT: Sourcegraph instance URL (e.g., https://sourcegraph.com)
Optional Environment Variables
SRC_ACCESS_TOKEN: Authentication token for private Sourcegraph instances
설치
docker run -p 8000:8000 -p 8080:8080 \설정
{
"mcpServers": {
"sourcegraph": {
"url": "http://localhost:8080/sourcegraph/mcp/"
}
}
}