Skip to main content

Documentation Index

Fetch the complete documentation index at: https://docs.sellfern.com/llms.txt

Use this file to discover all available pages before exploring further.

Sellfern provides a Model Context Protocol (MCP) server that exposes your orders, analytics, and fulfillment data as native tools for AI assistants. Once connected, Claude Desktop can list orders, pull profit summaries, update statuses, and assign suppliers — all from a natural language conversation, with no custom code on your side.

Prerequisites

  • Node.js 18 or later installed on the machine running the MCP server
  • A Sellfern API token with the scopes required by the tools you want to use (see the token creation step below)
  • Claude Desktop, Cursor, OpenCode, or another MCP-compatible client

Setup

1

Build the MCP server

From the root of the Sellfern project directory, build the MCP server:
cd mcp-server
npm install
npm run build
This produces mcp-server/build/index.js, the entry point you will reference in the config file.
2

Locate your client's config file

The config file path depends on your operating system:
OSPath
macOS~/Library/Application Support/Claude/claude_desktop_config.json
Windows%APPDATA%\Claude\claude_desktop_config.json
Linux~/.config/Claude/claude_desktop_config.json
Create the file if it does not exist.
3

Add the Sellfern MCP server config

Paste the following into claude_desktop_config.json, merging with any existing mcpServers keys if the file already has content:
{
  "mcpServers": {
    "sellfern": {
      "command": "node",
      "args": ["/absolute/path/to/mcp-server/build/index.js"],
      "env": {
        "SELLFERN_API_URL": "https://api.sellfern.com",
        "SELLFERN_API_TOKEN": "sk_live_YOUR_TOKEN_HERE"
      }
    }
  }
}
Replace /absolute/path/to/ with the real path to the cloned repository on your machine.
FieldDescription
commandRuntime to use — node for the JS MCP server
argsAbsolute path to the compiled entry point
env.SELLFERN_API_URLBase URL for the Sellfern REST API; use http://localhost:3000 for local development
env.SELLFERN_API_TOKENYour bearer token — must start with sk_live_
4

Create an API token in Sellfern

In Sellfern, go to Settings → API Tokens and create a new token. Select the scopes your agent needs:
  • orders:read — read order data
  • orders:write — update order fields
  • orders:status:write — change order status
  • analytics:read — access revenue and profit summaries
  • fulfillment:read — view the fulfillment queue
  • fulfillment:write — assign suppliers
Copy the sk_live_... value and paste it as SELLFERN_API_TOKEN in the config file.
5

Restart your AI client

Claude Desktop loads MCP servers at startup. Quit the app completely and reopen it. You should see a hammer icon in the compose bar listing the available Sellfern tools.

Available MCP tools

Once connected, your AI assistant can call any of these tools:
ToolDescription
list_ordersList orders with optional filters: status, store ID, search query, date range, and pagination
get_orderFetch full detail for a single order by ID
update_order_statusUpdate the status of an order, optionally adding a tracking number
bulk_update_order_statusUpdate multiple order statuses in a single call
add_order_noteAppend a note to an order
get_analytics_summaryRevenue, order count, COGS, gross profit, and margin for a given period (last_7_days, last_30_days, mtd, ytd)
list_fulfillment_queueList orders currently awaiting a fulfillment action
assign_supplierAssign a supplier to one or more orders

Other compatible clients

The MCP server uses the stdio transport by default, which works with Claude Desktop and Cursor. It also supports an HTTP/SSE transport for clients that connect over a network:
# Start with HTTP/SSE transport (default port 8765)
node build/index.js --http
Any MCP-compatible client — including OpenCode and custom agent frameworks — can connect to the SSE endpoint at http://localhost:8765/sse.

Troubleshooting

Verify that the path in args points to mcp-server/build/index.js and that you ran npm run build in the mcp-server/ directory. The file must exist before you start the client.
Check that SELLFERN_API_TOKEN starts with sk_live_ and has not been revoked in Settings → API Tokens.
The token you are using does not have the scope required by the tool. Go to Settings → API Tokens, rotate the token, and add the missing scope. Common scopes needed: orders:read, analytics:read, fulfillment:read.