# Genesis Patent MCP Server

A FastMCP server that gives Claude tools for patent research, claim drafting,
prior art searches, portfolio tracking, IP strategy memos, USPTO fee calculation,
and competitor patent monitoring.

## Port

**8901** — Voice Bridge uses 8900. Patent OS (AI validation shield) uses stdio.

## Quick Start

```bash
# Install dependencies
pip install -r requirements.txt

# Copy and edit environment file
copy .env.example .env

# Run the server
python server.py
```

## Tools Available (8 total)

| Tool | Description |
|---|---|
| `search_patents` | Search USPTO PatentsView API and patent databases |
| `analyze_patent_claims` | Break down claims into independent/dependent, assess scope |
| `draft_patent_claims` | Draft 1 independent + 5 dependent claims in USPTO format |
| `check_prior_art` | Find existing patents that could block your invention |
| `track_portfolio` | Read/write the Genesis patent portfolio JSON file |
| `generate_ip_memo` | Full IP strategy memo with timeline and cost estimates |
| `calculate_fees` | USPTO fee schedule for any patent type and entity size |
| `monitor_competitor_patents` | Recent filings by a named competitor company |

## Claude Desktop Registration (stdio mode)

Add to your `mcp-config.json`:

```json
{
  "mcpServers": {
    "genesis-patent-mcp": {
      "command": "python",
      "args": ["E:/genesis-system/mcp-servers/genesis-patent-mcp/server.py"],
      "env": {
        "GENESIS_PATENT_MCP_TOKEN": "genesis-patent-mcp-2026-dev-key",
        "GENESIS_ROOT": "E:/genesis-system",
        "GENESIS_PATENT_MCP_PORT": "8901"
      },
      "description": "Patent research, claim drafting, portfolio tracking, and IP strategy for Genesis."
    }
  }
}
```

## HTTP/SSE Mode (for remote access)

```bash
# Set transport to SSE (default)
GENESIS_PATENT_MCP_TRANSPORT=sse python server.py

# Or HTTP transport
GENESIS_PATENT_MCP_TRANSPORT=http python server.py
```

Connect with Bearer token:
```
Authorization: Bearer genesis-patent-mcp-2026-dev-key
```

## Health Check

```bash
curl http://localhost:8901/health
```

Returns:
```json
{
  "status": "healthy",
  "service": "genesis-patent-mcp",
  "version": "1.0.0",
  "port": 8901,
  "patent_count": 0,
  "timestamp": "2026-02-23T00:00:00"
}
```

## Portfolio File

The patent portfolio is stored as plain JSON at:
`E:/genesis-system/data/patent_portfolio.json`

No SQLite. No database. Pure JSON on E: drive — compliant with Genesis Rule 7.

## Architecture

- **Framework**: FastMCP (same pattern as genesis-voice-bridge)
- **Auth**: Bearer token middleware on all endpoints except `/health`
- **Storage**: JSON file (no SQLite, no C: drive)
- **APIs used**: USPTO PatentsView (free, no key), USPTO Publications API (free)
- **Port**: 8901

## Relationship to patent-os

`patent-os` implements Genesis's OWN 9-layer AI validation patents as tools
(hallucination detection, risk assessment, audit trails).

`genesis-patent-mcp` is a patent RESEARCH and MANAGEMENT tool — it helps
you FIND, DRAFT, TRACK, and STRATEGIZE around patents (yours and competitors').

These are complementary, not duplicate.
