patent_mcp_server: Instructions file for Claude Code

CLAUDE.md

patent_mcp_server CLAUDE.md is an instructions file for Claude Code from riemannzeta/patent_mcp_server. It costs 4,727 tokens per session, scanned A, original, MIT.

Project instructions for an MCP server that provides USPTO patent and trademark data through several APIs. MCP is a standard way for AI tools to call external services.

In plain words
What is it for?
Use it when developing, reviewing, committing, or releasing this Python server, especially its asynchronous clients and HTTP or standard-input operation.
Why use it?
It warns developers about project rules, server lifecycle details, supported transports, and release practices before they change the code.

Instructions file for Claude Code

Written for Claude Code: the file is CLAUDE.md. Also seen: mentions CLAUDE.md; mentions Claude Code.

This is riemannzeta/patent_mcp_server's own configuration. It tells Claude Code how to work on patent_mcp_server itself, so it is not a mod to install elsewhere. Copy it as a starting point and replace the rules that are about this project. Everything patent_mcp_server configures →

Reuse

Borrowing it

Nothing to install: this file belongs to riemannzeta/patent_mcp_server. Take a copy, put it at the same path in your own repository, and replace the rules that are about this project with yours.

Copy the file
curl -O https://raw.githubusercontent.com/riemannzeta/patent_mcp_server/main/CLAUDE.md
Clone the repo
git clone --depth 1 https://github.com/riemannzeta/patent_mcp_server

Made for: Claude Code.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for patent_mcp_server CLAUDE.md

README.md
[![agentmods](https://agentmods.dev/badge/instructions/riemannzeta/patent_mcp_server/claude-md/github.svg)](https://agentmods.dev/instructions/riemannzeta/patent_mcp_server/claude-md)
Your own site
<a href="https://agentmods.dev/instructions/riemannzeta/patent_mcp_server/claude-md"><img src="https://agentmods.dev/badge/instructions/riemannzeta/patent_mcp_server/claude-md/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for patent_mcp_server CLAUDE.md

Your own site · 80×15
<a href="https://agentmods.dev/instructions/riemannzeta/patent_mcp_server/claude-md"><img src="https://agentmods.dev/badge/instructions/riemannzeta/patent_mcp_server/claude-md.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 4,727 This file is loaded in full into every session.
When invoked 4,727 The same file — it is already loaded in full.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.04727 $0.04727
Opus 5.5 $0.01891 $0.01891
Sonnet 5.5 $0.00945 $0.00945
Haiku 4.5 $0.00473 $0.00473

Measured 20d ago against content hash 502b52993c5c, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

patent_mcp_server CLAUDE.md scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 20d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

CLAUDE.md · 207 lines

How it starts

The opening of the file, as written. The whole thing — 207 lines — stays where its author put it; the contents beside it link to each section on GitHub.

CLAUDE.md - Development Guidelines for USPTO Patent MCP Server

This file provides guidance for Claude Code and other AI assistants working on this project.

Project Overview

This is a Model Context Protocol (MCP) server that provides access to USPTO patent and trademark data through multiple APIs. The server is built on the MCP Python SDK 2.x (MCPServer) and uses async/await patterns throughout. Published to PyPI as patent-mcp-server.

Transports: stdio by default (Claude Desktop/Code), or --transport streamable-http for remote hosting. HTTP mode is stateless by default so it scales across workers without session affinity. Two things to know before touching the server lifecycle:

  • Client shutdown lives in serve() in patents.py, not in a server lifespan. Under mcp 1 this was a hard rule (stateless HTTP entered the lifespan once per request, which would have closed the HTTP clients after the first tool call). mcp 2 runs the lifespan once, but serve()'s finally already covers both transports on the event loop the clients were opened on, so leave it there.
  • mcp 2.x (MCPServer) since v1.3.0: transport settings (host, port, streamable_http_path, stateless_http, json_response) go to run_streamable_http_async() via http_settings(args), not to the constructor. Tools register through tool() / legacy_tool(), which set read-only annotations and structured_output=False (mcp 2 would otherwise send every dict result twice — measured 2.0x wire size). Protocol tests connect with mcp.client.Client(patents.mcp) in memory. Type fields are snake_case in Python (read_only_hint, input_schema, is_error) and camelCase on the wire.
  • PpubsClient holds an upstream USPTO session (cookie jar, case_id, access token) shared by all concurrent calls. The clients use httpx2 (v1.4.0); httpx and httpcore are out of the tree, so don't reintroduce import httpx. Session setup is serialized by _session_lock; the access token is passed per request rather than stored on the shared client's default headers. Keep it that way — see the concurrency tests in test/unit/test_ppubs_client.py.

Read the full file on GitHub · 207 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 20d ago Changed 502b52993c5c
  2. 21d ago Changed · +6 lines · +689 tokens per session scan C → A 25b52a094ab2
  3. 22d ago Changed · +2 lines · +420 tokens per session 37a7741c1ea0
  4. 1mo ago Changed · -7 tokens per session 5b4f2d5bc8d2
  5. 1mo ago Changed · +5 lines · +286 tokens per session 30fe831a9dc3
  6. 1mo ago Changed · +6 lines · +947 tokens per session 8fb00a84676a
  7. 2mo ago First seen · 188 lines · 2,392 tokens per session scan C fd98b160084f

Subscribe to this mod's changes

patent_mcp_server CLAUDE.md is an instructions file published in the GitHub repository riemannzeta/patent_mcp_server (85 stars, last pushed 5d ago), licensed MIT. It adds 4,727 tokens to every session, about $0.0189 per session on Opus 5.5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.

Related

patent_mcp_server CLAUDE.md compared with instructions from other repositories

patent_mcp_server CLAUDE.md next to 6 instructions from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
patent_mcp_server CLAUDE.mdriemannzeta/patent_mcp_serverInstructions file855d agoMITA4,727Claude Code
vscode buildNext.instructions.mdmicrosoft/vscodeInstructions file195kyesterdayMITA9,719GitHub Copilot
next.js AGENTS.mdvercel/next.jsInstructions file143ktodayMITA7,461Codex, OpenCode
langchain AGENTS.mdlangchain-ai/langchainInstructions file149kyesterdayMITA4,680Codex, OpenCode
vscode oss-third-party-notices.instructions.mdmicrosoft/vscodeInstructions file195kyesterdayMITA5,516GitHub Copilot
vscode copilot-instructions.mdmicrosoft/vscodeInstructions file195kyesterdayMITA3,093GitHub Copilot
deepseek-harness AGENTS.mddeepseek-ai/deepseek-harnessInstructions file274k2d agoMITA4,313Codex, OpenCode