For the complete documentation index, see llms.txt. This page is also available as Markdown.

Create MCP Tools

This guide walks you through creating a new MCP tool on the platform.

What Is MCP?

MCP, short for Model Context Protocol, can integrate services across multiple cloud platforms or run local client applications.

Think of tool use as a plug: you need to plug it in and supply power before you can use a service. Traditionally, each LLM develops its own approach to using tools. Like plugs with different specifications, these approaches require different sockets. To let both OpenAI and Claude use Google Calendar, developers need to create multiple scripts for different AI systems.

When Google Calendar updates, developers may need to:

  1. Update 3 different versions of the integration at the same time

  2. Maintain 3 separate sets of technical documentation

This increases development time and costs.

The MCP Solution

MCP is a standardized protocol designed to solve this problem. It simplifies development through:

  1. A standardized format for tool definitions

  2. A unified communication protocol

  3. Consistent error handling

These mechanisms streamline the development process.

With MCP, developing a tool only requires the following:

  1. Create an MCP Server (develop once)

  2. Define standardized tool specifications

  3. Implement unified business logic

  4. Make it available to all AI platforms that support MCP

Comparison before and after MCP integration

MCP is fundamentally a protocol designed to standardize AI tool integration. It enables development teams to “develop once, use everywhere,” significantly reducing the complexity and maintenance costs of the AI assistant tool ecosystem.

Quickly Create an MCP Tool

1. Open the Tool Management Interface

First, open the “ AI Features” section in the left navigation bar, then click “🔧 Tools.” On the tool list page, click the “➕ Add Tool” button in the upper-right corner.

Tool list page and Add button
Click “➕ Add Tool” to get started

2. Select the Tool Type

Select MCP as the tool type.

3. Set the Display Name

Give the tool a clear display name. In this example, use Composio mcp for google calendar.

  • Purpose: This name appears in the platform interface for all users to see.

  • Recommendation: Choose a name that clearly describes the tool's main function so users can understand it easily. There are no strict formatting requirements for this name.

4. Configure MCP

a. 🔗MCP Server URL

  • Purpose: MaiAgent currently supports external MCP servers. Providing the MCP server's service URL lets the AI assistant call MCP services to connect to external applications.

  • Format:

    • Enter the complete URL (for example, https://mcp.dev/maiagent/mcp_service).

  • Note: This field is required.

To learn how to obtain an MCP URL, see the Technical Manual—Remote MCP Service Overview

If the MCP server needs to identify the “user in the current conversation”: when a visitor logs in to Web Chat with Keycloak, enable Use the Keycloak Login Identity to Call Tools on the conversation platform and add this MCP server's host to the allowlist. The platform will include the visitor's own Keycloak credentials in the Authorization header.

Paste your MCP server URL here. The system will automatically retrieve the list of tools connected to that server:

b. 🎛️ MCP Command Arguments (mcp_args)

  • Purpose: Define the argument names to pass when running MCP commands or calling MCP services. The AI assistant generates the contents automatically.

  • Format: A JSON array is recommended, with each element being a string representing an argument.

    • Example (JSON array):

    • During execution: The AI assistant passes these arguments to the MCP tool in order

    • If you enter a comma-separated string (for example, arg1,arg2,arg3), the system will try to parse it as an argument list. Use a JSON array to avoid ambiguity.

MCP command argument configuration example
Configure MCP command arguments

c. 🌳 MCP Environment Variables (mcp_env)

  • Purpose: Set the environment variables required to run MCP commands.

  • Format: Use a valid JSON object. Each key is an environment variable name, and each value is the environment variable's content (a string).

    • Example:

MCP environment variable configuration example
Configure MCP environment variables

5. Find “Allowed Tools (JSON Array)” and Click Refresh

  • Purpose: Specify the list of individual tools that the AI assistant is authorized to use through this MCP client. An MCP client may provide multiple functions or individual tools.

  • Automatic detection / Leave blank: If this field is blank or omitted, the system will try to detect all available tools when it first connects to the MCP client and allow all detected tools by default. To restrict the AI assistant to specific tools, list them explicitly here.

After you click, the system automatically retrieves the tools connected to that server and displays them in the list:

Tool names defined in MCP

6. 💾 Save the Tool

After checking that all settings are correct, scroll to the bottom of the page and click the “Confirm” button. Your new tool is now ready!

⚠️ Important Notes

Connection Testing

  • After creating the tool, test whether the MCP connection works correctly

  • You can verify the tool's functionality in a test environment

Permission Management

  • Choose allowed tools carefully to avoid authorizing unnecessary functions

  • Review tool usage regularly

Troubleshooting

  • If the connection fails, check that the MCP server URL is correct

  • Ensure that environment variables and argument formats meet the requirements

Last updated

Was this helpful?