A Python SDK for downloading patents from Google Patents with MCP support.
- Download patent PDFs from Google Patents
- Get patent information (title, inventors, assignee, etc.)
- MCP server support
- Command-line interface
- Simple API with error handling
- Support for batch downloading from files (TXT/CSV)
# Using uv (recommended)
uv add patent-downloader
uv add "patent-downloader[mcp]"
# Using pip
pip install patent-downloader
pip install "patent-downloader[mcp]"from patent_downloader import PatentDownloader
# Download a patent
downloader = PatentDownloader()
success = downloader.download_patent("WO2013078254A1", "./patents")
# Get patent info
info = downloader.get_patent_info("WO2013078254A1")
print(f"Title: {info.title}")
# Download multiple patents
results = downloader.download_patents(["WO2013078254A1", "US20130123448A1"])
# Download patents from file
results = downloader.download_patents_from_file("patents.txt", has_header=False)# Download patents
patent-downloader download WO2013078254A1
patent-downloader download WO2013078254A1 US20130123448A1 --output-dir ./patents
# Download patents from file
patent-downloader download --file patents.txt
patent-downloader download --file patents.csv --has-header
# Get patent info
patent-downloader info WO2013078254A1
# Start MCP server
patent-downloader mcp-serverThe MCP server provides these functions:
download_patent: Download a single patentdownload_patents: Download multiple patentsget_patent_info: Get patent information
You can configure the default download directory using the OUTPUT_DIR environment variable in your MCP configuration. This allows you to set a fixed download path for all patent downloads.
Using uvx (no installation required)
Basic installation (default download directory: ~/downloads):
cursor://anysphere.cursor-deeplink/mcp/install?name=patent-downloader&config=eyJjb21tYW5kIjogInV2eCIsICJhcmdzIjogWyItLXdpdGgiLCAibWNwIiwgInBhdGVudC1kb3dubG9hZGVyIiwgIm1jcC1zZXJ2ZXIiXX0
Note: If you need to customize the download directory, you'll need to manually edit your mcp.json file after installation and add the env section:
{
"mcpServers": {
"patent-downloader": {
"command": "uvx",
"args": ["--with", "mcp", "patent-downloader", "mcp-server"],
"env": {
"OUTPUT_DIR": "~/Downloads/patents"
}
}
}
}# Start server
patent-downloader mcp-server
# Using uvx to run without installation (specify MCP dependencies):
uvx --with mcp patent-downloader mcp-server# Download patent
downloader.download_patent(patent_number, output_dir=".")
# Download multiple patents
downloader.download_patents(patent_numbers, output_dir=".")
# Download patents from file
downloader.download_patents_from_file(file_path, has_header=False, output_dir=".")
# Get patent info
downloader.get_patent_info(patent_number)@dataclass
class PatentInfo:
patent_number: str
title: str
inventors: List[str]
assignee: str
publication_date: str
abstract: str
url: Optional[str] = NoneThe SDK supports reading patent numbers from both TXT and CSV files:
- One patent number per line
- Optional header row (use
--has-headerflag) - Example:
WO2013078254A1 US20130123448A1 EP1234567A1
- Single column of patent numbers
- Optional header row (use
--has-headerflag) - Example:
patent_number WO2013078254A1 US20130123448A1 EP1234567A1
MIT License