US

USPTO MCP Server for Patent and Trademark Data

Access USPTO patent and trademark data via the MCP server using the Open Data Protocol (ODP) API for fast, programmatic queries and downloads.

Quick Install
npx -y @riemannzeta/patent_mcp_server

Overview

The USPTO MCP Server is a lightweight service that exposes United States Patent and Trademark Office (USPTO) data through a Model Context Protocol (MCP) compatible API. It acts as a programmatic gateway to the USPTO Open Data Protocol (ODP) endpoints, providing consistent, fast access to patent and trademark records, metadata, and download links. For developers building search tools, analytics pipelines, or integrations that need reliable access to bulk or filtered USPTO datasets, the MCP server simplifies querying and retrieval.

This server is intended to be run locally or deployed in cloud environments as a self-hosted API. It focuses on predictable responses, pagination support, download management, and a small set of configuration options so you can integrate USPTO data into applications, data pipelines, or research workflows without interacting directly with the raw ODP endpoints each time. The source code and installation instructions are available on GitHub: https://github.com/riemannzeta/patent_mcp_server.

Features

  • Programmatic access to USPTO patent and trademark datasets via MCP-compatible endpoints
  • Proxying and normalization of USPTO ODP responses for consistent fields and formats
  • Pagination, filtering, and sorting for query endpoints
  • Bulk download endpoints for full-record retrieval and archive files
  • JSON (default) and optional CSV output formats for easier analysis
  • Configurable caching and request throttling to reduce load on upstream ODP services
  • Health checks and basic metrics for deployment monitoring
  • Simple deployment using Docker or a Python environment

Installation / Configuration

Clone the repository and run locally, or use Docker for quick deployment.

Clone repository:

git clone https://github.com/riemannzeta/patent_mcp_server.git
cd patent_mcp_server

Python (virtualenv) installation:

python -m venv .venv
source .venv/bin/activate
pip install -r requirements.txt

# example run (adjust module name if different)
uvicorn patent_mcp_server.app:app --host 0.0.0.0 --port 8080

Docker:

# build and run
docker build -t patent-mcp-server .
docker run -d --name patent-mcp -p 8080:8080 \
  -e PORT=8080 \
  -e DATA_DIR=/data \
  -e CACHE_TTL=3600 \
  -v "$(pwd)/data":/data \
  patent-mcp-server

Environment configuration (example .env):

PORT=8080
DATA_DIR=/data
CACHE_TTL=3600        # seconds to cache upstream responses
LOG_LEVEL=info
ODP_BASE_URL=https://developer.uspto.gov/odm/odm-search-api
RATE_LIMIT=10         # max upstream requests per second

Notes:

  • The server proxies requests to the USPTO ODP endpoints; you do not always need an API key, but follow USPTO usage terms and rate limits.
  • Configure DATA_DIR for any bulk download staging or caching needs.
  • Use a reverse proxy (nginx) and TLS in production.

Available Resources

The server exposes a compact set of HTTP endpoints for common workflows. Exact paths may vary; consult the repository for the canonical route names.

EndpointPurposeKey query parameters
/v1/patentsSearch patent recordsq, page, per_page, sort, format (json/csv)
/v1/trademarksSearch trademark recordsq, page, per_page, sort, format
/v1/records/{id}Retrieve a single record by USPTO IDformat
/v1/downloadRequest bulk download (bundle or file URL)id, type (patent
/v1/metadataGet dataset metadata and schema-
/healthLiveness/Readiness checks-
/metricsBasic usage metrics (if enabled)-

Example query parameters:

  • q: full-text or fielded query (e.g., q=assignee:“Acme Corp”)
  • page, per_page: pagination controls
  • format: json (default) or csv for tabular export

Use Cases

  1. Programmatic patent search from a web app
  • Use the /v1/patents endpoint to power autocomplete and search results.
  • Example curl:
    curl "http://localhost:8080/v1/patents?q=machine+learning&per_page=25"
    
  1. Bulk data download for analytics
  • Request bulk archives or individual record dumps via /v1/download and store them in DATA_DIR for batch processing.
  • Example (download a file URL returned by the server):
    curl -o patents-2024.zip "http://localhost:8080/v1/download?id=patent_archive_2024&type=patent"
    
  1. Data ingestion pipeline
  • Periodically query /v1/metadata to identify new releases, then fetch changed records using /v1/patents with date filters. Cache results locally and update your analytics store.
  1. Integration into a knowledge graph or LLM context pipeline
  • Use /v1/records/{id} to fetch normalized JSON for a single patent or trademark, then transform into the desired graph or embedding pipeline.

Tips for Developers

  • Start by running the server locally and test endpoints with curl or Postman. Confirm pagination and format outputs before integrating into production.
  • Enable caching in environments where upstream rate limits are a concern. CACHE_TTL reduces repeated upstream calls for identical queries.
  • If deploying in Kubernetes, wrap the server in a horizontal auto-scaler and use a shared volume for DATA_DIR when doing bulk downloads.
  • Inspect logs (LOG_LEVEL) and /metrics to monitor request patterns and tune rate limiting.

For the latest source, issues, and contribution guidance, see the GitHub repository: https://github.com/riemannzeta/patent_mcp_server.