Sponsored by Deepsite.site

Patent Downloader

Created By
Edison-A-N4 months ago
A Python SDK for downloading patents from Google Patents with Model Context Protocol (MCP) support.
Content

Patent Downloader SDK

A Python SDK for downloading patents from Google Patents with Model Context Protocol (MCP) support.

Features

  • Download patent PDFs from Google Patents
  • Simple and clean API
  • MCP (Model Context Protocol) server support
  • Command-line interface
  • Type hints and comprehensive error handling

Installation

# Install with basic dependencies
uv add patent-downloader

# Install with MCP support
uv add "patent-downloader[mcp]"

# Install with development dependencies
uv add "patent-downloader[dev]"

Using pip

# Install with basic dependencies
pip install patent-downloader

# Install with MCP support
pip install "patent-downloader[mcp]"

# Install with development dependencies
pip install "patent-downloader[dev]"

Quick Start

Basic Usage

from patent_downloader import PatentDownloader

# Create downloader instance
downloader = PatentDownloader()

# Download a patent
success = downloader.download_patent("WO2013078254A1", output_dir="./patents")

if success:
    print("Patent downloaded successfully!")
else:
    print("Failed to download patent")

Command Line Interface

# Download a single patent
patent-downloader download WO2013078254A1

# Download to specific directory
patent-downloader download WO2013078254A1 --output-dir ./my_patents

# Download multiple patents
patent-downloader download WO2013078254A1 US20130123448A1 EP1234567A1

MCP Server

Start the MCP server using stdio transport:

# Start MCP server
patent-downloader mcp-server

Using uvx (without installation)

You can also run the MCP server directly using uvx without installing the package:

# Run MCP server with uvx
uvx patent-downloader mcp-server

The MCP server provides the following functions:

  • download_patent: Download a single patent
  • download_patents: Download multiple patents
  • get_patent_info: Get detailed patent information

Environment Variables

  • OUTPUT_DIR: Default output directory for downloaded files (default: ./downloads)

Example:

# Set custom output directory
export OUTPUT_DIR="/path/to/patents"
patent-downloader mcp-server

API Reference

PatentDownloader

Main class for downloading patents.

Methods

  • download_patent(patent_number: str, output_dir: str = ".") -> bool

    • Downloads a single patent PDF
    • Returns True if successful, False otherwise
  • download_patents(patent_numbers: List[str], output_dir: str = ".") -> Dict[str, bool]

    • Downloads multiple patents
    • Returns a dictionary mapping patent numbers to success status
  • search_patents(query: str, limit: int = 10) -> List[PatentInfo] (future)

    • Search for patents by query
    • Returns list of patent information

PatentInfo

Data class containing patent information.

@dataclass
class PatentInfo:
    patent_number: str
    title: str
    inventors: List[str]
    assignee: str
    publication_date: str
    abstract: str

Development

Setup Development Environment

# Clone the repository
git clone https://github.com/yourusername/patent_downloader.git
cd patent_downloader

# Install with development dependencies
uv sync --group dev

# Install pre-commit hooks
pre-commit install

Running Tests

# Run all tests
pytest

# Run with coverage
pytest --cov=patent_downloader

# Run specific test file
pytest tests/test_downloader.py

Code Quality

# Format code
black src/ tests/

# Sort imports
isort src/ tests/

# Type checking
mypy src/

# Linting
flake8 src/ tests/

Contributing

  1. Fork the repository
  2. Create a feature branch
  3. Make your changes
  4. Add tests for new functionality
  5. Ensure all tests pass
  6. Submit a pull request

License

This project is licensed under the MIT License - see the LICENSE file for details.

Changelog

0.1.0

  • Initial release
  • Basic patent downloading functionality
  • MCP server support
  • Command-line interface

Server Config

{
  "mcpServers": {
    "patent_downloader": {
      "command": "uvx",
      "args": [
        "--from",
        "git+https://github.com/Edison-A-N/patent_downloader@0.1.0",
        "--with",
        "patent_downloader[mcp]",
        "patent-downloader",
        "mcp-server"
      ],
      "env": {
        "OUTPUT_DIR": "/Users/nan.zhang/Downloads/patents"
      }
    }
  }
}
Recommend Servers
TraeBuild with Free GPT-4.1 & Claude 3.7. Fully MCP-Ready.
EdgeOne Pages MCPAn MCP service designed for deploying HTML content to EdgeOne Pages and obtaining an accessible public URL.
Visual Studio Code - Open Source ("Code - OSS")Visual Studio Code
Playwright McpPlaywright MCP server
DeepChatYour AI Partner on Desktop
MiniMax MCPOfficial MiniMax Model Context Protocol (MCP) server that enables interaction with powerful Text to Speech, image generation and video generation APIs.
TimeA Model Context Protocol server that provides time and timezone conversion capabilities. This server enables LLMs to get current time information and perform timezone conversions using IANA timezone names, with automatic system timezone detection.
WindsurfThe new purpose-built IDE to harness magic
Context7Context7 MCP Server -- Up-to-date code documentation for LLMs and AI code editors
Amap Maps高德地图官方 MCP Server
AiimagemultistyleA Model Context Protocol (MCP) server for image generation and manipulation using fal.ai's Stable Diffusion model.
Tavily Mcp
Zhipu Web SearchZhipu Web Search MCP Server is a search engine specifically designed for large models. It integrates four search engines, allowing users to flexibly compare and switch between them. Building upon the web crawling and ranking capabilities of traditional search engines, it enhances intent recognition capabilities, returning results more suitable for large model processing (such as webpage titles, URLs, summaries, site names, site icons, etc.). This helps AI applications achieve "dynamic knowledge acquisition" and "precise scenario adaptation" capabilities.
MCP AdvisorMCP Advisor & Installation - Use the right MCP server for your needs
CursorThe AI Code Editor
Jina AI MCP ToolsA Model Context Protocol (MCP) server that integrates with Jina AI Search Foundation APIs.
Baidu Map百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。
ChatWiseThe second fastest AI chatbot™
Howtocook Mcp基于Anduin2017 / HowToCook (程序员在家做饭指南)的mcp server,帮你推荐菜谱、规划膳食,解决“今天吃什么“的世纪难题; Based on Anduin2017/HowToCook (Programmer's Guide to Cooking at Home), MCP Server helps you recommend recipes, plan meals, and solve the century old problem of "what to eat today"
BlenderBlenderMCP connects Blender to Claude AI through the Model Context Protocol (MCP), allowing Claude to directly interact with and control Blender. This integration enables prompt assisted 3D modeling, scene creation, and manipulation.
Serper MCP ServerA Serper MCP Server