MCP server for patents
Install patentref-mcp from PyPI and add it to your MCP client with a free PatentRef key. It runs on your machine over stdio and gives the agent 19 read-only tools for US patents, including claim trees, patent briefs, status records and search. Plan mode swaps the 19 tools for two, so the tool list and instructions cost 599 tokens instead of 4,955.
How to set it up
- Get a free key at https://patentref.io/api/v1/meta/signup/.
- Install the package. It needs Python 3.10 or later.
- Add the server to your MCP client with the key in its environment.
- For plan mode, add "PATENTREF_MCP_MODE": "plan" to the same env block.
- Check the install with
python -m patentref_mcp.smoke 10000364.
pip install patentref-mcp
Claude Desktop, in claude_desktop_config.json:
{"mcpServers": {"patentref": {"command": "patentref-mcp", "env": {"PATENTREF_API_KEY": "YOUR_KEY"}}}}
The same in plan mode:
{"mcpServers": {"patentref": {"command": "patentref-mcp", "env": {"PATENTREF_API_KEY": "YOUR_KEY", "PATENTREF_MCP_MODE": "plan"}}}}
Claude Code:
claude mcp add patentref -e PATENTREF_API_KEY=YOUR_KEY -- patentref-mcp
What you get
- 19 read-only tools: get_claim_tree, get_patent_brief, check_patent_status, search_patents, similar_patents, build_facts, search_disclosures, eight patent office rules tools, and four experimental tools for the problem a patent states and the parts its claims name.
- Each tool sends one HTTPS request to the PatentRef API and returns the API's JSON as sent.
- Plan mode: search_api looks up operations in the PatentRef OpenAPI file, and run_plan sends a plan of up to 20 GET steps to patentref.io paths under /api/v1/. run_plan runs no code.
- Token counts for version 0.6.0, the tool list plus the server instructions, counted with tiktoken cl100k_base: 4,955 with the 19 tools, 599 in plan mode.
- A streamable HTTP option: patentref-mcp --http serves the same tools at http://127.0.0.1:8787/mcp.
- MIT license. The MCP Registry lists it as io.github.patentref/patentref-mcp.
Good to know
- There is no hosted MCP endpoint. You run the server yourself.
- Each call of a keyed tool is one request on your key. In plan mode, each HTTP request run_plan sends counts, pages included. A free key allows 1,000 requests a month and 45 a minute.
- build_facts, search_disclosures and search_api need no key.
- The server does not retry. An API error comes back as the tool's error text.
- The four tools for stated problems and parts (S1-D) are experimental.
- Other models count tokens with other tokenizers, so read the token numbers as a comparison.
- Answers describe the text as the USPTO printed it. They are not legal conclusions. Record pages need no sign-up.
FAQ
Is there a hosted MCP URL?
No. patentref-mcp runs on your machine. If your client connects to a URL, start it with --http, which serves at http://127.0.0.1:8787/mcp by default.
What is plan mode?
Set PATENTREF_MCP_MODE=plan and the server lists two tools, search_api and run_plan, in place of 19. The tool list and instructions drop from 4,955 to 599 tokens.
Which MCP clients does it work with?
Clients that start a local stdio server. The Agents page has setup lines for Claude Desktop, Claude Code and Cursor.
Related pages
More questions
PatentRef is an independent service and is not affiliated with the USPTO. Answers describe the text as the USPTO printed it; none is a legal conclusion.