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.
/api/mcp/contextGet companies, modules and active company
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 org_id of the access token, set with org_id on /oauth/authorize),
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).
Query parameters
org_idintegerPreferred company id; used as active company only if the person belongs to it.
Example:7
Responses
200Context.application/json
userobjectChild attributes
idintegernamestringemailstring (email)languagestringOne ofenitis_internalboolean
companiesarray of objectAttributes of each item
idintegerslugstringnamestringis_internalbooleanis_demobooleandisabled_sectionsarray of stringmodulesarray of objectAttributes of each item
slugstringOne ofbraincatalogcommerceintelligencenamestringrolestringapi_base_urlstring (uri) | nullconnector_enabledboolean
active_company_idinteger | nullactive_company_sourcestring | nullOne ofclaimonlypreferencedefaultnull
401Missing, expired or revoked token — or a token that is not from a self-registered client. Body:
{"message":"Unauthenticated."}; Intelligence answers withapplication/problem+json. application/jsonmessagestring
curl -X GET 'https://auth.nucleoplatform.com/api/mcp/context?org_id=7' \
-H "Authorization: Bearer $NUCLEO_ACCESS_TOKEN" \
-H 'Accept: application/json'const res = await fetch("https://auth.nucleoplatform.com/api/mcp/context?org_id=7", {
method: "GET",
headers: {
Authorization: `Bearer ${process.env.NUCLEO_ACCESS_TOKEN}`,
Accept: "application/json",
},
});
const data = await res.json();
console.log(res.status, data);<?php
require 'vendor/autoload.php';
$client = new GuzzleHttp\Client();
$response = $client->request('GET', 'https://auth.nucleoplatform.com/api/mcp/context?org_id=7', [
'headers' => [
'Authorization' => 'Bearer ' . getenv('NUCLEO_ACCESS_TOKEN'),
'Accept' => 'application/json',
],
'http_errors' => false,
]);
echo $response->getStatusCode(), PHP_EOL;
echo $response->getBody();{
"user": {
"id": 42,
"name": "Giulia Rossi",
"email": "giulia.rossi@acme.example",
"language": "it",
"is_internal": false
},
"companies": [
{
"id": 7,
"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_source": "only"
}{
"message": "Unauthenticated."
}/api/mcp/companySet the active company
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.
Request bodyapplication/json
organization_idintegerrequiredCompany id from
companies[].id.
Responses
200Updated context (same shape as
GET /api/mcp/context).application/jsonuserobjectChild attributes
idintegernamestringemailstring (email)languagestringOne ofenitis_internalboolean
companiesarray of objectAttributes of each item
idintegerslugstringnamestringis_internalbooleanis_demobooleandisabled_sectionsarray of stringmodulesarray of objectAttributes of each item
slugstringOne ofbraincatalogcommerceintelligencenamestringrolestringapi_base_urlstring (uri) | nullconnector_enabledboolean
active_company_idinteger | nullactive_company_sourcestring | nullOne ofclaimonlypreferencedefaultnull
401Missing, expired or revoked token — or a token that is not from a self-registered client. Body:
{"message":"Unauthenticated."}; Intelligence answers withapplication/problem+json. application/jsonmessagestring
403The person has no access to that company.application/json
errorstringOne ofcompany_requiredcompany_forbiddencompany_not_readyai_connector_disabledunsupported_versionunknown_toolpermission_deniedinvalid_argumentsmessagestringrequiredIn the language of
X-Nucleo-Languagewhere translated.permissionstringpermission_deniedonly.supportedarray of integerunsupported_versiononly.errorsobjectinvalid_argumentson Commerce and Intelligence (standard validation shape).detailsarray of objectinvalid_argumentson Brain and Catalog.Attributes of each item
fieldstringerrorstring
422Validation failed.application/json
messagestringerrorsobject
curl -X PUT https://auth.nucleoplatform.com/api/mcp/company \
-H "Authorization: Bearer $NUCLEO_ACCESS_TOKEN" \
-H 'Content-Type: application/json' \
-d '{
"organization_id": 7
}'const res = await fetch("https://auth.nucleoplatform.com/api/mcp/company", {
method: "PUT",
headers: {
Authorization: `Bearer ${process.env.NUCLEO_ACCESS_TOKEN}`,
"Content-Type": "application/json",
},
body: JSON.stringify({
"organization_id": 7
}),
});
const data = await res.json();
console.log(res.status, data);<?php
require 'vendor/autoload.php';
$client = new GuzzleHttp\Client();
$response = $client->request('PUT', 'https://auth.nucleoplatform.com/api/mcp/company', [
'headers' => [
'Authorization' => 'Bearer ' . getenv('NUCLEO_ACCESS_TOKEN'),
],
'json' => [
'organization_id' => 7,
],
'http_errors' => false,
]);
echo $response->getStatusCode(), PHP_EOL;
echo $response->getBody();{
"user": {
"id": 1,
"name": "string",
"email": "jane@example.com",
"language": "en",
"is_internal": true
},
"companies": [
{
"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_id": 1,
"active_company_source": "claim"
}{
"message": "Unauthenticated."
}{
"error": "company_forbidden",
"message": "You have no access to this company."
}{
"message": "The organization id field is required.",
"errors": {
"organization_id": [
"The organization id field is required."
]
}
}