Calling Scenario Sections from AI Assistants (MCP)
MCP (Model Context Protocol) lets you connect an AI assistant (e.g. Cursor, Claude) to ConnectiveOne so it can call parts of your scenario as tools. Instead of writing code in an external system, you define the logic in the scenario, and the AI assistant simply calls the right section and gets the result.
Why Use This?
Often you need the AI assistant in a code editor or chat to:
- get up-to-date data (exchange rates, stock levels, catalog);
- run actions within your business logic (search, validation, calculation);
- avoid duplicating that logic in code and reuse the bot scenario you already configured.
MCP scenario tools do exactly that: a scenario section becomes a “tool” the AI assistant calls by name and receives a structured result.
How It Works
- In the scenario you choose a section that does one clear task (e.g. “get exchange rates” or “check product availability”). On the section’s entry point you set the MCP Tool trigger type.
- In the trigger settings you define:
- Input Schema — which parameters the tool accepts (names, types);
- Return Schema — a description of the tool for the AI and the list of keys to return from the section.
- The platform exposes that section as an MCP tool: the AI client gets the list of tools for the bot and can call them, passing arguments. Execution runs on ConnectiveOne and the result is returned to the AI assistant.
So the logic stays in the scenario (messages, actions, conditions, API calls), and the AI only calls the “tool” and gets the response.
When MCP Scenario Tools Make Sense
- You want the AI assistant (Cursor, Claude, etc.) to get data from ConnectiveOne or run actions via an existing scenario.
- You have logic in the scenario (calculations, external services, checks) and want to avoid duplicating it in code.
- You want the same logic for both the bot (for users) and the AI assistant (for developers or analysts).
What You Need to Do
- In the Scenario Constructor create or select a section, set the MCP Tool trigger on it, and fill in the Input Schema and Return Schema.
- In the section at the end of the logic write the result to a special constant so the platform can return it in the MCP response (configured via actions in the scenario).
- In the AI client (e.g. Cursor) add the platform’s MCP server. Connection can be done in two ways: with authorization via headers (access token and bot ID) — recommended; or via a URL with a token (no headers) — only if the client cannot send headers and you accept the risks (the URL with the token may end up in logs; the token is long-lived). For setup steps see How to connect an AI assistant to a scenario via MCP.
Summary: MCP scenario tools make parts of your scenario available to AI assistants as callable tools, without duplicating logic in external systems.