Contents

Connect an AI assistant

Give Claude, ChatGPT or your own agent access to Nucleo with the MCP connector, with each person's own permissions.

How it works

Nucleo runs one remote Model Context Protocol server at https://mcp.nucleoplatform.com. An AI client connected to it sees the tools of every Nucleo module the person can use — Brain, Catalog, Commerce, Intelligence — in the active company (chosen with nucleo_switch_company), with their own roles and permissions. Delete tools are not exposed, with two exceptions: brain_delete_deal (a soft delete of a deal created by mistake, restorable by an admin) and catalog_forget_memory, which deletes an entry of Atomo's memory in Catalog at once and for good. Writes that cannot be undone automatically are marked as destructive, so the AI client can ask the person first.

There are no keys to copy: the person signs in to Nucleo from the AI client and approves a consent screen. The client gets an OAuth access token that only works on the AI tools.

Connect Claude or ChatGPT

Claude (web, desktop and mobile apps):

  1. In Claude, go to Settings > Connectors and select Add custom connector.
  2. Name it Nucleo and enter the URL https://mcp.nucleoplatform.com.
  3. Select Connect, sign in to Nucleo and approve access.

ChatGPT (developer mode):

  1. In ChatGPT, go to Settings > Connectors > Advanced and turn on developer mode.
  2. Select Create, enter the MCP server URL https://mcp.nucleoplatform.com and choose OAuth authentication.
  3. Sign in to Nucleo and approve access.

If the person belongs to more than one company, the assistant can list them and switch with the connector's own tools before working.

Build your own MCP client

Any MCP client that supports remote servers with OAuth works. The server speaks protocol version 2025-06-18 over Streamable HTTP with JSON responses (no server-sent stream). The flow your client runs:

  1. POST https://mcp.nucleoplatform.com without a token → 401 with a WWW-Authenticate header pointing to the protected-resource metadata (RFC 9728).
  2. The metadata names https://auth.nucleoplatform.com as authorization server; read its metadata at /.well-known/oauth-authorization-server.
  3. Register the client at /oauth/register (RFC 7591) with your redirect_uris.
  4. Run the authorization code flow with PKCE (S256); the person signs in and consents.
  5. Exchange the code at /oauth/token, then send Authorization: Bearer <token> on every MCP request. Refresh with the refresh token when it expires.
Register a client
curl -X POST https://auth.nucleoplatform.com/oauth/register \
  -H "Content-Type: application/json" \
  -d '{
    "client_name": "Acme Ops Assistant",
    "redirect_uris": ["https://assistant.acme.example/oauth/callback"],
    "token_endpoint_auth_method": "none"
  }'
List the tools
curl -X POST https://mcp.nucleoplatform.com \
  -H "Authorization: Bearer $NUCLEO_ACCESS_TOKEN" \
  -H "Content-Type: application/json" \
  -H "Accept: application/json, text/event-stream" \
  -d '{"jsonrpc": "2.0", "id": 1, "method": "tools/list"}'

Every call to /oauth/register creates a new client: register once and store the client_id. Redirect URIs must be https, except loopback addresses for local tools.

Call the module tools without MCP

If you run your own agent runtime and do not need MCP, the same tools are available as plain HTTP on each module: GET /api/v1/ai-tools lists them with their JSON Schema, POST /api/v1/ai-tools/{name} runs one. Use the same OAuth token and name the company in X-Nucleo-Company with its public id (orgs[].public_id in userinfo; the numeric id is deprecated). See AI Tools.

Upload a file to a deal

An assistant that produces a file — a PDF quote, a slide deck, a spreadsheet — does not pass it as a tool argument. Brain takes it in three steps:

  1. Call brain_create_file_upload with the file name (PDF, PPTX, DOCX, XLSX, PNG or JPG, up to 25 MB). It returns an upload_id and a signed upload_url, valid once and for 15 minutes.
  2. Send the file to upload_url with an HTTP PUT, the raw bytes as body and the Content-Type it returned. No token is needed: the signature in the URL is the credential.
  3. Call brain_attach_file_to_deal with the upload_id and the deal_id. The file becomes a draft document of the deal, which the person approves and sends from Brain.
