All guides
3 min read

How to Add Patent Search to Claude Code

Add a patent database to Claude Code with one command. Here is the setup with a Patent Bear API key, how to confirm it works, and what an agent can do with patent tools in the terminal.

Claude Code is a coding agent, but it is also one of the best ways to do patent research in bulk. It can run many searches in a row, write the results to files, and build a spreadsheet or a memo from them. All it needs is a patent database it can call, and that takes one command.

What you need

  • Claude Code installed
  • A Patent Bear account and an API key. The connect page creates one.

Add the server

Set the key in your terminal, then add the server.

export PB_API_KEY=your_key_here

claude mcp add patentbear https://www.patentbear.com/mcp \
  --transport http \
  --scope user \
  --header "Authorization: Bearer ${PB_API_KEY}"

Check that it was added:

claude mcp list

Restart Claude Code. The Patent Bear tools are now available in every project.

Confirm it works

Ask for something only the record can answer.

  • "Use Patent Bear to look up US 7,469,381 and tell me which claims are still in effect."

If the answer lists cancelled claims and links to the record, you are connected.

What an agent can do with it

The value in a terminal agent is that it does not stop after one answer.

Build a list and save it

  • "Pull every granted US patent in CPC H04W 72 filed since 2022 and write a CSV with number, title, owner and filing date."

A single bulk search returns up to 1,000 patents, so a landscape that takes an afternoon by hand takes one request.

Work through a portfolio

  • "For each patent in patents.txt, get the latest recorded assignee and the expiration date, and flag any with unpaid maintenance fees."

Draft from the record

  • "Read claim 1 of US 10,861,617 and the prosecution history, then write a one page memo on how the claim was narrowed, with cites."

Because the text comes back verbatim with column and line cites, the memo can be checked line by line.

Other coding agents

The same server works in Codex, Gemini CLI and Cursor. The connect page gives the command or config for each.

Good practice

  • Keep the key out of your repository. Use an environment variable, as above.
  • Ask for cites. An agent that quotes the record is easier to review than one that summarizes.
  • Check the count. When you pull a list, ask how many results matched and how many were returned.

Frequently asked questions

Does this work in the Claude desktop app too?

Yes, but the setup is different. The desktop app and claude.ai use the connector directory with a sign in, not an API key.

Can I use it in a script without an agent?

Yes. The same API key works with Patent Bear's API, described on the connect page.

What does it cost?

Patent Bear's plans are on the pricing page.

Get an API key and the command

The connect page creates a key and gives the exact command for Claude Code, Codex, Gemini CLI and Cursor.

Connect your AI