Contents

Context

Served by Nucleo Core (auth.nucleoplatform.com): which companies the person can work in, which modules each company exposes to AI clients and their API hosts, and the active company.

Base URL, authentication and conventions of this API are on the AI Tools API page.

get/api/mcp/context

Get companies, modules and active company

Requires the nucleo.ai_tools scope.

The companies of the signed-in person in canonical order, with the modules each one can reach through AI clients (connector_enabled) and the base URL of each module's API, plus the active company used by the MCP connector.

active_company_source tells how it was chosen: claim (the org_id hint you passed, or else the company of the access token, set with org_id on /oauth/authorize or later with nucleo_switch_company through that token), only (the person has one company), preference (saved with PUT /api/mcp/company or the connector tool nucleo_switch_company), default (first company).

A module with connector_enabled: false has been switched off for AI clients by that company (or has no tools API): do not call it. The connector does not offer its tools, and the module itself refuses AI clients' calls to its AI tools in that company with 403 ai_connector_disabled (the same switches are in the userinfo claim ai_connector_disabled).

Companies are identified by public_id (a UUID): use it everywhere. id and active_company_id are the numeric ids, deprecated and kept only for compatibility.

GET https://auth.nucleoplatform.com/api/mcp/context
Authentication: OAuth 2.0 access token

Query parameters

  • org_idstring (uuid) | integer

    Preferred company: its public id, or its numeric id (deprecated, still accepted). Used as active company only if the person belongs to it.

    Example: 0199e5c2-7a1b-7c3d-8e4f-a1b2c3d4e5f6

Responses

  • 200Context.
    • userobject
      Child attributes
      • idinteger
      • namestring
      • emailstring (email)
      • languagestring
        One ofenit
      • is_internalboolean
    • companiesarray of object
      Attributes of each item
      • public_idstring (uuid) | null

        Public id of the company

      • idintegerdeprecated

        Numeric company id (deprecated): use public_id.

      • slugstring
      • namestring
      • is_internalboolean
      • is_demoboolean
      • disabled_sectionsarray of string
      • modulesarray of object
        Attributes of each item
        • slugstring
          One ofbraincatalogcommerceintelligence
        • namestring
        • rolestring
        • api_base_urlstring (uri) | null
        • connector_enabledboolean
    • active_company_public_idstring (uuid) | null

      Public id of the active company.

    • active_company_idinteger | nulldeprecated

      Numeric id of the active company (deprecated): use active_company_public_id.

    • active_company_sourcestring | null
      One ofclaimonlypreferencedefaultnull
  • 401Missing, expired or revoked token — or a token that is not from a self-registered client. Body: {"message":"Unauthenticated."}; Intelligence answers with application/problem+json.
    • messagestring
Request
curl -X GET 'https://auth.nucleoplatform.com/api/mcp/context?org_id=0199e5c2-7a1b-7c3d-8e4f-a1b2c3d4e5f6' \
  -H "Authorization: Bearer $NUCLEO_ACCESS_TOKEN" \
  -H 'Accept: application/json'
Response
{
  "user": {
    "id": 42,
    "name": "Giulia Rossi",
    "email": "giulia.rossi@acme.example",
    "language": "it",
    "is_internal": false
  },
  "companies": [
    {
      "id": 7,
      "public_id": "0199e5c2-7a1b-7c3d-8e4f-a1b2c3d4e5f6",
      "slug": "acme",
      "name": "Acme Apparel",
      "is_internal": false,
      "is_demo": false,
      "disabled_sections": [
        "pos"
      ],
      "modules": [
        {
          "slug": "catalog",
          "name": "Catalog",
          "role": "editor",
          "api_base_url": "https://api-catalog.nucleoplatform.com",
          "connector_enabled": true
        },
        {
          "slug": "commerce",
          "name": "Commerce",
          "role": "viewer",
          "api_base_url": "https://api-commerce.nucleoplatform.com",
          "connector_enabled": true
        },
        {
          "slug": "intelligence",
          "name": "Intelligence",
          "role": "viewer",
          "api_base_url": "https://api-intelligence.nucleoplatform.com",
          "connector_enabled": false
        }
      ]
    }
  ],
  "active_company_id": 7,
  "active_company_public_id": "0199e5c2-7a1b-7c3d-8e4f-a1b2c3d4e5f6",
  "active_company_source": "only"
}
put/api/mcp/company

