AI agent (MCP)¶
Connect an AI assistant — Claude, ChatGPT, Cursor and others — to your HugeProfit account. You ask in plain words ("what sold best last week?", "add a sale for this client"), and the assistant reads and, if you allow it, changes data. It works through MCP (Model Context Protocol) on top of API v2: the same permissions, limits and checks as any API call.
- MCP server address:
https://crm.h-profit.com/bapi-v2/mcp - Only the account administrator connects an agent.
- The agent needs its own AI agent key: an API v2 key does not work with MCP.
The agent works on your live account
With write permissions it can change and delete data, issue fiscal receipts, create paid waybills and message clients. An assistant can make a mistake or follow instructions hidden in someone else's text (a chat message, a review, a product description). Grant only what the task needs.
Two ways to connect¶
| Sign in from the assistant | AI agent key | |
|---|---|---|
| Clients | Claude (claude.ai, desktop app), ChatGPT, Claude Code | Claude Code, Cursor and other clients that send a header |
| What you enter | only the server address | the address and the key |
If your client supports sign-in, use it: there is no key to copy and store.
Option 1. Sign in from the assistant¶
-
Add a custom MCP server (connector) with the address
https://crm.h-profit.com/bapi-v2/mcp:- Claude (claude.ai or the desktop app): Settings → Connectors → Add custom connector.
- ChatGPT: add a custom MCP server in the settings. Requires a paid plan: Free has no custom MCP servers.
- Claude Code: run the command below, then type
/mcpin Claude Code, pickhugeprofitand sign in.
-
The assistant opens HugeProfit in the browser. Sign in as the administrator if you are not signed in.
-
Check the request and choose what the assistant may do:

- The app names itself, so the name is not verified. Check where we'll return you:
claude.ai,chatgpt.com, orlocalhostfor an app on your computer (Claude Code). Allowlocalhostonly if you started that app yourself. - Name — how the connection is shown in HugeProfit.
- Permissions — Read only is selected by default; see Permissions.
- The app names itself, so the name is not verified. Check where we'll return you:
-
Press Allow. The browser returns you to the assistant, and the connection is ready.
The connection appears in Settings → Integrations → Other as an AI agent card with the chosen name. If you connect the same app again, the same card is updated and the previous access stops working.
Option 2. Connect with a key¶
-
Open Settings → Integrations → Other → AI agent and press Connect integration. You can create several agents, each with its own name, permissions and key.

-
Fill in the form:

- Name — e.g. "Claude in support".
- Sales channels for orders and for sales made by the agent — the same as for an API v2 key, see Integration setup.
- Permissions — see Permissions.
-
Press Save and copy the key immediately: it is shown only once (
hp_live_…), together with the server address and a ready command for Claude Code. -
Add the server to your client. The key goes in the header
Authorization: Bearer hp_live_….
The server speaks MCP over Streamable HTTP (JSON answers, no SSE), protocol versions 2024-11-05 to 2025-11-25. The same key also works with the REST API v2.
Permissions¶
The form and the consent screen offer three options:
| Option | What the agent may do |
|---|---|
| Read only (default) | read every section |
| Full access | read and change everything, including replying to clients in chats |
| Custom | per section: no access, read, or read and change |
- Reply to clients (
chats:send) is a separate permission, off by default: a message goes to the client at once and cannot be recalled. - The agent sees only the tools its permissions cover: without write permission there are no write tools.
- An agent has no webhooks.
- Full access and a whole section are saved as a list of today's permissions: permissions added to HugeProfit later are not granted by themselves, enable them in the card.
- Changes take effect within 30 seconds. Scope names — in Authentication.
Check the connection¶
Ask the assistant: "Call the HugeProfit me tool". It answers with your account and the permissions of the
connection. Then try something simple, e.g. "Show my last five sales".
What the agent can do¶
About a hundred tools, each one an API v2 endpoint (details in Resources):
- Products — list and search, card with stock and prices, create, edit, delete, stock and prices, categories, brands, marketplace bindings.
- Sales — create, edit, status, comment, tracking number, cancel and refund, restore, fiscal receipt, Nova Poshta waybill.
- Orders — list, card, create, status, delete and restore.
- Clients — cards, tags, debt, purchase history.
- Finance — expenses and income, accounts and transfers.
- Warehouse — shipments and suppliers, moves, inventories, write-offs, production.
- Marketing — promotions (including price export to marketplaces), campaigns.
- Reports — summary, sales and expenses; history of actions; chats — read and reply.
- Lookups — warehouses, channels, currencies, carriers, cities and Nova Poshta branches.
Account settings, users and their rights, tariff and payment, integrations and keys stay in the interface: the agent has no access to them.
Built-in safety¶
- Write tools are marked as such, so Claude, ChatGPT and other clients ask you before calling them. The agent is also told to look data up first and, before every change — even one you asked for, even a new record — to say what exactly it will do and wait for your "yes".
- A sale created by the agent carries an
external_id: a repeated request gets409instead of a second sale. A repeated receipt or waybill for the same sale gets409too. - An unknown argument is an error, not a silently dropped filter. A bulk change takes at most 50 records.
- A call answers within 120 seconds. After a timeout the action may still complete, so the agent reads the current state instead of repeating it.
- The same limit as an API key: 120 requests per minute (see Conventions).
- Chat messages, comments and client names are data for the agent, not instructions.
Large lists take up the assistant's memory: ask for fewer records or only the fields you need.
Manage and revoke access¶
In the AI agent card:
- Edit — name, channels and permissions.
- Regenerate the key — the old one stops working within 30 seconds.
- Deactivate or delete — access stops within 30 seconds. An app connected by sign-in will ask you to sign in again.
Troubleshooting¶
| Symptom | Cause and fix |
|---|---|
401, or the assistant asks to sign in again |
The key was regenerated, deactivated or deleted. Sign in again or put in the new key. |
403 "MCP accepts only AI agent keys" |
An API v2 or website key was used. Create an AI agent key. |
| The agent says it cannot change something | The section is read-only for this agent. Enable writing in the card. |
| Permissions were added, but the agent still lacks the tools | The assistant keeps an old tool list. Ask it to call access_check: it lists the tools your permissions give; then refresh or reconnect the HugeProfit connector. |
429 rate_limited |
Over 120 requests per minute. Wait for the minute to pass. |
| No AI agent card, or the consent screen refuses | Only the account administrator connects agents. |