# The MCP import in coreAI is a client integration, not a bulk import

The MCP import in coreAI is a client integration: coreAI acts as a client against an MCP server you already have, reads which tools the server offers, and lets the assistant call them on demand during chat. It is not a job that copies answer data into the knowledge base, and you do not need to synchronize anything in advance for it to work.

## Discovery fetches tool schemas, not answers

When the import runs, coreAI connects to each MCP server you have configured and calls `tools/list`. The result is the tool schemas – names, parameters, descriptions, and the input each tool expects. The schemas are stored as JSON configuration tied to the assistant. No user data, order data, or product data is fetched or indexed.

The import runs automatically on an interval you choose, so the schema in the MCP server is always up to date. Between runs, the assistant has a stable picture of what the server can do and does not need to look up tools against the server every time it uses one in a conversation.

## How the assistant picks the right tool in real time

The moment a conversation starts, the tool schemas are exposed to the assistant as available functions. When the user asks a question, the assistant evaluates whether any part of it requires fresh or user-scoped data. If the answer is yes, the assistant picks the right tool, fills in the parameters from the conversation context, and coreAI calls your MCP server via `tools/call`.

The result from the server is fed back into the conversation as the basis for the answer. This happens per question, not per conversation – the assistant can call one tool in one message, a completely different one in the next, and skip MCP altogether when a question can be answered from the knowledge base alone.

## User context can be forwarded to the MCP server

For logged-in users, the widget can pass a user token that coreAI forwards on every tool call as the `X-User-Token` header. Your MCP server can then identify the user and scope the answer to their data: their orders, their cases, their bookings, their CRM thread.

The token is an opaque value that you control both the issuance and validation of. coreAI does not interpret it – it is carried unchanged from widget to MCP server, and the assistant never sees the contents itself. That means your authorization model stays intact: a user cannot ask their way to another user's data by phrasing the chat cleverly, because the MCP server decides what the token grants access to before it answers.

## When MCP is better than upserting data via the API

Choose MCP when the data has to be fresh at the moment the question is asked, or when the answer depends on who is asking:

- live stock levels and prices that change from hour to hour
- order status, shipping information, and case handling per logged-in user
- CRM lookups and internal customer registers where the answer must reflect last-minute changes
- bookings and available time slots where an indexed snapshot quickly goes stale

Choose upsert via the [coreAI API](https://coreai.no/en/articles/api-data-integration) when the data is relatively stable and should be searchable in the knowledge base – product catalogs, knowledge articles, documents, job postings. The rule of thumb is simple: anything that requires a live lookup against another system belongs behind MCP, anything that can sit in a knowledge base for hours or days belongs in the upsert lane.

## MCP and the knowledge base complement each other

The two mechanisms do not compete. A typical production setup has the knowledge base full of indexed product information, knowledge articles, and documents, and at the same time one or more MCP servers covering the live layer the knowledge base cannot: checking that an item really is in stock right now, fetching the status of the order the user is referring to, or looking up the open case in the CRM. The assistant chooses the source per question – and the user gets answers from the layer that has the most accurate data at that moment.