patent-mcp-server 0.2.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2025 Michael Frank Martin
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
@@ -0,0 +1,156 @@
1
+ Metadata-Version: 2.4
2
+ Name: patent-mcp-server
3
+ Version: 0.2.0
4
+ Summary: Model Context Protocol server for USPTO patent data
5
+ Requires-Python: >=3.13
6
+ Description-Content-Type: text/markdown
7
+ License-File: LICENSE.md
8
+ Requires-Dist: h2>=4.2.0
9
+ Requires-Dist: httpx>=0.28.1
10
+ Requires-Dist: mcp[cli]>=1.3.0
11
+ Requires-Dist: python-dotenv>=1.0.1
12
+ Requires-Dist: typing>=3.10.0.0
13
+ Dynamic: license-file
14
+
15
+ # USPTO Patent MCP Server
16
+
17
+ A [FastMCP server](https://github.com/modelcontextprotocol/python-sdk/tree/main/src/mcp/server/fastmcp) for accessing United States Patent and Trademark Office (USPTO) patent and patent application data through the [Patent Public Search](https://www.uspto.gov/patents/search/patent-public-search) API and the [Open Data Portal (ODP) API](https://data.uspto.gov/home). Using this server, Claude Desktop can pull data from the USPTO using either the Public Search API (the backend for the Patent Center) or the ODP APIs:
18
+
19
+ ![Screen Capture of Cladue Desktop using Patents MCP Server](screencap.gif)
20
+
21
+ For an introduction to MCP servers see [Introducing the Model Context Protcol](https://www.anthropic.com/news/model-context-protocol).
22
+
23
+ Special thanks to [Parker Hancock](https://github.com/parkerhancock), author of the amazing [Patent Client project](https://github.com/parkerhancock/patent_client), for [blazing the trail](https://github.com/parkerhancock/patent_client/issues/63) to understanding of the string of requests and responses needed to pull data through the Public Search API.
24
+
25
+ ## Features
26
+
27
+ This server provides tools for:
28
+
29
+ 1. **Patent Search** - Search for patents and patent applications
30
+ 2. **Full Text Documents** - Get complete text of patents including claims, description, etc.
31
+ 3. **PDF Downloads** - Download patents as PDF files. (But Claude Desktop doesn't support this as a client currently.)
32
+ 4. **Metadata** - Access patent bibliographic information, assignments, and litigation data
33
+
34
+ ## API Sources
35
+
36
+ This server interacts with two USPTO sources:
37
+
38
+ - **ppubs.uspto.gov** - For full text document access, PDF downloads, and advanced search
39
+ - **api.uspto.gov** - For metadata, continuity information, transactions, and assignments
40
+
41
+ ## Prerequisites
42
+
43
+ - Claude Desktop (for integration). Other models and MCP clients have not been tested.
44
+ - For Patent Public Search requests, no API Key is required, but [there are rate limits](https://github.com/parkerhancock/patent_client/issues/143#issuecomment-2078051755). This API is not meant for bulk downloads.
45
+ - For ODP API requests, a USPTO ODP API Key (see below).
46
+ - [UV](https://docs.astral.sh/uv/) for python version and dependency management.
47
+
48
+ If you're a python developer, but still unfamiliar with uv, you're in for a treat. It's faster and easier than having a separate python version manager (like pyenv) and setting up, activating, and maintaining virtual environments with venv and pip.
49
+
50
+ If you don't already have uv installed, `curl -LsSf https://astral.sh/uv/install.sh | sh` should do the trick.
51
+
52
+ ## Installation
53
+
54
+ 1. Clone this repository:
55
+
56
+ ```bash
57
+ git clone https://github.com/riemannzeta/patent_mcp_server
58
+ cd patent_mcp_server
59
+ ```
60
+
61
+ 2. Install dependencies with uv:
62
+
63
+ ```bash
64
+ uv sync
65
+ ```
66
+
67
+ If installed correctly, then:
68
+
69
+ ```bash
70
+ uv run patent-mcp-server
71
+ ```
72
+
73
+ Should write:
74
+
75
+ ```bash
76
+ INFO Starting USPTO Patent MCP server with stdio transport
77
+ ```
78
+
79
+ to the console. With an API key installed in the environment and Claude Desktop configured, the patents MCP server is ready.
80
+
81
+ ## API Key Setup
82
+
83
+ To use the api.uspto.gov tools, you need to obtain an Open Data Portal (ODP) API key:
84
+
85
+ 1. Visit [USPTO's Getting Started page](https://data.uspto.gov/apis/getting-started) and follow the instructions to request an API key if you don't already have one.
86
+
87
+ 2. Create a `.env` file in the patent_mcp_server directory with the following content:
88
+ ```
89
+ PATENTS_MCP_SERVER_ODP_API_KEY=<your_key_here>
90
+ ```
91
+ You don't need quotes or the < > brackets around your key. The ppubs tools will run without this API key, but the API key is required for the api tools.
92
+
93
+ ## Claude Desktop Configuration
94
+
95
+ To integrate this MCP server with Claude Desktop:
96
+
97
+ 1. Update your Claude Desktop configuration file (`claude_desktop_config.json`):
98
+ ```json
99
+ {
100
+ "mcpServers": {
101
+ "patents": {
102
+ "command": "uv",
103
+ "args": [
104
+ "--directory",
105
+ "/Users/username/patent_mcp_server",
106
+ "run",
107
+ "patent-mcp-server"
108
+ ]
109
+ }
110
+ }
111
+ ```
112
+ You can find `claude_desktop_config.json` on a mac by opening the Claude Desktop app, opening Settings (from the Claude menu or by Command + ' on the keyboard), clicking "Developer" in in the sidebar, and "Edit Config."
113
+
114
+ 2. Replace `/Users/username/patent_mcp_server` with the actual path to your patent_mcp_server directory if that's not where it was cloned. (If you're on a mac, this may mean simply replacing `username` with your username.)
115
+
116
+ When integrated with Claude Desktop, the server will be automatically started when needed and doesn't need to be run separately. The server uses stdio transport for communication with Claude Desktop or other MCP clients running on the same host.
117
+
118
+ ## Available Functions
119
+
120
+ The server provides the following functions to interact with USPTO data. Note that the Claude Desktop client does not fully support all of these tools. For example, Claude Desktop does not at present allow for download of PDFs.
121
+
122
+ ### Public Patent Search (ppubs.uspto.gov)
123
+ - `ppubs_search_patents` - Search for granted patents in USPTO Public Search
124
+ - `ppubs_search_applications` - Search for published patent applications in USPTO Public Search
125
+ - `ppubs_get_full_document` - Get full patent document details by GUID from ppubs.uspto.gov
126
+ - `ppubs_get_patent_by_number` - Get a granted patent's full text by number from ppubs.uspto.gov
127
+ - `ppubs_download_patent_pdf` - Download a granted patent as PDF from ppubs.uspto.gov (not currently supported by Claude Desktop)
128
+
129
+ ### Open Data Portal API (api.uspto.gov)
130
+ - `get_app(app_num)` - Get basic patent application data
131
+ - `search_applications(...)` - Search for patent applications using query parameters
132
+ - `download_applications(...)` - Download patent applications using query parameters
133
+ - `get_app_metadata(app_num)` - Get application metadata
134
+ - `get_app_adjustment(app_num)` - Get patent term adjustment data
135
+ - `get_app_assignment(app_num)` - Get assignment data
136
+ - `get_app_attorney(app_num)` - Get attorney/agent information
137
+ - `get_app_continuity(app_num)` - Get continuity data
138
+ - `get_app_foreign_priority(app_num)` - Get foreign priority claims
139
+ - `get_app_transactions(app_num)` - Get transaction history
140
+ - `get_app_documents(app_num)` - Get document details
141
+ - `get_app_associated_documents(app_num)` - Get associated documents
142
+ - `get_status_codes(...)` - Search for status codes
143
+ - `search_datasets(...)` - Search bulk dataset products
144
+ - `get_dataset_product(...)` - Get a specific product by its identifier
145
+
146
+ Refer to the function docstrings in the code for detailed parameter information.
147
+
148
+ ## Testing
149
+
150
+ The `/test/` directory contains a couple of scripts for testing. `test_patents.py` includes a few tests of direct HTTP requests to the ppubs.uspto.gov and api.uspto.gov endpoints. `test_tools.py` includes a complete set of tests for each tool available to the MCP server. Test results in JSON and PDF format are stored in the `/test/test_results` subdirectory.
151
+
152
+ To execute a test, run `uv run test/test_tools.py` from the project root directory.
153
+
154
+ ## License
155
+
156
+ MIT
@@ -0,0 +1,142 @@
1
+ # USPTO Patent MCP Server
2
+
3
+ A [FastMCP server](https://github.com/modelcontextprotocol/python-sdk/tree/main/src/mcp/server/fastmcp) for accessing United States Patent and Trademark Office (USPTO) patent and patent application data through the [Patent Public Search](https://www.uspto.gov/patents/search/patent-public-search) API and the [Open Data Portal (ODP) API](https://data.uspto.gov/home). Using this server, Claude Desktop can pull data from the USPTO using either the Public Search API (the backend for the Patent Center) or the ODP APIs:
4
+
5
+ ![Screen Capture of Cladue Desktop using Patents MCP Server](screencap.gif)
6
+
7
+ For an introduction to MCP servers see [Introducing the Model Context Protcol](https://www.anthropic.com/news/model-context-protocol).
8
+
9
+ Special thanks to [Parker Hancock](https://github.com/parkerhancock), author of the amazing [Patent Client project](https://github.com/parkerhancock/patent_client), for [blazing the trail](https://github.com/parkerhancock/patent_client/issues/63) to understanding of the string of requests and responses needed to pull data through the Public Search API.
10
+
11
+ ## Features
12
+
13
+ This server provides tools for:
14
+
15
+ 1. **Patent Search** - Search for patents and patent applications
16
+ 2. **Full Text Documents** - Get complete text of patents including claims, description, etc.
17
+ 3. **PDF Downloads** - Download patents as PDF files. (But Claude Desktop doesn't support this as a client currently.)
18
+ 4. **Metadata** - Access patent bibliographic information, assignments, and litigation data
19
+
20
+ ## API Sources
21
+
22
+ This server interacts with two USPTO sources:
23
+
24
+ - **ppubs.uspto.gov** - For full text document access, PDF downloads, and advanced search
25
+ - **api.uspto.gov** - For metadata, continuity information, transactions, and assignments
26
+
27
+ ## Prerequisites
28
+
29
+ - Claude Desktop (for integration). Other models and MCP clients have not been tested.
30
+ - For Patent Public Search requests, no API Key is required, but [there are rate limits](https://github.com/parkerhancock/patent_client/issues/143#issuecomment-2078051755). This API is not meant for bulk downloads.
31
+ - For ODP API requests, a USPTO ODP API Key (see below).
32
+ - [UV](https://docs.astral.sh/uv/) for python version and dependency management.
33
+
34
+ If you're a python developer, but still unfamiliar with uv, you're in for a treat. It's faster and easier than having a separate python version manager (like pyenv) and setting up, activating, and maintaining virtual environments with venv and pip.
35
+
36
+ If you don't already have uv installed, `curl -LsSf https://astral.sh/uv/install.sh | sh` should do the trick.
37
+
38
+ ## Installation
39
+
40
+ 1. Clone this repository:
41
+
42
+ ```bash
43
+ git clone https://github.com/riemannzeta/patent_mcp_server
44
+ cd patent_mcp_server
45
+ ```
46
+
47
+ 2. Install dependencies with uv:
48
+
49
+ ```bash
50
+ uv sync
51
+ ```
52
+
53
+ If installed correctly, then:
54
+
55
+ ```bash
56
+ uv run patent-mcp-server
57
+ ```
58
+
59
+ Should write:
60
+
61
+ ```bash
62
+ INFO Starting USPTO Patent MCP server with stdio transport
63
+ ```
64
+
65
+ to the console. With an API key installed in the environment and Claude Desktop configured, the patents MCP server is ready.
66
+
67
+ ## API Key Setup
68
+
69
+ To use the api.uspto.gov tools, you need to obtain an Open Data Portal (ODP) API key:
70
+
71
+ 1. Visit [USPTO's Getting Started page](https://data.uspto.gov/apis/getting-started) and follow the instructions to request an API key if you don't already have one.
72
+
73
+ 2. Create a `.env` file in the patent_mcp_server directory with the following content:
74
+ ```
75
+ PATENTS_MCP_SERVER_ODP_API_KEY=<your_key_here>
76
+ ```
77
+ You don't need quotes or the < > brackets around your key. The ppubs tools will run without this API key, but the API key is required for the api tools.
78
+
79
+ ## Claude Desktop Configuration
80
+
81
+ To integrate this MCP server with Claude Desktop:
82
+
83
+ 1. Update your Claude Desktop configuration file (`claude_desktop_config.json`):
84
+ ```json
85
+ {
86
+ "mcpServers": {
87
+ "patents": {
88
+ "command": "uv",
89
+ "args": [
90
+ "--directory",
91
+ "/Users/username/patent_mcp_server",
92
+ "run",
93
+ "patent-mcp-server"
94
+ ]
95
+ }
96
+ }
97
+ ```
98
+ You can find `claude_desktop_config.json` on a mac by opening the Claude Desktop app, opening Settings (from the Claude menu or by Command + ' on the keyboard), clicking "Developer" in in the sidebar, and "Edit Config."
99
+
100
+ 2. Replace `/Users/username/patent_mcp_server` with the actual path to your patent_mcp_server directory if that's not where it was cloned. (If you're on a mac, this may mean simply replacing `username` with your username.)
101
+
102
+ When integrated with Claude Desktop, the server will be automatically started when needed and doesn't need to be run separately. The server uses stdio transport for communication with Claude Desktop or other MCP clients running on the same host.
103
+
104
+ ## Available Functions
105
+
106
+ The server provides the following functions to interact with USPTO data. Note that the Claude Desktop client does not fully support all of these tools. For example, Claude Desktop does not at present allow for download of PDFs.
107
+
108
+ ### Public Patent Search (ppubs.uspto.gov)
109
+ - `ppubs_search_patents` - Search for granted patents in USPTO Public Search
110
+ - `ppubs_search_applications` - Search for published patent applications in USPTO Public Search
111
+ - `ppubs_get_full_document` - Get full patent document details by GUID from ppubs.uspto.gov
112
+ - `ppubs_get_patent_by_number` - Get a granted patent's full text by number from ppubs.uspto.gov
113
+ - `ppubs_download_patent_pdf` - Download a granted patent as PDF from ppubs.uspto.gov (not currently supported by Claude Desktop)
114
+
115
+ ### Open Data Portal API (api.uspto.gov)
116
+ - `get_app(app_num)` - Get basic patent application data
117
+ - `search_applications(...)` - Search for patent applications using query parameters
118
+ - `download_applications(...)` - Download patent applications using query parameters
119
+ - `get_app_metadata(app_num)` - Get application metadata
120
+ - `get_app_adjustment(app_num)` - Get patent term adjustment data
121
+ - `get_app_assignment(app_num)` - Get assignment data
122
+ - `get_app_attorney(app_num)` - Get attorney/agent information
123
+ - `get_app_continuity(app_num)` - Get continuity data
124
+ - `get_app_foreign_priority(app_num)` - Get foreign priority claims
125
+ - `get_app_transactions(app_num)` - Get transaction history
126
+ - `get_app_documents(app_num)` - Get document details
127
+ - `get_app_associated_documents(app_num)` - Get associated documents
128
+ - `get_status_codes(...)` - Search for status codes
129
+ - `search_datasets(...)` - Search bulk dataset products
130
+ - `get_dataset_product(...)` - Get a specific product by its identifier
131
+
132
+ Refer to the function docstrings in the code for detailed parameter information.
133
+
134
+ ## Testing
135
+
136
+ The `/test/` directory contains a couple of scripts for testing. `test_patents.py` includes a few tests of direct HTTP requests to the ppubs.uspto.gov and api.uspto.gov endpoints. `test_tools.py` includes a complete set of tests for each tool available to the MCP server. Test results in JSON and PDF format are stored in the `/test/test_results` subdirectory.
137
+
138
+ To execute a test, run `uv run test/test_tools.py` from the project root directory.
139
+
140
+ ## License
141
+
142
+ MIT
@@ -0,0 +1,27 @@
1
+ [build-system]
2
+ requires = ["setuptools>=42", "wheel"]
3
+ build-backend = "setuptools.build_meta"
4
+
5
+ [project]
6
+ name = "patent-mcp-server"
7
+ version = "0.2.0"
8
+ description = "Model Context Protocol server for USPTO patent data"
9
+ readme = "README.md"
10
+ requires-python = ">=3.13"
11
+ dependencies = [
12
+ "h2>=4.2.0",
13
+ "httpx>=0.28.1",
14
+ "mcp[cli]>=1.3.0",
15
+ "python-dotenv>=1.0.1",
16
+ "typing>=3.10.0.0",
17
+ ]
18
+
19
+ [tool.setuptools]
20
+ package-dir = {"" = "src"}
21
+ packages = ["patent_mcp_server", "patent_mcp_server.uspto", "patent_mcp_server.util"]
22
+
23
+ [tool.setuptools.package-data]
24
+ patent_mcp_server = ["json/*.json"]
25
+
26
+ [project.scripts]
27
+ patent-mcp-server = "patent_mcp_server.patents:main"
@@ -0,0 +1,4 @@
1
+ [egg_info]
2
+ tag_build =
3
+ tag_date = 0
4
+
@@ -0,0 +1,8 @@
1
+ #!/usr/bin/env python
2
+ from setuptools import setup
3
+
4
+ # This file is needed for some tools and environments.
5
+ # The actual configuration is in pyproject.toml
6
+ setup(
7
+ package_dir={"": "src"},
8
+ )
@@ -0,0 +1,5 @@
1
+ """Entry point for running the package as a module."""
2
+ from patent_mcp_server.patents import main
3
+
4
+ if __name__ == "__main__":
5
+ main()
@@ -0,0 +1,35 @@
1
+ {
2
+ "start": 0,
3
+ "pageCount": 500,
4
+ "sort": "date_publ desc",
5
+ "docFamilyFiltering": "familyIdFiltering",
6
+ "searchType": 1,
7
+ "familyIdEnglishOnly": true,
8
+ "familyIdFirstPreferred": "US-PGPUB",
9
+ "familyIdSecondPreferred": "USPAT",
10
+ "familyIdThirdPreferred": "FPRS",
11
+ "showDocPerFamilyPref": "showEnglish",
12
+ "queryId": 0,
13
+ "tagDocSearch": false,
14
+ "query": {
15
+ "caseId": 27921811,
16
+ "hl_snippets": "2",
17
+ "op": "OR",
18
+ "q": "(\"6103599\").pn.",
19
+ "queryName": "(\"6103599\").pn.",
20
+ "highlights": "1",
21
+ "qt": "brs",
22
+ "spellCheck": false,
23
+ "viewName": "tile",
24
+ "plurals": true,
25
+ "britishEquivalents": true,
26
+ "databaseFilters": [
27
+ { "databaseName": "US-PGPUB", "countryCodes": [] },
28
+ { "databaseName": "USPAT", "countryCodes": [] },
29
+ { "databaseName": "USOCR", "countryCodes": [] }
30
+ ],
31
+ "searchType": 1,
32
+ "ignorePersist": true,
33
+ "userEnteredQuery": "(\"6103599\").pn."
34
+ }
35
+ }