mcp-patent-publisher
v1.0.5
Published
MCP server for publishing patent documents to USPTO-compliant DOCX and PDF formats
Downloads
497
Maintainers
Readme
MCP Patent Publisher
An MCP (Model Context Protocol) server for publishing patent documents to USPTO-compliant DOCX and PDF formats.
Overview
This MCP server is the final publishing stage of a multi-agent patent drafting pipeline. It takes clean patent markdown and produces professionally formatted documents ready for USPTO submission.
Features
- ✅ USPTO-compliant DOCX generation using official template
- ✅ Matching PDF generation with proper formatting
- ✅ SVG to PNG figure conversion (300 DPI)
- ✅ Automatic section parsing and formatting
- ✅ Numbered claims with proper indentation
- ✅ Centered page numbering
- ✅ Graceful error handling with warnings
- ✅ Completely offline operation
Installation
From npm
npm install -g mcp-patent-publisherFrom source
git clone https://github.com/your-org/mcp-patent-publisher.git
cd mcp-patent-publisher
npm install
npm run buildPython Dependencies
cd python
pip install -r requirements.txtQuick Start
Add to Claude Code
Add to your ~/.claude/claude_desktop_config.json:
{
"mcpServers": {
"patent-publisher": {
"command": "npx",
"args": ["mcp-patent-publisher"]
}
}
}Or if installed globally:
{
"mcpServers": {
"patent-publisher": {
"command": "mcp-patent-publisher"
}
}
}Basic Usage
User: Publish the patent at /patents/my_invention.md
Claude: I'll use patent_publish_bundle to generate DOCX and PDF outputs.
[Uses patent_publish_bundle tool]
Done! Generated:
- /patents/patent_abc123.docx
- /patents/patent_abc123.pdfTools
patent_publish_plan
Analyzes markdown and creates a publishing plan.
{
"run_id": "patent_2024_001",
"patent_markdown_path": "/path/to/patent.md",
"figures_manifest_path": "/path/to/figures.json"
}patent_render_docx
Generates USPTO-compliant DOCX document.
{
"run_id": "patent_2024_001",
"patent_markdown_path": "/path/to/patent.md"
}patent_render_pdf
Generates USPTO-styled PDF document.
{
"run_id": "patent_2024_001",
"patent_markdown_path": "/path/to/patent.md"
}patent_publish_bundle
Complete workflow - plan, convert figures, render all outputs.
{
"run_id": "patent_2024_001",
"patent_markdown_path": "/path/to/patent.md",
"render_docx": true,
"render_pdf": true
}Markdown Format
Your patent markdown should include these sections:
# TITLE
Your Patent Title
## TECHNICAL FIELD
Technical field description...
## BACKGROUND
Background information...
## SUMMARY
Summary of the invention...
## BRIEF DESCRIPTION OF DRAWINGS
FIG. 1 is a...
FIG. 2 shows...
## DETAILED DESCRIPTION
Detailed description with FIG. references...
## CLAIMS
1. A method comprising...
2. The method of claim 1...
## ABSTRACT
Abstract text (150 words max)...USPTO Formatting
Documents are formatted per USPTO requirements:
| Property | Value | |----------|-------| | Page Size | 8.5" x 11" (Letter) | | Left Margin | 1.0" | | Right Margin | 0.75" | | Top/Bottom Margins | 0.75" | | Font | Times New Roman, 12pt | | Line Spacing | 1.5 | | Page Numbers | Centered footer |
Figure Handling
Automatic Discovery
Figures are discovered from:
patent/ir/runs/{run_id}/drawings/patent_figures_{run_id}/Manifest File
Or provide a manifest:
{
"figures": [
{
"number": 1,
"label": "FIG. 1",
"svg_path": "/path/to/fig1.svg",
"caption": "System overview"
}
]
}SVG Conversion
SVG files are converted to PNG using (in order):
- cairosvg (Python library)
- Inkscape (CLI)
- rsvg-convert (CLI)
Development
# Install dependencies
npm install
# Run in development mode
npm run dev
# Build for production
npm run build
# Type checking
npm run typecheckRequirements
- Node.js 18+
- Python 3.8+
- Python packages: python-docx, reportlab, cairosvg
- Optional: Inkscape or librsvg for SVG fallback conversion
Documentation
- MCP Guidance - Detailed usage guide
- Tool Contracts - API reference
- Examples - Sample workflows
License
MIT