Send the file
curl -sS -X PUT "$UPLOAD_URL" \
  -H "Content-Type: application/pdf" \
  -H "Accept: application/json" \
  --data-binary @quote.pdf

Quote the URL: it carries the expires and signature parameters. Nucleo checks the real content of the file, so a file whose bytes do not match its extension is refused; after a refusal, start again from the first step. See Upload a file to a signed URL for every response.

Keep document numbers aligned

Contracts and quotes carry a Nucleo number (C-YYYY-NNNN, PRV-YYYY-NNNN) that the client sees on the document and that invoices cite. The number printed on the document and the number of the record in Brain must be the same, so an assistant that writes a contract or a quote follows one flow, always with the same number:

  1. Call brain_reserve_document_number with the kind and the deal_id before writing the document, and print the number in the document.
  2. Save the document with that number: brain_create_deal_document or brain_attach_file_to_deal with document_number. For doc_type contratto or preventivo the Contract or Quote record with the same number is linked, or created if it does not exist (record in the result); contract_id / quote_id attach the file to an existing record of the deal.
  3. If you create the record yourself, call brain_create_record (contracts, quotes) with number, or with only the deal_id: the open reservation of the deal is used. Without either, Nucleo assigns the next number.

brain_list_document_numbers shows the reserved numbers of a deal with their status (reserved, used by a record, cancelled), the documents that carry them and the contracts and quotes of the deal with their number. brain_cancel_document_number cancels a reserved number that nothing uses: a cancelled number is never reassigned.

To correct the number of an existing contract (also a signed one) or quote, call brain_update_record with number and change_reason. The change goes to the company timeline with the old and the new number, the reason and the person; the deal documents linked to the record follow the new number. A number is unique per type in the company: error: number_taken names the record that already uses it in taken_by. A number reserved for another deal (number_reserved_for_other_deal), a cancelled one (number_cancelled) and a Nucleo number of the current year not issued yet (number_not_issued) are refused; historical numbers in another format are accepted with a warning in warnings.

Correct the number of a contract
{
  "name": "brain_update_record",
  "arguments": {
    "type": "contracts",
    "id": 1234,
    "fields": {
      "number": "C-2026-0482",
      "change_reason": "Aligned to the number of the contract sent to the client"
    }
  }
}

Close a signed contract

A signed contract keeps its content: amount, dates and terms do not change, and nothing is deleted. When it ends early — replaced by a new contract, withdrawn, ended by mutual agreement or simply no longer active — close it with brain_terminate_contract (permission contracts.edit), after the person confirms:

  • termination_type: replaced, withdrawal, mutual or expired; replaced needs replaced_by_contract_id, the new contract of the same company.
  • effective_end_date: the last day, also in the past. With a date today or past the contract becomes expired at once and leaves renewals, the expiry schedule and the deal value; with a future date it stays signed until then, with auto-renewal off, and expires by itself.
  • change_reason is required and the closure runs only after the person approves it in Nucleo (the preview returns approval_url); notified_at, penalty_cents and notes fill the withdrawal fields.

The closure is written in the company timeline (contract, type, date, reason, person). A replaced contract points to the new one (replaced_by_contract_id) and the new one lists it under replaces in brain_get_contract. Calling the tool again corrects the closure; the previous values are kept.

To clean up many contracts at once, brain_list_contracts lists them with filters (up to 200 per page), and three tools act on up to 100 per call, each with one preview row per contract and one confirmation: brain_bulk_terminate_contracts closes signed contracts (also keeping the end date already on the contract, use_contract_end_date), brain_bulk_archive_contracts archives duplicates and brain_bulk_relink_contracts moves contracts to another company or deal. A failure on one contract does not stop the others.

Read and change Brain records

