MarkDocket CLI + MCP

Bring MarkDocket into your terminal and AI tools

Run patent review, USPTO research, portfolio operations, and automations from the command line—or give Cursor, Claude, and ChatGPT the same account-scoped tools through MCP.

Node.js 20+ · Browser OAuth · Current release @markdocket/cli@0.2.2

markdocket — zshsample workflow
~$npm install --global @markdocket/cli
~$markdocket --version
0.2.2
~$markdocket login
Signed in as MarkDocket user <user@example.com> through the browser.
OAuth credentials saved to /Users/example/.config/markdocket/config.json
~$markdocket patent review acme/widget --depth deep --wait --prior-art
Scan update: 9% · mapping codebase
Scan update: 82% · synthesizing final report
Scan update: 100% · complete
Patent review · acme/widget@main
Status: completed
Scanned: 2026-07-15T12:00:00.000Z
Worker: requested depth deep
Top candidate inventions:
1. Adaptive claim graph · confidence medium
Builds a constrained graph from live code paths.
Citations: ["src/graph.ts:40-88"]
Counter-evidence: ["Could be an obvious graph traversal."]
Prior-art keywords: adaptive claim graph, code path constraints
Prior-art follow-up:
- Candidate 1: adaptive claim graph code path constraints — {"results":[{"publicationNumber":"US123"}]}
Full durable report: https://app.example/dashboard/reports
Coverage: Pushed ref only.
Legal: Candidate evidence only.
~$markdocket setup cursor --hosted
No files changed. Add this entry to your Cursor MCP config:
{
  "mcpServers": {
    "markdocket": {
      "url": "https://app.markdocket.com/mcp"
    }
  }
}
Suggested path: /Users/example/.cursor/mcp.json
Cursor will open MarkDocket OAuth when it first connects.
Use --install to write this entry explicitly.
Sample end-to-end workflow using generic fixture data: install and verify the published MarkDocket CLI package, sign in with browser OAuth, run the acme/widget patent-review fixture with bounded waiting and prior-art follow-up, then print the hosted MarkDocket MCP configuration for Cursor. The transcript follows new output automatically until the user scrolls away from the bottom.
Two interfaces

One catalog. Two ways to work.

The CLI is explicit and scriptable. MCP gives an AI client typed tools it can discover and call. Both use the same MarkDocket account and catalog-backed execution.

CLI

Direct, scriptable control

Best for: Terminal workflows, scripts, and CI

Use concise shortcuts for common work, or inspect and call any externally eligible catalog tool by name.

  • Human-readable output by default; machine-readable JSON on every command
  • Patent review, prior-art follow-up, USPTO search, portfolios, deadlines, reports, and Vault reads
  • Create, validate, run, and inspect visual automations from JSON
MCP

Structured tools for AI clients

Best for: Cursor, Claude, ChatGPT, and MCP hosts

Let an AI client discover typed MarkDocket tools and act within the account and permissions of the person who connects.

  • Hosted Streamable HTTP with OAuth, or local stdio from the same npm package
  • Core IP tools by default; connected-account suites stay opt-in
  • Read/write consent, tool annotations, and schema validation carried into the client
Quick start

From install to first result

Install globally with npm, sign in through your browser, then discover the core tool catalog or use an ergonomic shortcut.

  1. Install

    01

    Install the latest @markdocket/cli release. Current version 0.2.2; requires Node.js 20 or newer, and Bun is not required.

    Install @markdocket/cli
    npm install --global @markdocket/cli
  2. Authenticate

    02

    The browser flow supports Google, password, and 2FA accounts.

    Browser login
    markdocket login
    markdocket whoami
  3. Run

    03

    Inspect available tools, or start with a focused shortcut.

    First commands
    markdocket tools list --category core
    markdocket search trademark ACME --limit 10
Command line

Built for real IP workflows

Shortcuts cover frequent tasks. The catalog interface covers everything else without duplicating route definitions or argument schemas.

Research and operate

Search live USPTO records, inspect the portfolios you track, check deadlines, or read extracted text from Vault documents.

Everyday IP operations
markdocket search trademark ACME --limit 10
markdocket portfolios list
markdocket deadlines --json
markdocket vault read "Contracts/nda.pdf"

Review pushed code for patent candidates

