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 2,392 tokens per session, scanned C, 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 2,392 This file is loaded in full into every session.
When invoked 2,392 The same file — it is already loaded in full.
Security scan C 1 finding. 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.02392 $0.02392
Opus 5 $0.01196 $0.01196
Sonnet 5 $0.00478 $0.00478
Haiku 4.5 $0.00239 $0.00239

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

Security

Grade C, and why

patent_mcp_server CLAUDE.md scanned grade C with 1 finding 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 10d 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.

Recursive force deletehighDestructive command

rm -rf with a variable or a broad path is one typo away from removing the wrong tree.

4. Build: `rm -rf dist/ && uv run python -m build`
CLAUDE.md · 188 lines

How it starts

The opening of the file, as written. The whole thing — 188 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 with FastMCP 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:

  • Do not move client shutdown into a FastMCP lifespan. In stateless HTTP mode the low-level server is entered once per request, so a lifespan would close the nine httpx clients after the first tool call. Shutdown lives in serve() in patents.py, inside the same event loop the clients were opened on.
  • PpubsClient holds an upstream USPTO session (cookie jar, case_id, access token) shared by all concurrent calls. 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.

Current state (v1.1.0): 61 registered tools, 36 active, 25 unavailable due to API shutdowns:

  • Active: PPUBS (5), ODP (12), PTAB (7), TSDR (4), Trademark search/assignments (3), Utility (5)
  • Unavailable: PatentsView (14, shut down March 2026), Office Actions (4, decommissioned early 2026), Enriched Citations (3, decommissioned early 2026), Litigation (4, not offered on ODP — issue #16)

Trademark backend contracts (verified live 2026-06-10):

  • tmsearch (tmsearch_client.py): POST tmsearch.uspto.gov/prod-stage-v1-0-0/tmsearch, Elasticsearch-style body, non-standard response envelope (hits.totalValue, hit source/id). No key; behind AWS WAF (currently permissive — TMSEARCH_WAF_TOKEN supported as escape hatch). Class filters need zero-padded 3-digit terms ("025").
  • Assignments (tm_assignment_client.py): POST assignmentcenter.uspto.gov/ipas/search/api/v2/public/trademark/exportTradeMarkData with searchCriteria list; no key. The legacy assignment-api.uspto.gov died with the Developer Hub on June 5, 2026.
  • TSDR (tsdr_client.py): requires a TSDR-specific key from account.uspto.gov/profile/api-manager — the ODP key passes the gateway but 404s on the backend (BACKEND RESPONSE STATUS: 404); the client detects this and explains. Status uses /info + Accept: application/json; the document list at /casedocs/{caseid}/info is XML-ONLY (406 on JSON Accept) and is parsed via _parse_document_list_xml. Binary bundles are capped at TrademarkDefaults.MAX_BINARY_BYTES (full wrappers can exceed 10 MB) — filter by document_type/date. All endpoints verified live 2026-06-10 with a real TSDR key.

Read the full file on GitHub · 188 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. 10d 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 (78 stars, last pushed 8d ago), licensed MIT. It adds 2,392 tokens to every session, about $0.0120 per session on Opus 5. A static security scan graded it C with 1 finding (recursive force delete). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.

Related

Other instructions, from other repositories

next.js AGENTS.md

AGENTS.md instructions for vercel/next.js, covering next.js development guide, codebase structure, monorepo overview, core package: packages/next and other important packages.

vercel/next.js · 7,296 tokens

codex AGENTS.md

AGENTS.md instructions for openai/codex, covering rust/codex-rs, the codex-core crate, code review rules, crate api surface and model visible context.

openai/codex · 5,153 tokens

vscode buildNext.instructions.md

Working notes and architecture documentation for the new esbuild-based build system in build/next. Use when making changes to the new build pipeline (transpile/bundle commands, NLS plugin, source-map handling, resource copying, or self-hosting watch tasks).

microsoft/vscode · 6,785 tokens

spec-kit AGENTS.md

AGENTS.md instructions for github/spec-kit, covering agents.md, about spec kit and specify, quickstart — add a new integration in 5 steps, integration architecture and integrationmanifest — file tracking.

github/spec-kit · 7,104 tokens

vscode oss-third-party-notices.instructions.md

Instructions for microsoft/vscode, covering vs code oss third-party-notices pipeline, architecture, pipeline flow in ci, applying the notice (cutover) and fallback chain (never fail the build).

microsoft/vscode · 5,001 tokens

langchain AGENTS.md

AGENTS.md instructions for langchain-ai/langchain, covering global development guidelines for the langchain monorepo, corridor security analysis, project architecture and context, monorepo structure and development tools & commands.

langchain-ai/langchain · 4,469 tokens