Expand AI logo
DocsDocs
Glow Active
API Reference
Login

Documentation

Get Started

OverviewMCP ServerQuickstartWhy ExpandWays to Use Expand

Fetch

OverviewHow Fetch WorksOutput ModelProgressive DisclosureInclude OptionsDocumentsYouTubeBrowser BehaviorHighlightsPlayground & ReplayBatched Fetch

Reference

MCP Tools & ResourcesCLI, Skill & HooksCLI CommandsAPI ReferenceTypeScript SDK

Account & Billing

Pricing & UsageTiersFAQ

Machine-Readable Docs

start.mdllms.txtllms-full.txtDocs as Markdown
Browse docs

Get Started

OverviewMCP ServerQuickstartWhy ExpandWays to Use Expand

Fetch

OverviewHow Fetch WorksOutput ModelProgressive DisclosureInclude OptionsDocumentsYouTubeBrowser BehaviorHighlightsPlayground & ReplayBatched Fetch

Reference

MCP Tools & ResourcesCLI, Skill & HooksCLI CommandsAPI ReferenceTypeScript SDK

Account & Billing

Pricing & UsageTiersFAQ

Machine-Readable Docs

start.mdllms.txtllms-full.txtDocs as Markdown

CLI, Skill & Hooks

The local setup path — install the Expand CLI to intercept your agent's web fetch, add the Expand Skill, and fetch from a terminal.

The MCP server is the fastest way to give an agent Fetch, and it needs nothing installed. This page covers what the local CLI adds on top of it.

Reach for the CLI when you want one of these:

  • Intercept the agent's own web fetch. A hook reroutes Claude Code's or OpenCode's built-in WebFetch through Expand, so the agent gets rendered Markdown without being told to use a specific tool.
  • Fetch from a terminal. expandai fetch <url> for you, or for agents that prefer shell commands over MCP tools.
  • The Expand Skill. Written guidance an agent loads on demand: when to prefer Expand, how to cite captures, how to resolve appendix markers.
  • Restricted networks. The CLI honours HTTP_PROXY and HTTPS_PROXY, which some environments require.

Install and authenticate

npm install -g expandai
expandai login

expandai login opens a browser, you approve, and the credentials are stored under your user profile — ~/.config/expandai/config.json on macOS and Linux, %APPDATA% on Windows. No API key is written into any agent's config file.

Prefer not to install globally? Every command works through npx -y expandai ….

One command per agent

expandai init detects the agents on your machine and configures the ones you choose.

expandai init --detect

Or configure one directly. hook install is the fuller setup for agents that support hooks: it installs the hook, the skill, and registers the MCP server in a single step.

AgentCommandWhat it configures
Claude Codeexpandai hook install claude-code projectWebFetch hook, WebFetch deny rule, Expand Skill, MCP server
OpenCodeexpandai hook install opencode projectWeb-fetch hook, Expand Skill, MCP server

Scope is project or global. Project scope writes into the current repository so collaborators inherit it; global scope applies to every session on the machine.

What a hook does

A hook intercepts the agent's built-in web-fetch tool before it runs and routes the URL through Expand instead. On Claude Code the installer also adds WebFetch to permissions.deny, which removes the built-in tool from the toolset entirely. Denying it rather than intercepting every call is what keeps a refusal error out of the transcript on each fetch; the hook stays installed as a fallback in case the deny rule is removed.

This is the one capability the hosted MCP server cannot provide. A remote server can offer tools, but it cannot change what the agent's own tools do.

Verifying and removing

expandai status              # what is configured, and where
expandai whoami              # which organization you are signed in as
expandai uninstall           # remove hooks, skill, and MCP entries

Running MCP locally

expandai mcp run starts the same MCP server over stdio, authenticated with your CLI login rather than the browser flow. It exists for offline work and for networks where an editor cannot reach an external endpoint directly.

{
  "mcpServers": {
    "expandai": {
      "command": "expandai",
      "args": ["mcp", "run"]
    }
  }
}

For everything else, prefer the hosted server: it needs no local process, so it cannot fail because of a Node version, a missing npx, or a permissions problem on the credential file.

Windows

Everything above works on Windows without an elevated shell. The CLI stores credentials under your user profile and tightens the file's ACL when it can; when Windows declines that change — which it does for a non-elevated account — the CLI logs a warning and carries on rather than failing the command.

PreviousMCP Tools & Resources
NextCLI Commands

On This Page

Install and authenticateOne command per agentWhat a hook doesVerifying and removingRunning MCP locallyWindows
Cursor
expandai init --harness cursor --scope project
Expand Skill, MCP server
Codexexpandai init --harness codex --scope projectExpand Skill, MCP server