Skip to main content

Overview

The Henry MCP server (@henrylabs/mcp) gives Claude, Cursor, Windsurf, VS Code, Zed, and other MCP-compatible clients access to the Henry Shopping API. It is a Code Mode server: instead of exposing one tool per API endpoint, it exposes two tools and lets your agent write TypeScript against the @henrylabs/sdk client. The agent looks up what it needs with a docs search tool, then performs the whole task — search, cart, checkout — in a single code execution. This keeps the tool surface small while giving agents the full SDK.

Available Tools

The server exposes exactly two tools:

search_docs

Searches the SDK documentation for methods, parameters, and usage examples. Agents call this first to discover the right approach before writing code.

execute

Runs TypeScript code against a pre-authenticated HenrySDK client. The agent defines an async function run(client); whatever the function returns or prints comes back as the tool result. The code runs in an isolated sandbox with no web or filesystem access (see Privacy and code execution for where the sandbox runs). A typical execute call written by an agent looks like this:

Setup Instructions

General

The Henry MCP server ships as a local stdio process.
  • Install Node.js 18+ and ensure npx is on your path.
  • Set HENRY_SDK_API_KEY to a key from the Henry Dashboard.

Claude Code

Add the server from your terminal:
Or, to share the server with your team, check a project-scoped .mcp.json into the repo root:
Run /mcp inside a Claude Code session to verify the connection.

Claude Desktop

  1. Open ~/Library/Application Support/Claude/claude_desktop_config.json (macOS) or %APPDATA%\Claude\claude_desktop_config.json (Windows).
  2. Add or merge the following configuration and restart Claude Desktop:
Claude’s web client only connects to remote MCP servers. Use Claude Desktop or Claude Code, or host the server yourself with --transport http (see Running as a remote server).

Cursor

  1. Open Cursor Settings > Tools & MCP > New MCP Server.
  2. Add the following to mcp.json:

Visual Studio Code

  1. Open the Command Palette and run MCP: Open User Configuration.
  2. Add the server to mcp.json:

Windsurf

  1. Open settings with Cmd/Ctrl + ,.
  2. Under Cascade > MCP Servers, choose Add custom server.
  3. Paste the snippet below into mcp_config.json and save:

Zed

  1. Open settings with Cmd + ,.
  2. Add the configuration to your settings.json:

Others

Any MCP client that supports stdio servers can run the Henry MCP server with:
  • Command: npx
  • Arguments: -y @henrylabs/mcp@latest
  • Environment: HENRY_SDK_API_KEY

Configuration

Environment variables

HENRY_SDK_ENVIRONMENT is not read by the MCP server. To target a non-production environment, set HENRY_SDK_BASE_URL instead.

CLI flags

Run npx -y @henrylabs/mcp@latest --help for the full list. Common configurations:

Privacy and code execution

By default (--code-execution-mode=stainless-sandbox), the TypeScript your agent writes is executed in isolated sandboxes hosted by Stainless, the platform the server is built on. The generated code and your API credentials transit Stainless infrastructure in this mode. Sandboxes have no web or filesystem access beyond calling the Henry API. To keep execution entirely on your own machine, pass --code-execution-mode=local. Likewise, search_docs queries go to the Stainless-hosted search API by default; pass --docs-search-mode=local to use an in-memory index built from embedded SDK data (and any --docs-dir files) instead.

Running as a remote server

Launching with --transport http serves the MCP server over Streamable HTTP. Use --port to pick the port or --socket to bind a Unix socket:
Clients authenticate with an x-api-key header instead of the environment variable: