gpss-patent
Global patent search for AI agents through the Taiwan IPO GPSS API. A read-only MCP server plus a search-workflow skill, packaged for Claude Code and Codex.
繁體中文
Status: the spec was verified against the original TIPO files; a successful live response needs a valid userCode and has not been verified yet (see Verification). Python ≥ 3.10, mcp ≥ 2.3, uv.
What it is
GPSS (Global Patent Search System, 全球專利檢索系統) covers 23 databases across TW, US, JP, EP, KR, CN, WIPO, Southeast Asia and others, but offers only a URL-style REST API and PDF documents. Handing that to an LLM invites wrong field codes, a +/- operator prefix that gets percent-encoded, repeated invalid-userCode requests that get the IP blocked, and unbounded payloads. This server turns those constraints into a typed interface:
- Field and database codes are schema enums, cross-checked against TIPO's own files.
- The userCode is read from the environment only. It never appears in tool arguments, logs, results or error messages.
userCode not exist, expired or IP blocked trips a circuit breaker: no further network calls that session.
- Results are normalised to compact records; abstracts and claims have a character budget.
Layout
.
├── .claude-plugin/ Claude Code plugin + marketplace manifests
├── .codex-plugin/ Codex plugin manifest
├── .agents/plugins/ Codex marketplace manifest
├── .mcp.json Claude Code MCP launch (userCode from a sensitive plugin option)
├── .codex-mcp.json Codex MCP launch (forwards GPSS_USER_CODE)
├── skills/gpss-patent-search/SKILL.md Agent search workflow and rules
├── server.py MCP server (PEP 723 script, run by uv)
├── scripts/fetch_sources.py Download + hash-check TIPO's original documents
├── docs/SOURCES.md Source versions, hashes, inconsistencies between sources
├── test_server.py test_packaging.py
└── .github/workflows/ci.yml
Install
You need a GPSS userCode: GPSS → API → 使用說明 → 「API驗證碼線上申請」.
- One Email = one code. Review takes 1–3 working days from the application date; the code is mailed the next working day after approval. The form shows an expiry of application date + 1 year; renew with 「API 驗證碼展期」, recover with 「忘記 API 驗證碼」.
- GPSS policy blocks mainland China, Hong Kong and Macau: do not apply with an Email from those regions and do not connect from their IPs.
Claude Code
claude plugin marketplace add felimet/gpss-patent
claude plugin install gpss-patent@gpss-patent
On Claude Code 2.1.275 or later, one step: /plugin install gpss-patent --marketplace felimet/gpss-patent.
Then open /plugin, select gpss-patent and fill in GPSS userCode. It is kept in the platform's secure credential store and passed to the server as GPSS_USER_CODE. Restart the session.
Codex
codex plugin marketplace add felimet/gpss-patent
codex plugin add gpss-patent@gpss-patent
Export the code before starting Codex; Codex forwards only variables an MCP entry lists in env_vars, and this plugin lists GPSS_USER_CODE:
setx GPSS_USER_CODE "<your-code>" # Windows, then restart the terminal
export GPSS_USER_CODE="<your-code>" # macOS / Linux
Restart Codex after installing. Use the plugin or a hand registration, not both.
Any other MCP host
GPSS_USER_CODE=<your-code> uv run /path/to/server.py # stdio
Upgrade: claude plugin marketplace update gpss-patent / codex plugin marketplace upgrade gpss-patent, then reinstall or update the plugin.
Tools
| Tool | Purpose |
|---|
gpss_reference | Database table (with full-text flags), field table, syntax, quotas, current quota period, known caveats |
gpss_search | conditions[{field, query, op}] plus databases, case_types, patent_types, output_fields, limit, skip, text_chars, raw |
Quotas (from the GPSS API page): 10,000 records per search; work hours (Mon–Fri 08:00–18:00 Taipei) 10,000 records in total per period, off hours 30,000. A request counts at least 30 records. Probe with a small limit.
Verification
Run: python scripts/fetch_sources.py && uv run --with "mcp>=2.3,<3" --with pytest --with pypdf pytest -q
The source cross-check tests need TIPO's files, and tiponet.tipo.gov.tw answered HTTP 403 to GitHub-hosted runners (US), so CI skips them and runs only the logic and packaging tests. Maintainers run the full suite from a Taiwan network. The only documented restriction is mainland China, Hong Kong and Macau; why the US runners were refused is not documented, and whether the API endpoint (as opposed to the document downloads) refuses them too was not tested. gpss_search explains an HTTP 403 accordingly.