Expand AI logo
DocsDocs
Glow Active
API Reference
Login

Documentation

Get Started

OverviewWhy ExpandQuickstartWays to Use Expand

Agent Quickstarts

OverviewExpand SkillClaude CodeCursorCodexOpenCodeSkill-Based AgentsOther MCP Clients

Fetch

OverviewHow Fetch WorksOutput ModelInclude OptionsBrowser BehaviorHighlightsPlayground & ReplayBatched Fetch

Reference

API ReferenceCLI CommandsMCP Tools & ResourcesTypeScript SDKPython SDK

Account & Billing

Pricing & UsageTiersFAQ

Machine-Readable Docs

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

Get Started

OverviewWhy ExpandQuickstartWays to Use Expand

Agent Quickstarts

OverviewExpand SkillClaude CodeCursorCodexOpenCodeSkill-Based AgentsOther MCP Clients

Fetch

OverviewHow Fetch WorksOutput ModelInclude OptionsBrowser BehaviorHighlightsPlayground & ReplayBatched Fetch

Reference

API ReferenceCLI CommandsMCP Tools & ResourcesTypeScript SDKPython SDK

Account & Billing

Pricing & UsageTiersFAQ

Machine-Readable Docs

start.mdllms.txtllms-full.txtDocs as Markdown

Claude Code

Set up Expand for Claude Code with the WebFetch hook and MCP tools.

Route Claude Code's WebFetch through Expand so pages return as rendered Markdown, and register the Expand MCP server in the same step. One install command does both.

expandai login
expandai hook install claude-code project

Run this from your project root. Project setup writes .claude/settings.json and .mcp.json. The hook install also registers MCP, so you do not run a separate mcp install.

Verify it worked:

Use Expand to fetch https://news.ycombinator.com.
Show me the first 10 lines of Markdown and confirm the Fetch succeeded.

Optional auth check:

expandai
whoami

What gets installed

PieceWhat it does
WebFetch hookAdds a Claude Code PreToolUse hook for WebFetch that runs expandai hook claude-code, falling back to npx -y expandai when the CLI is not installed globally.
WebFetch deny ruleAdds WebFetch to permissions.deny in the same settings.json, which removes Claude Code's built-in WebFetch from the toolset for that scope. Global scope means every Claude Code session on the machine. Uninstall restores it.

With the deny rule in place, Claude Code does not offer WebFetch at all, so the model reaches for Expand's fetch tool and reads a clean, rendered version of the page instead of raw HTML. Denying the tool rather than intercepting each call is what keeps the transcript free of a refusal error on every fetch. The hook remains installed as a fallback: if the deny rule is removed or overridden, the hook catches WebFetch and routes it through Expand instead. The MCP server adds native fetch and fetch_search tools for follow-up fetches and Highlights search across your snapshots.

For Claude Code, the hook path is the recommended full setup. It handles WebFetch and installs MCP in one command.

Project and global scope

Project scope is the default. Use global scope when you want Expand in every Claude Code session.

ScopeCommandHook configMCP configUse when
Projectexpandai hook install claude-code project<project root>/.claude/settings.json<project root>/.mcp.jsonYou want Expand enabled for one repo.
Global

Commit project-scoped config only if the team wants Expand enabled for collaborators. Collaborators do not need a global CLI install: the hook falls back to npx -y expandai at runtime. They still need to authenticate once with npx expandai login.

Hook, MCP, and Skill

IntegrationClaude Code supportUse it when
HookRecommendedYou want Claude Code WebFetch to use Expand automatically.
MCPInstalled by hook setupYou want native tools such as fetch and fetch_search.
Skill

The hook is the recommended full setup, and it installs MCP for you. The Skill is an optional add-on for shell-based CLI use, not a replacement for the hook.

expandai skill install claude-code project

Read Expand Skill for Skill behavior and lifecycle.

Uninstall

Remove the Expand WebFetch hook, the WebFetch deny rule, and the Expand MCP entry for a scope. A WebFetch deny rule you added yourself is left in place. The hook is what marks the rule as ours — install writes both together — so uninstall removes the rule only when it also removes the hook. If you delete the hook by hand first, clear the deny rule yourself:

expandai hook uninstall claude-code project

For global setup:

expandai hook uninstall claude-code global

Troubleshooting

Claude Code still uses normal WebFetch

  • Confirm you installed the hook in the same project where Claude Code is running.
  • Restart Claude Code if it did not reload settings.
  • Confirm <project root>/.claude/settings.json contains expandai hook claude-code.
  • Make sure the prompt actually triggers WebFetch.

Fetch fails or auth is missing

Run expandai login from your terminal, then try the verification prompt again. Confirm your session with expandai whoami.

Do not paste API keys into Claude Code config for normal local setup.

MCP tools are missing

  • Confirm the hook install command completed without errors.
  • For project scope, confirm <project root>/.mcp.json contains an expandai server.
  • For global scope, confirm ~/.claude.json contains an expandai server.
  • Use Claude Code's MCP UI or command to inspect connected servers if needed.

Wrong command

Use expandai hook install claude-code project. The stale command expandai hook claude is not correct and will not install the hook.

Next steps

  • Agent Quickstarts overview
  • Expand Skill
  • MCP Tools & Resources
  • CLI Commands
  • Claude Code docs
PreviousExpand Skill
NextCursor

On This Page

What gets installedProject and global scopeHook, MCP, and SkillUninstallTroubleshootingClaude Code still uses normal WebFetchFetch fails or auth is missingMCP tools are missingWrong commandNext steps
MCP serverRegisters the Expand MCP server as expandai with expandai mcp run (written as npx -y expandai mcp run when the CLI is not on PATH at install time).
Shared authUses local Expand CLI auth from expandai login; no API key is written into Claude Code config.
expandai hook install claude-code global
~/.claude/settings.json
~/.claude.json
You want Expand across projects.
Optional
You want extra instructions for shell-based CLI use.