Set the active company

Requires the nucleo.ai_tools scope.

Saves the active company of the person for AI clients (one value per person, shared by every AI client they connect, including the MCP connector) and returns the updated context.

PUT https://auth.nucleoplatform.com/api/mcp/company
Authentication: OAuth 2.0 access token

Request bodyapplication/json

  • organization_idstring (uuid) | integerrequired

    The company's public id (companies[].public_id), or its numeric id (companies[].id, deprecated, still accepted). A public id that does not exist gets 403 company_forbidden, like a company the person has no access to.

Responses

  • 200Updated context (same shape as GET /api/mcp/context).
    • userobject
      Child attributes
      • idinteger
      • namestring
      • emailstring (email)
      • languagestring
        One ofenit
      • is_internalboolean
    • companiesarray of object
      Attributes of each item
      • public_idstring (uuid) | null

        Public id of the company

      • idintegerdeprecated

        Numeric company id (deprecated): use public_id.

      • slugstring
      • namestring
      • is_internalboolean
      • is_demoboolean
      • disabled_sectionsarray of string
      • modulesarray of object
        Attributes of each item
        • slugstring
          One ofbraincatalogcommerceintelligence
        • namestring
        • rolestring
        • api_base_urlstring (uri) | null
        • connector_enabledboolean
    • active_company_public_idstring (uuid) | null

      Public id of the active company.

    • active_company_idinteger | nulldeprecated

      Numeric id of the active company (deprecated): use active_company_public_id.

    • active_company_sourcestring | null
      One ofclaimonlypreferencedefaultnull
  • 401Missing, expired or revoked token — or a token that is not from a self-registered client. Body: {"message":"Unauthenticated."}; Intelligence answers with application/problem+json.
    • messagestring
  • 403The person has no access to that company.
    • errorstring
      One ofcompany_requiredcompany_forbiddencompany_not_readyai_connector_disabledunsupported_versionunknown_toolpermission_deniedinvalid_arguments
    • messagestringrequired

      In the language of X-Nucleo-Language where translated.

    • permissionstring

      permission_denied only.

    • supportedarray of integer

      unsupported_version only.

    • errorsobject

      invalid_arguments on Commerce and Intelligence (standard validation shape).

    • detailsarray of object

      invalid_arguments on Brain and Catalog.

      Attributes of each item
      • fieldstring
      • errorstring
  • 422Validation failed.
    • messagestring
    • errorsobject
Request
curl -X PUT https://auth.nucleoplatform.com/api/mcp/company \
  -H "Authorization: Bearer $NUCLEO_ACCESS_TOKEN" \
  -H 'Content-Type: application/json' \
  -d '{
  "organization_id": "0199e5c2-7a1b-7c3d-8e4f-a1b2c3d4e5f6"
}'
Response
{
  "user": {
    "id": 1,
    "name": "string",
    "email": "jane@example.com",
    "language": "en",
    "is_internal": true
  },
  "companies": [
    {
      "public_id": "9b2f4c1e-5d7a-4e8b-9c3d-2a1f0e6b7c8d",
      "id": 1,
      "slug": "string",
      "name": "string",
      "is_internal": true,
      "is_demo": true,
      "disabled_sections": [
        "string"
      ],
      "modules": [
        {
          "slug": "brain",
          "name": "string",
          "role": "string",
          "api_base_url": "https://shop.acme.example",
          "connector_enabled": true
        }
      ]
    }
  ],
  "active_company_public_id": "9b2f4c1e-5d7a-4e8b-9c3d-2a1f0e6b7c8d",
  "active_company_id": 1,
  "active_company_source": "claim"
}