Resolve a connected GitHub repository, run a bounded patent-focused scan, read the durable report, and follow the strongest findings with prior-art research.

Repository review covers the pushed GitHub ref only. Findings are candidate invention evidence, not a patentability determination or legal opinion.

Patent review workflow
markdocket patent review . --wait --prior-art --allow-pushed-only

Author visual automations

Inspect the action catalog, validate a graph before saving, and create the same automations available in the visual builder.

Automation authoring
markdocket automations catalog --json
markdocket automations validate --input graph.json
markdocket automations create "Weekly digest" --input graph.json

Reach the full eligible catalog

Discover descriptions and argument schemas before executing a tool. Values are JSON-coerced, and --args accepts a complete object.

Catalog discovery and execution
markdocket tools show clearance_run
markdocket call clearance_run --args '{"name":"ACME","classes":[9,42]}'

Global flags on every command: --json and --api-url <url>.

Model Context Protocol

Connect locally or over hosted OAuth

Choose stdio when you want the npm package to run beside your AI client. Choose the hosted endpoint when the client should connect directly and authenticate each user in the browser.

Hosted MCP

OAuth

Paste the endpoint into Cursor, Claude, or ChatGPT. The client opens MarkDocket sign-in and consent; no local process or copied token is required.

Streamable HTTP endpoint
https://app.markdocket.com/mcp
Cursor hosted setup
markdocket setup cursor --hosted --install
Claude Code hosted setup
markdocket setup claude-code --hosted --install

Local stdio

npm

Run the MCP server from the package. It reads the private CLI config created by markdocket login.

Cursor stdio setup
markdocket setup cursor --install
Claude Code stdio setup
markdocket setup claude-code --install

Portable Cursor configuration

This credential-free entry follows the current public npm release, matching the pinned global install above. The setup helper can install an equivalent entry with markdocket setup cursor --install.

Cursor mcp.json
{
  "mcpServers": {
    "markdocket": {
      "command": "npx",
      "args": ["-y", "@markdocket/cli@latest", "mcp"]
    }
  }
}

Control the tool surface

The focused core IP set is the default. Use all or comma-separated category slugs to opt into broader connected-account suites.

Run the stdio MCP server
markdocket mcp --categories core

Examples of broader selections: --categories all or --categories portfolios,gmail,github.

Authentication

Browser login, without credentials in config

The setup is designed for humans at a terminal, individual users connecting an AI client, and headless environments.

01

Sign in through the browser

markdocket login opens MarkDocket and completes authorization-code + S256 PKCE. Google, password, and 2FA accounts are supported.

02

Create an account when needed

Run markdocket login, then click Sign up in the browser. Complete the account wizard, email verification, phone verification, and required consent. When onboarding finishes, return to the terminal and run markdocket login again to authorize the CLI.

03

Keep signup data in the browser

Google and Apple currently authenticate existing accounts only. The CLI never collects passwords, phone numbers, verification details, or legal consent; signup remains on app.markdocket.com.

04

Keep credentials out of project files

The CLI stores private credentials under XDG_CONFIG_HOME (normally ~/.config/markdocket/config.json), refreshes browser-OAuth sessions, and never needs a token pasted into MCP configuration.

05

Use the right auth path

Local stdio reads the CLI config. Hosted MCP clients complete OAuth and read/write consent per user. Headless environments can provide MARKDOCKET_TOKEN.

Keep tokens out of MCP configuration.

The stdio process reads the CLI credential store itself. Hosted clients use OAuth 2.1 authorization code + S256 PKCE and ask each user to approve read and/or write access.

Shared catalog

One source of truth, not a second API

Externally eligible tools are derived from the same registry used by the in-product MarkDocket agent.

Discovery
Tool names, categories, and descriptions come from the agent catalog.
Validation
The same Zod argument schemas drive CLI catalog inspection and MCP inputs.
Execution
Both surfaces use account-scoped MarkDocket operations and the same metering path.
Safety
Read-only and destructive hints are derived for MCP, while dedicated automation mutations require an explicit --yes.

Agent-loop-only web search, goods classification, and chat attachment listing are intentionally excluded from external CLI and MCP surfaces.

Put MarkDocket where you already work

Install the CLI for direct control, or connect the hosted MCP endpoint and let your AI client work through structured, account-scoped tools.

View @markdocket/cli on npm