Configuring AI Agent Ecosystem with MCP and Cursor
Overview
This guide describes how to install, configure and connect an AI agent ecosystem built from the InfoConnect MCP server, Cursor and Slack. Slack is connected through n8n workflows.
MCP (Model Context Protocol) is a standard that lets AI systems communicate with external tools, APIs and enterprise data sources. It acts as a bridge between the language model and your business systems (for example Salesforce or IBM i). Through it, the AI agent can run real actions, retrieve live data and keep data consistent across environments.
The flow works as follows:
- A user sends a message in a chat.
- The AI agent interprets the intent, and MCP translates it into structured tool calls.
- The tools run the actions, for example retrieving order data, updating a customer record or running a process on IBM i. They are the "hands" of the AI agent.
- MCP returns the results to the chat (for example the built-in chat of Cursor), where the AI presents them as a natural-language response.
This guide shows how to:
- Deploy and authenticate the MCP server.
- Connect it to Cursor for local AI assistance.
- Browse and test the generated MCP tools with MCP Explorer.
- Set up Slack communication through n8n automation.
- Optionally extend the knowledge of the AI agent with a RAG (Retrieval-Augmented Generation) subsystem.
Quickstart
- Start the Hub with
start-scripts/infoconnect-hub.sh(Windows:infoconnect-hub.bat). - Create a Program Call, a Data API and/or an RPA Call.
- Open your AI agent with MCP support (Cursor, Claude, and others).
- Open the MCP settings.
-
Add a custom MCP server with the following configuration:
{ "mcpServers": { "InfoConnect-AI": { "type": "streamable-http", "url": "http://localhost:8083/api/mcp", "headers": { "Authorization": "Basic <base64 of user:password>" } } } }The distribution runs the MCP server with
mcp.auth.type=basic. Use the MCP user (mcpUser/mcpUserPasswordin the MCP configuration,mcp/mcpby default; change them) or the credentials of a Hub user. See MCP authentication. -
Load the tools: in the Hub UI, open APIs > MCP Tools and click Reload Tools. In the distribution, the MCP server does not load tools automatically, see Tool initialization and reload configuration.
- Add the example system prompt and start asking questions.
MCP authentication
Set the authentication of the MCP server with mcp.auth.type in the application.properties file of the MCP module:
| Value | Description |
|---|---|
none |
No authentication. This is the built-in default. |
basic |
Basic authentication. The MCP server accepts the MCP user (mcpUser / mcpUserPassword) and the credentials of Hub users, which it checks against the Hub. This is the value in the distribution. |
oauth |
Bearer tokens from an OAuth provider. To call /api/mcp, the token must contain the role mcp_user. See OAuth configuration. |
spring-oauth-server |
The MCP server issues its own tokens. GET /auth returns a token for the client set in mcp.registration.client-id / mcp.registration.client-secret. |
Cursor and MCP installation steps
- Download the Cursor AI agent.
- Start the Hub with
start-scripts/infoconnect-hub.sh(Windows:infoconnect-hub.bat). - Prepare the credentials for the MCP server. With
mcp.auth.type=basic(the distribution default), useAuthorization: Basic <base64 of user:password>. Withmcp.auth.type=spring-oauth-server, sendGEThttp://localhost:8083/auth; the response contains a Bearer token. -
In Cursor, open Settings.

-
Select MCP & Tools > Add Custom MCP. Cursor opens the
mcp.jsonconfiguration file.
-
Paste the following configuration and replace
<your-token>with the token from step 3: -
Turn the server on with the toggle on the right side of the server entry.

-
Check that the server icon is green. Cursor now lists the tools generated from your Program Calls, Data APIs and RPA Calls.
-
Optional: add a system prompt with your own rules for the AI chat. Select Settings > Rules, Memories, Commands > Add Rule and enter the prompt.
The example system prompt coordinates two systems: Salesforce and IBM i.