For CRM records without a dedicated tool, Brain has five generic ones: brain_list_record_types, brain_search_records, brain_get_record, brain_create_record and brain_update_record. Call brain_list_record_types first: it is the manual of the fields the person can read and write, with the allowed values (enum) and, under lookups, the options of the fields linked to a lookup table. Lookup ids belong to each company: read them again after nucleo_switch_company.

  • Relationship types of a company (Client, Prospect, Supplier, Partner…): relationship_type_ids holds ids from lookups.business_relationship_types. brain_get_record returns them with id and name under relations, and brain_search_records can filter on them. In brain_update_record the list replaces the current one ([] clears it); relationship_type_ids_add and relationship_type_ids_remove add or remove single ids and keep the others.
  • Lifecycle stage of a company: lifecyclestage takes the same values as contacts (subscriber, lead, marketingqualifiedlead, salesqualifiedlead, opportunity, customer, evangelist, other) or null. Partner or supplier is a relationship type, not a stage.
  • Close date of a deal: Nucleo sets closed_at when a deal moves to won or lost, and later saves never change it. To record the real date of a won or lost deal, send closed_at (YYYY-MM-DD or an ISO date-time): it cannot be in the future or earlier than the day the deal was created, and open deals have none.
  • Fleet: cars and traffic fines (permission fleet.view to read, fleet.manage to write): record types vehicles and fines. A fine finds its car from plate and, when they are empty, Nucleo computes reduced_due_at (5 days), due_at (60 days) and, with driver_communication_required, driver_communication_due_at (60 days) from notified_at. status is one of to_verify, to_pay, paid, contested, enrolled, cancelled; amounts are in cents (reduced_amount_cents within 5 days, amount_cents within 60, full_amount_cents after). Filter brain_search_records with e.g. {"status": "to_pay", "due_at": {"lte": "2026-11-30"}} or {"driver_communicated_at": null, "driver_communication_required": true}. brain_import_fine_from_email reads a fine from a PEC without creating duplicates; brain_link_fine_payment links the bank transaction that paid it. Archive a duplicate with archived_at: true (restore with false): it disappears from searches. What the import read from the fine is in extraction_notes, so writing notes never loses it. Nucleo also keeps fines up to date by itself: fine notices arriving by PEC or SEND become fines assigned to the person responsible for fines (to_pay, or to_verify when plate, amounts or notification date are missing); later emails about a fine update it (driver communicated, contested, enrolled, a 126-bis fine linked through origin_fine_id) and bank transactions with the fine number pay it. Cancellations, new amounts and uncertain matches are left as suggestions for a person to confirm in Nucleo.
Add a relationship type to a company
curl -X POST https://mcp.nucleoplatform.com \
  -H "Authorization: Bearer $NUCLEO_ACCESS_TOKEN" \
  -H "Content-Type: application/json" \
  -H "Accept: application/json, text/event-stream" \
  -d '{
    "jsonrpc": "2.0", "id": 2, "method": "tools/call",
    "params": {
      "name": "brain_update_record",
      "arguments": {"type": "companies", "id": 1520, "fields": {"relationship_type_ids_add": [4]}}
    }
  }'

Every change made through these tools runs with the same validation and automations as the Nucleo interface, and is written in the record's timeline with who made it, when, and the values before and after.

Permissions and writes

  • The assistant can do only what the person can do in Nucleo, in the active company.
  • Commerce and Intelligence tools are read-only. Brain and Catalog have write tools, marked as such in the tool list.
  • Catalog applies only small, reversible changes from an AI client: at most 3 writes or 5 products within 10 minutes, per person and catalog. Larger ones — bulk changes, publishing, imports, deletions, whole-object replacements (every PUT through catalog_catalog_api, such as prices, stock, translations, categories or variants) and anything beyond that limit — come back as a preview and the person confirms them inside Nucleo. The one exception is catalog_forget_memory, which deletes a memory entry at once and is marked destructive.
  • Catalog writes are not idempotent: calling catalog_create_product again creates a second product. From the connector, Catalog always works on the first ready catalog of the company that the person belongs to.
  • Tokens issued to AI clients work only on the AI tools, userinfo, the AI company context (GET /api/mcp/context, PUT /api/mcp/company on auth.nucleoplatform.com) and token revocation: they cannot call any other Nucleo API.
  • Removing the connector in the AI client does not revoke anything in Nucleo: the refresh token stays valid for 30 days. To revoke access, the client calls POST https://auth.nucleoplatform.com/api/auth/revoke with its current access token: that token and its refresh token stop working at once.