Skip to content
Legal
Command

/setup-patent-system

One-time setup for the patent creator system - downloads MPEP, builds search index, configures BigQuery

BOOST
From plugin
claude-patent-creator-standalone
20316 skills13 agents16 commands1 hook
Install
> /plugin marketplace add RobThePCGuy/Claude-Patent-Creator
> /plugin install claude-patent-creator-standalone@claude-patent-creator

How it fires

How this command gets triggered: by you, by Claude, or both.

  • Fires itselfClaude auto-loads it when your prompt matches the work.
  • You can call itInvoke it directly when you want it.
  • Slash command/setup-patent-system

Context preview

What this command does when you run it.

One-time setup for the patent creator system - downloads MPEP, builds search index, configures BigQuery

Command definition

setup-patent-system.md
description: One-time setup for the patent creator system - downloads MPEP, builds search index, configures BigQuery
allowed-tools: Bash, Read, Write

Setup Patent Creator System

Complete one-time setup for all patent creator capabilities.

What This Does

The `patent-creator setup` CLI handles everything automatically:

1. **Detect GPU** and install PyTorch with correct CUDA version 2. **Download MPEP PDFs** (500MB) - USPTO examination manual 3. **Download Legal Sources** - 35 USC, 37 CFR, Federal Register updates 4. **Build Search Index** - FAISS + BM25 hybrid search (5-65 min depending on GPU) 5. **Configure MCP server** registration with Claude Code

**Total Time**: 30-90 minutes (most time is MPEP download and index building)

Requirements

  • **Python 3.9-3.12** (3.11 recommended). Python 3.13+ may lack wheels for PyTorch/FAISS.
  • **8GB+ RAM** (16GB for index building)
  • **5GB free disk space**
  • **Internet connection** (for downloads)
  • **Optional**: NVIDIA GPU (10x faster index building)

Process

Step 1: Find Compatible Python

**Python 3.13+ will NOT work** — PyTorch and FAISS may not have wheels. Find 3.9-3.12:

# Check default
python --version 2>&1

# If 3.13+, look for compatible versions:
# Windows (py launcher):
py -3.12 --version 2>&1
py -3.11 --version 2>&1
py -3.10 --version 2>&1

# Linux/macOS:
python3.12 --version 2>&1
python3.11 --version 2>&1

Use the first compatible version found (3.9-3.12). Remember this as `PYTHON_CMD` for all remaining steps.

If no compatible Python is found, tell the user to install Python 3.12 from python.org.

Step 2: Create venv and Install Package

cd ${CLAUDE_PLUGIN_ROOT}
${PYTHON_CMD} -m venv venv

Use the venv Python for all remaining commands:

  • **Windows**: `${CLAUDE_PLUGIN_ROOT}/venv/Scripts/python`
  • **Linux/macOS**: `${CLAUDE_PLUGIN_ROOT}/venv/bin/python`

Install the package:

${VENV_PYTHON} -m pip install --upgrade pip
${VENV_PYTHON} -m pip install -e .

Step 3: Run Automated Setup

The `patent-creator setup` CLI handles GPU detection, PyTorch installation, MPEP downloads, and index building automatically:

cd ${CLAUDE_PLUGIN_ROOT}
${VENV_PYTHON} -m mcp_server.cli setup --non-interactive

**What this does automatically:** 1. Detects GPU hardware (NVIDIA CUDA, Apple MPS, or CPU) 2. Installs correct PyTorch version (uninstalls CPU version if GPU detected, restarts itself) 3. Downloads MPEP PDFs if missing (~500MB) 4. Downloads 35 USC, 37 CFR, Federal Register updates 5. Builds FAISS + BM25 hybrid search index (5-65 min) 6. Verifies BigQuery configuration (reports if project ID is missing) 7. Registers MCP server with Claude Code

**This command is long-running** (30-90 minutes). Use a timeout of at least 600000ms (10 minutes) for the Bash call and check output periodically.

Step 4: Verify Installation

After setup completes, verify:

${VENV_PYTHON} -c "import torch; print(f'PyTorch {torch.__version__}'); print(f'CUDA available: {torch.cuda.is_available()}')"
cd ${CLAUDE_PLUGIN_ROOT}
${VENV_PYTHON} -m mcp_server.cli health

Step 5: Check BigQuery Status (Optional — enhances patent search)

BigQuery adds 100M+ worldwide patent search. The setup auto-detects existing gcloud credentials.

**If setup output showed `BigQuery: [OK]`** — nothing to do, it works.

**If BigQuery is not configured** — this is fine. MPEP search, claims review, EPO analysis, and all other features work without it. BigQuery just adds prior art search across 100M+ patents.

If the user wants to enable it later, they can run:

! gcloud auth application-default login

This opens a browser for Google sign-in. No credit card needed (free tier: 1TB/month).

**Do NOT present BigQuery setup as a required step or a failure.** The system is fully functional without it.

Troubleshooting

PyTorch CPU-Only Despite GPU

The most common issue. `patent-creator setup` handles this automatically by detecting GPU and reinstalling PyTorch. If it still fails:

${VENV_PYTHON} -m pip uninstall -y torch torchvision torchaudio
# For RTX 5090/5080 (compute capability >= 10.0):
${VENV_PYTHON} -m pip install torch torchvision torchaudio --index-url https://download.pytorch.org/whl/cu128
# For older NVIDIA GPUs:
${VENV_PYTHON} -m pip install torch torchvision torchaudio --index-url https://download.pytorch.org/whl/cu124

MPEP Download Fails

Retry:

${VENV_PYTHON} -m mcp_server.cli setup --non-interactive

Won't re-download files that already exist. Only downloads missing sources.

Index Building Out of Memory

Use CPU mode (slower but less memory):

PATENT_MPEP_DEVICE=cpu ${VENV_PYTHON} -m mcp_server.cli setup --rebuild --non-interactive

BigQuery Not Working

gcloud auth application-default login

After Setup

The system is ready. Available capabilities:

  • `/create-patent` - Create complete patent application
  • `/search-prior-art` - Search 100M+ patents
  • `/review-claims` - Analyze claims for 112(b) compliance
  • `/review-specification` - Check specification for 112(a) support
  • `/review-formalities` - Verify MPEP 608 formalities

Tell the user to try: "Search MPEP for claim definiteness requirements"

Read more
Ships withclaude-patent-creator-standalone

An AI-powered patent creation and analysis system for Claude Code. I built this because I needed to file a patent myself. I used AI to build the system, used the system to file the patent, and it worked. Now it's open source so anyone can use it.

Get the whole plugin