Tool initialization and reload configuration
The MCP server loads tools from the Hub (Program Calls and Data APIs) and from RPA Hub (RPA Calls). The properties in this section control when and how often the tools are loaded and whether mock tools are used for testing or as a fallback.
Configure these properties in the application.properties file of the MCP module.
Note
The configuration in the distribution turns off automatic loading: all tools.*.init.on.start and tools.*.scheduler.enabled properties are false, and mock tools are loaded (tools.mocks.load.on.start=true). Load the tools with Reload Tools on the MCP Tools page, or set the properties to true. RPA Call tools are not loaded automatically even with the built-in defaults.
Tool initialization on application start
| Property | Value | Description |
|---|---|---|
tools.program.call.init.on.start |
true/false |
Enables or disables loading Program Call tools from the Hub at application startup. Even if false, tools may still be loaded later if the scheduler is enabled. To fully disable Program Call tools, set false and disable the corresponding scheduler. |
tools.data.api.init.on.start |
true/false |
Enables or disables loading Data API tools from the Hub at application startup. Works the same way as Program Call tools. |
tools.rpa.call.init.on.start |
true/false |
Enables or disables loading RPA Call tools from RPA Hub at application startup. Works the same way as Hub tools. |
Tool reload scheduler
| Property | Value | Description |
|---|---|---|
tools.program.call.scheduler.enabled |
true/false |
Enables or disables automatic reloads of Program Call tools from the Hub at regular intervals. |
tools.data.api.scheduler.enabled |
true/false |
Enables or disables automatic reloads of Data API tools from the Hub at regular intervals. |
tools.rpa.call.scheduler.enabled |
true/false |
Enables or disables automatic reloads of RPA Call tools from RPA Hub at regular intervals. |
tools.scheduler.reload.timer.seconds |
number (seconds) | Interval at which the scheduler reloads the tools. |
tools.scheduler.full.logging |
true/false |
Enables verbose logging for tool reload operations. |
Mock tools and schema logging
| Property | Value | Description |
|---|---|---|
tools.mocks.load.on.start |
true/false |
If true, mocked tools are loaded automatically at application startup. |
tools.mocks.keep.alive |
true/false |
If false, mocked tools are removed automatically after a successful reload from the Hub. |
tools.mocks.execute.enabled |
true/false |
If true, the execute function for tools is mocked. |
tools.mocks.endpoint.enabled |
true/false |
Enables or disables the endpoint that calls the mocked execute method for tools. |
tools.input.schema.logging |
true/false |
If false, generated input schemas are not printed in logs. Useful when schemas are very large. |
MCP Explorer
MCP Explorer lets you browse, inspect and invoke the MCP tools generated from Hub Program Calls, Data APIs and RPA Calls without connecting an external AI client.
Using MCP Explorer in the Hub UI
-
Open the InfoConnect Hub UI, go to APIs and click MCP Tools. The MCP Tools page lists all registered MCP tools with their name and description.

-
Select Reload Tools to refresh the tools from the Hub and RPA Hub and to reload the explorer client.
-
Select Invoke Tool on a row to open the tool input form, which is generated from the tool input schema. Enter the arguments and click Invoke. The result opens in an Output dialog.

You can also open the MCP tool details from the edit page of a Program Call, Data API or RPA Call. Select Show MCP tool details.
MCP Explorer configuration
Configure these properties in the application.properties file of the MCP module:
| Property | Value | Description |
|---|---|---|
mcp.explorer.enabled |
true/false |
Enables or disables the MCP Explorer REST API. Defaults to true. |
mcp.explorer.base-url |
URL | Base URL of the MCP server (no trailing slash). Default: http://127.0.0.1:8083. |
mcp.explorer.endpoint |
path | Streamable HTTP MCP endpoint path. Default: /api/mcp. |
mcp.explorer.request-timeout-seconds |
number (seconds) | Timeout for explorer requests against the MCP endpoint. Default: 60. |
mcp.explorer.use-basic-auth-for-mcp-endpoint |
true/false |
When true and mcp.auth.type=basic, the explorer client sends HTTP Basic authentication to the MCP endpoint. Default: true. |
The Hub UI proxies explorer requests to the MCP module. Configure the MCP host and port in the UI module:
| Property | Value | Description |
|---|---|---|
infoconnect.mcp.host |
host | MCP module host used by the UI explorer proxy. |
infoconnect.mcp.port |
port | MCP module port used by the UI explorer proxy. |
infoconnect.mcp.secure |
true/false |
Use HTTPS for the MCP module. Default: false. |
mcp.auth.type |
basic/none |
When basic, the UI sends mcpUser / mcpUserPassword to the MCP module. Must match the MCP module. |
mcpUser, mcpUserPassword |
text | MCP credentials used by the UI when mcp.auth.type=basic. Default: mcp / mcp. |
Explorer REST endpoints
When MCP Explorer is enabled, the MCP module provides the following endpoints:
| Method | Endpoint | Description |
|---|---|---|
| GET | /explorer/tools |
List registered MCP tools (name and description). |
| GET | /explorer/tools/{toolName} |
Get tool details, including input and output schemas. |
| POST | /explorer/tools/{toolName}/invoke |
Invoke a tool. Request body: { "arguments": { ... } }. |
| POST | /explorer/refresh |
Refresh the explorer MCP client connection. |
Example invoke request body:
Slack integration through n8n
This section describes how to install, configure and test an AI agent that is connected to the MCP server and to Slack through n8n.
System components
- n8n: automation platform that orchestrates the workflow between Slack, MCP and the AI agent.
- Slack: the interface users use to talk to the AI agent.
- AI model API (for example Google Gemini): the LLM (large language model) that interprets natural language.
The AI agent connects user input in Slack with the enterprise data managed through MCP.
Prerequisites
- A Slack workspace and permission to create and install an app (the free version of Slack is sufficient).
- A cloud-hosted n8n instance with an HTTPS endpoint.
- A deployed MCP server that is reachable through a public or internal network (not
localhost). - An API key for your AI model (for example a Gemini API key).
Note
Cloud-hosted n8n ensures stable communication with Slack and avoids the limitations of a local n8n instance.
System architecture
Each message from Slack triggers a workflow in n8n. In the workflow, the AI agent processes the query and retrieves or changes data through MCP. The data flows as follows:
- User to Slack
- Slack to the n8n Slack webhook
- n8n to the AI agent
- AI agent to and from the MCP server
Configuring n8n
- Open the n8n dashboard.
- Create a new workflow.
- Add a Slack Trigger node and configure the webhook URL from Slack.
-
Configure the Slack Trigger node:
- Set Trigger On to "Bot mention".
- Choose a channel or chat to monitor.
- Test the trigger to confirm that message events are received.
-
Add an AI Agent node and configure it:
- Connect an LLM Model node (for example Google Gemini) and enter your API key.
- Add a System Prompt that defines the behavior and context of the assistant, for example "You are an enterprise assistant that interacts with MCP APIs". You can also use the example system prompt.
- Attach MCP as a Tool and provide the endpoint URL and the Bearer token for authentication.
-
Add a Slack Send Message node to return the response of the AI agent to the chat.
This configuration enables two-way communication: Slack delivers messages to the AI agent, which answers in context through n8n.
After the configuration, your workflow looks like this:

