GitHub Contracts Extractor

March 12, 2025 ยท View on GitHub

A simple tool to extract Solidity contracts from GitHub repositories.

Requirements

  • Python 3.13 or higher
  • uv - Python package manager
  • Claude Desktop app

Installation

  1. Clone the repository:
git clone [repository-url]
cd [repository-name]
  1. Create a virtual environment and install dependencies:
uv venv
source .venv/bin/activate  # On Windows, use: .venv\Scripts\activate
uv pip install -e .

Setting Up with Claude Desktop

  1. Download the latest Claude Desktop application

  2. Configure MCP server by editing the Claude Desktop configuration:

code ~/Library/Application\ Support/Claude/claude_desktop_config.json
  1. Add the following configuration (replace Username with your actual username):
{
    "mcpServers": {
        "github_contracts": {
            "command": "/Users/Username/.local/bin/uv",
            "args": [
                "--directory",
                "/Users/Username/mcp-demo",
                "run",
                "/Users/Username/mcp-demo/github_contracts.py"
            ]
        }
    }
}
  1. Restart Claude Desktop

Usage

Using with Claude Desktop

After completing the setup, you can analyze smart contracts from GitHub repositories by simply typing:

audit smart contracts in the link

You can provide a GitHub repository URL, and Claude will extract and analyze the Solidity contracts.

Project Structure

  • github_contracts.py - Main application for extracting Solidity contracts
  • pyproject.toml - Project configuration and dependencies

License

[Specify license information here]