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

Create an MCP Tool

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

What Is MCP?

MCP, or Model Context Protocol, is used to integrate multi-cloud platform services or execute local client applications.

Think of tool usage like electrical plugs — the plug must be connected to power before the service can be used. Traditionally, each LLM develops its own tool usage methods, like plugs of different standards that require multiple socket types. If you want both OpenAI and Claude to use Google Calendar services, developers need to build multiple scripts for different AIs.

When Google Calendar updates, developers may need to:

  1. Update 3 different integration versions simultaneously

  2. Maintain 3 separate sets of technical documentation

This leads to extended development timelines and excessive costs.

MCP Solution

MCP is a standardized protocol designed to solve this problem through:

  1. Standardized tool definition formats

  2. Unified communication protocols

  3. Consistent error handling mechanisms

These approaches simplify the development process.

With MCP, developing a tool requires only:

  1. Building an MCP Server (one-time development)

  2. Defining standardized tool specifications

  3. Implementing unified business logic

  4. All AI platforms that support MCP can use it

Before and after MCP integration

MCP is fundamentally a protocol designed for standardizing AI tool integration, enabling development teams to "build once, use everywhere," significantly reducing the complexity and maintenance costs of the AI assistant tool ecosystem.

Quick MCP Tool Setup

1. Access the Tool Management Interface

From the left navigation panel, go to the "AI Features" section, 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

Set a clear display name for the tool. In this example, set it to Composio mcp for google calendar.

  • Purpose: This name is displayed on the platform interface for all users to see.

  • Recommendation: Choose a name that clearly describes the tool's main function for easy user understanding. There are no strict formatting requirements for this name.

4. Fill In the MCP Configuration

a. 🔗 MCP Server URL

  • Purpose: MaiAgent currently accepts external MCP servers. By providing the MCP server's service URL, the AI assistant can call the MCP service to connect to external applications.

  • Format:

    • Enter the full URL (e.g., https://mcp.dev/maiagent/mcp_service).

  • Note: This field is required.

For instructions on obtaining an MCP URL, refer to Technical Manual — Remote MCP Service Overview

Paste your MCP server URL here, and the system will automatically retrieve the list of connected tools from that server:

b. 🎛️ MCP Command Arguments (mcp_args)

  • Purpose: Define parameter names that need to be passed when executing MCP commands or calling MCP services. The content is automatically generated by the AI assistant.

  • Format: Use JSON array format, where each element is a string representing a parameter.

    • Example (JSON array):

    • At runtime: The AI assistant passes these parameters to the MCP tool in order

    • If you enter a comma-separated string (e.g., arg1,arg2,arg3), the system will attempt to parse it as a parameter list. To avoid ambiguity, use JSON arrays.

MCP command arguments configuration
Configure MCP command arguments

c. 🌳 MCP Environment Variables (mcp_env)

  • Purpose: Set required environment variables for the MCP command execution environment.

  • Format: Must be a valid JSON object where keys are environment variable names and values are environment variable contents (strings).

    • Example:

MCP environment variables configuration
Configure MCP environment variables

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

  • Purpose: Specify which sub-tools the AI assistant is authorized to use under this MCP client. A single MCP client may provide multiple different features or sub-tools.

  • Auto-detect/Leave empty: If this field is left empty or not provided, the system will attempt to auto-detect all available sub-tools when first connecting to the MCP client, and allow all detected sub-tools by default. If you want to restrict the AI assistant to only specific sub-tools, explicitly list them here.

After clicking, the system automatically retrieves the tool content connected to that server and displays it in the list:

MCP-defined tool names

6. 💾 Save the Tool

After confirming all settings are correct, scroll to the bottom of the page and click the "Confirm" button. Your new tool is now created!

⚠️ Important Reminders

Connection Testing

  • After creating the tool, test the MCP connection to ensure it works properly

  • Verify tool functionality in a test environment

Permission Management

  • Carefully select allowed tools to avoid authorizing unnecessary features

  • Regularly check tool usage status

Troubleshooting

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

  • Confirm that environment variables and parameter formats meet the requirements

Last updated

Was this helpful?