Setting up Slack
- Open https://api.slack.com/apps and create a new Slack app.
-
Under Event Subscriptions, set the Request URL to your n8n webhook, for example
https://your-n8n-instance/webhook/slack. -
Under Bot Token Scopes, enable the following scopes:
chat:writecommandsapp_mentions:readchannels:readchannels:history
-
Copy the Bot User OAuth Token from the OAuth & Permissions page.
- Install the app in your Slack workspace.
- Add the installed app to the chat in which users interact with the bot.
Note
Your webhook endpoint must be publicly accessible and must respond with HTTP 200 to the verification request from Slack.
Testing the integration
- In Slack, send
/<bot-name> Hello, show me the status of customer orders. -
Verify that the flow works as follows:
- The Slack command triggers the n8n workflow.
- n8n sends the message content to the AI Agent node.
- The AI agent uses MCP to retrieve data and generate a structured response.
- The reply appears in Slack.
A successful test confirms end-to-end communication between Slack, n8n, MCP and the AI model.
Extending the AI agent with RAG
RAG (Retrieval-Augmented Generation) lets the AI agent retrieve relevant context from a vector store before it generates a response. The vector store holds the documents and internal data of your organization. As a result, the answers are more accurate and specific to your business, because the agent can use company documentation, policies and data in its reasoning.
The following workflow reads a Google Drive folder and adds new documents on creation or updates existing documents on change:

Installing the vector store
- Add a Vector Store Tool (for example Supabase) to your AI Agent node.
-
Configure the vector store:
- Create a table for storing document embeddings.
- Add an embedding model. Use the same model as your AI agent.
The AI agent can now retrieve relevant context from the vector store and give domain-specific answers.
Loading documents into the vector store
- Create an n8n workflow that listens to a Google Drive folder.
- On document creation or update, extract the text and push the embeddings to the vector store.
Warning
Always use the same embedding model across all workflows. Mismatched embedding models degrade retrieval accuracy.
Example system prompt
The following prompt coordinates two backend systems, Salesforce and IBM i, through their MCP interfaces. Adapt the system names and rules to your environment.
You are an intelligent, multilingual assistant that helps business users interact with enterprise systems using natural language. You operate primarily in Microsoft Teams via Copilot or other chat interfaces.
**Backend System Access**
You have access to two backend systems through MCP interfaces:
**MCP_Salesforce** – for CRM-related data and actions (e.g., Sales Orders, Opportunities, Accounts, Contacts).
**MCP_AS400** – for ERP-related data and actions (e.g., Sales Orders, Order Status, Inventory).
**Core Responsibilities**
**1. Understand User Intent in Any Language**
Interpret user input in natural language — English, Russian, Spanish, or others.
**2. Select the Appropriate Backend System(s)**
Use **Salesforce** for CRM-related tasks (e.g., retrieving or updating sales orders, opportunities, or account data).
Use **AS/400** for ERP-related tasks (e.g., creating sales orders, checking shipment status, viewing inventory).
**3. Resolve Customer Identifiers Before Calling AS/400**
**Never** pass customer names directly to AS/400 APIs.
If a task involves AS/400 and references a **customer name** (e.g., *"Burlington Textiles Corp of America"*):
1. Query **Salesforce** to locate the corresponding **Account** by name.
2. Retrieve the internal **Customer ID** for that account from Salesforce.
3. Use that **Customer ID** in all AS/400 API calls (e.g., retrieving or creating orders).
**Special Case – Retrieving Orders for a Named Customer**
For user queries such as:
“Get me all orders for Burlington Textiles Corp of America”
The assistant should:
1. **Query Salesforce** to retrieve all **Sales Orders** where the Account is “Burlington Textiles Corp of America”.
Do not return Opportunities — only actual Sales Orders from Salesforce.
2. **Query Salesforce again** to retrieve the **Customer ID** for that Account.
3. Use the **Customer ID** to call the appropriate **AS/400 API**, retrieving additional **ERP orders** for that same customer.
4. Present **both Salesforce and AS/400 orders**, clearly labeled, in a clean table format.
5. Ensure no account-level data (e.g., billing info) is passed to AS/400, unless explicitly requested.
**4. Coordinate Multi-System Workflows with Correct Sequencing**
For multi-step tasks (e.g.,
“Close this opportunity as Won and create a sales order”):
1. Update the opportunity in **Salesforce** (e.g., set stage to *Closed Won*).
2. Retrieve relevant opportunity details (e.g., products, amount, opportunity ID).
3. Use those details to **create a sales order in AS/400** — without including account-level data unless explicitly required.
4. Confirm success to the user in business-friendly language, for example:
Opportunity successfully marked as Closed-Won in Salesforce. A new Sales Order #12345 has been created in the ERP.
**5. Use MCP Interfaces Appropriately**
Use provided MCP APIs to retrieve or update data in the respective backend system.
**6. Respond Clearly and Professionally in the User's Language**
Always respond in the **same language** as the user.
Provide clear, concise, and business-appropriate summaries of actions taken or data retrieved.
**7. Present Data in Structured Tables Whenever Appropriate**
When returning lists (e.g., sales orders, inventory, products):
Present the data in a **structured, easy-to-read table**.
Include only relevant fields (e.g., Order Number, Status, Date, Amount).
Format dates, currencies, and numbers according to the user’s **locale and language**.
**8. Handle Missing APIs Gracefully**
If a required MCP API is missing or unavailable:
Inform the user politely and clearly.
Suggest next steps or alternatives where possible.
**Special Case – Updating Order Status**
For user queries such as:
“Change order status for order 114 to Shipped”
The assistant should:
1. **Use AS/400 only** to update the order status.
2. **Do not attempt to look up the order in Salesforce.**
3. Use the provided order number directly in the AS/400 MCP API.
4. Confirm success or failure to the user in clear, business-friendly language:
*Order #114 status has been successfully updated to "Shipped" in the ERP system.*
5. If the AS/400 API for updating order status is unavailable, inform the user politely and suggest an alternative
6. Retrieve key details from the opportunity (products, amount, ID, etc.).
7. Use that data to **create a new Sales Order in AS/400**.
Do **not** send account-level data unless explicitly requested
Confirm to the user with a business-friendly summary:
Opportunity successfully marked as Closed-Won in Salesforce. A new Sales Order #12345 has been created in the ERP system.
**7. Updating Order Status (AS/400 Only)**
For queries like:
“Change order status for order 114 to Shipped”
Only:
Use **AS/400 API** directly with the **order number**.
Do **not** look up the order in Salesforce.
Confirm success in clear business terms:
Order #114 status has been successfully updated to “Shipped” in the ERP system.
If the API is unavailable, inform the user politely and suggest alternatives.
**Error Handling**
**8. Missing API or Unsupported Actions**
If an MCP API is unavailable or the requested action is unsupported:
Respond politely.
Offer alternatives or next steps if possible.
**Data Presentation**
**9. Structured Tables for Lists**
Always format responses with multiple items (orders, inventory, products) in clean, structured tables.
Include only **relevant fields**.
Respect the **user’s locale** for: Dates, Currency, Numbers