loading…
Search for a command to run...
loading…
Enables LLMs to perform advanced GitHub code searches with intelligent filtering and content retrieval using Playwright automation, optimized for DeepSeek integ
Enables LLMs to perform advanced GitHub code searches with intelligent filtering and content retrieval using Playwright automation, optimized for DeepSeek integration.
Python Version License: MIT MCP
A powerful Model Context Protocol (MCP) server that enables Large Language Models to perform advanced GitHub code searches with intelligent filtering and content retrieval capabilities, optimized for DeepSeek integration.
The GitHub Advanced Search (G.A.S.) MCP server provides LLMs with sophisticated GitHub search capabilities that go beyond standard API limitations. Using web automation with Playwright, it enables deep code discovery, pattern analysis, and content retrieval across the entire GitHub ecosystem. This version includes enhanced support for DeepSeek models, providing tailored search results and structured JSON output.
tested using vscode + cline + openrouter:deepseek/deepseek-r1-0528:free
# step1: init gas
gas_entrypoint
# step2: feed model
gas_search_code
file_name: clinerules
# step3: make your wish
You are now have better knowledge of `clinerules`
please keep the current file format and deep level
enhance the `<file-path-to-clinerules>`
graph TB
subgraph "MCP Client (LLM)"
A[Claude/GPT/Other LLM]
end
subgraph "MCP Server (G.A.S.)"
B[MCP Server]
C[Search Engine]
D[Playwright Browser]
E[Content Fetcher]
F[Result Processor]
end
subgraph "GitHub"
G[GitHub Search]
H[Repository Files]
I[Raw Content]
end
A -->|MCP Protocol| B
B --> C
C --> D
D -->|Web Automation| G
G -->|Search Results| D
D --> E
E -->|HTTP Requests| I
I -->|File Content| E
E --> F
F -->|Structured Data| B
B -->|JSON Response| A
classDef client fill:#e1f5fe,stroke:#01579b,color:#01579b
classDef server fill:#e8f5e9,stroke:#2e7d32,color:#1b5e20
classDef github fill:#f3e5f5,stroke:#4a148c,color:#4a148c
class A client
class B,C,D,E,F server
class G,H,I github
sequenceDiagram
participant LLM as LLM Client
participant MCP as MCP Server
participant PW as Playwright Browser
participant GH as GitHub Search
participant API as GitHub Raw API
LLM->>MCP: gas_search_code(keyword, file_name)
MCP->>PW: Launch browser session
PW->>GH: Navigate to search URL
GH-->>PW: Search results page
PW->>PW: Extract repository & file links
loop For each page
PW->>GH: Navigate to page N
GH-->>PW: Results for page N
PW->>PW: Extract links from page
end
MCP->>API: Fetch file contents (async)
API-->>MCP: Raw file content
MCP->>MCP: Structure response data
MCP-->>LLM: JSON with repositories, files & content
alt More results available
LLM->>MCP: get_remaining_result(start_id)
MCP-->>LLM: Next batch of results
end
Install the package:
pip install mcp-server-git-gas
Install Playwright browsers:
playwright install chromium
💀Not tested Configure your MCP client (e.g. claude desktop):
Add to your claude_desktop_config.json:
# not tested !!!
{
"mcpServers": {
"github-advanced-search": {
"command": "mcp-server-git-gas",
"args": []
}
}
}
Once configured, you can start searching GitHub through your LLM:
Search GitHub for Python files containing "async def" functions
The LLM will automatically use the G.A.S. tools to perform the search and return structured results.
$ cd ~
$ git clone --depth=1 https://github.com/louiscklaw/mcp-github-advanced-search ~/mcp/mcp-git-gas
# Install Playwright browsers
$ playwright install chrome
$ playwright install --deps
# this will create the user_data_dir for chromium
# go login google or any other service you want
$ cd ~/mcp/mcp-git-gas
$ ./seedChromeUserDataDir.sh
{
"mcp": {
"servers": {
"git-gas": {
"autoApprove": [
"get_remaining_result",
"gas_readme",
"gas_search_code"
],
"disabled": false,
"timeout": 300,
"type": "stdio",
"command": "uv",
"args": [
"--directory",
"<USER_HOME_DIR>/mcp/mcp-git-gas/src/mcp_server_git_gas",
"run",
"mcp-server-git-gas"
]
}
}
}
}
gas_entrypointInitialize and get information about the GitHub Advanced Search server.
Parameters: None
Returns: Server information and usage instructions with workflow diagram.
graph TD
a((start))
d((end))
b("search code with filter (gas_search_code)")
c("return search result")
c1("is the result finished ?")
c2("use get_remaining_result to list remaining result")
a --> b --> c --> c1 -- Yes --> d
c1 -- No --> c2
c2 --> c1
gas_search_codeSearch GitHub repositories with advanced filters.
Parameters:
keyword (string, optional): Search keyword (single word recommended)file_name (string, optional): Specific filename to search for (e.g., ".clinerules", "README.md")Returns: Array of search results with:
[
{
"REPOSITORY_LINK": "https://github.com/owner/repo",
"FILE_LINK": "https://github.com/owner/repo/blob/main/file.py",
"RAW_UESR_CONTENT_LINK": "https://raw.githubusercontent.com/owner/repo/main/file.py",
"FILE_CONTENT": "actual file content..."
}
]
get_remaining_resultRetrieve additional results from a previous search (pagination).
Parameters:
start_id (integer): Starting index for the next batch of resultsReturns: Next batch of search results with the same structure as gas_search_code.
call `gas_entrypoint` to initialize yourself
Hi,
please use `gas_search_code` with below json
{
"keyword": "mcp mermaid",
"file_name": "README.md"
}
and understand the content returned, i will send you the task afterwards.
i am working on a python project,
please task a look to the source code of the project.
with the help from files in former results.
please help to and update the README file.
The server uses Playwright with persistent browser context for:
Browser data is stored in: ~/mcp/mcp-git-gas/_user_data_dir
# Clone the repository
git clone <repository-url>
cd mcp-server-git-gas
# Create virtual environment
python -m venv .venv
source .venv/bin/activate # On Windows: .venv\Scripts/activate
# Install dependencies
pip install -e .
# Install development dependencies
pip install -e ".[dev]"
# Run tests
pytest
src/mcp_server_git_gas/
├── __init__.py # CLI entry point
├── server.py # Main MCP server implementation
├── CONST.py # Configuration constants
├── fetch_data.py # Async HTTP client
├── fetchFileContent.py # File content retrieval
├── convertFileLinkToRaw... # URL conversion utilities
├── url_util.py # URL building helpers
└── git_dump_screen.py # Debug utilities
# Test the server with MCP inspector
npx @modelcontextprotocol/inspector uvx mcp-server-git-gas
# Build development image
docker build -t mcp/git-gas:dev .
# Run with volume mount for development
docker run --rm -i \
-v $(pwd):/app \
mcp/git-gas:dev
gas_search_code with search parameters"Not logged in" errors
seedChromeUserDataDir.sh to start a browser and perform loginNo results found
keywords for typosBrowser launch failures
playwright install chromiumRate limiting
Debug screenshots are saved to: ~/mcp_github_advanced_search/debug.png
We welcome contributions! Please see our Contributing Guidelines for details.
git checkout -b feature/amazing-feature)This project is licensed under the MIT License - see the LICENSE file for details.
Note: This server requires a GitHub account for optimal functionality. Some features may be limited when used without authentication.
Выполни в терминале:
claude mcp add mcp-github-advanced-search -- npx Не уверен что выбрать?
Найди свой стек за 60 секунд
Автор?
Embed-бейдж для README
Похожее
Все в категории development