gear-complexCreate MCP Tools

What is MCP?

MCP, or Model Context Protocol, can be used to integrate multi-cloud platform services or run local client applications.

Think of tool usage like a plug - you need to plug it in to access the service. Traditionally, each LLM develops its own tool usage method, like different plug specifications requiring various socket types. To enable both OpenAI and Claude to use Google Calendar services, developers need to design multiple scripts for different AIs.

When Google Calendar updates, developers may need to:

  1. Update 3 different integration versions simultaneously

  2. Maintain 3 different technical documents

This leads to extended development timelines and increased costs.

MCP Solution

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

  1. Standardized tool definition format

  2. Unified communication protocol

  3. Consistent error handling mechanisms

These simplify the development process.

Using MCP, developing a tool only requires:

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

  2. Defining standardized tool specifications

  3. Implementing unified business logic

  4. All MCP-supported AI platforms can use it

Before and After MCP Integration

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

Quick MCP Tool Setup

1. Access Tool Management Interface

First, navigate to the "AI Features" section from the left sidebar, then click "🔧 Tools". Once on the tools list page, click the "➕ Add Tool" button in the top right corner.

Tool list page with add button
Click "➕ Add Tool" to begin

2. Select Tool Type

Select MCP as the tool type.

3. Set Display Name

Set a clear display name for the tool, here set as Composio mcp for google calendar.

  • Purpose: This name will be displayed in the platform interface for all users to view.

  • Recommendation: Choose a name that clearly expresses the tool's primary function for easy user understanding. There are no strict format restrictions for this name.

4. Fill in MCP Configuration

a. 🔗MCP Server URL

  • Purpose: MaiAgent currently accepts external MCP servers. By providing the MCP server's service address (URL), AI assistants can invoke MCP services to connect to external applications.

  • Format:

    • Please provide the complete URL (e.g., https://mcp.dev/maiagent/mcp_service).

  • Note: This field is required.

circle-info

For instructions on obtaining an MCP URL, please refer to Technical Manual—Remote MCP Service Overviewarrow-up-right

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

b. 🎛️ MCP Command Arguments (mcp_args)

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

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

    • Example (JSON array):

    • During actual execution: The AI assistant will pass these parameters in order to the MCP tool

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

MCP command arguments configuration diagram
Setting MCP Command Arguments

c. 🌳 MCP Environment Variables (mcp_env)

circle-exclamation
  • Purpose: Set necessary environment variables for the MCP command execution environment.

  • Format: Must be a valid JSON object, where the key is the environment variable name and the value is the environment variable content (string).

    • Example:

MCP environment variables configuration diagram
Setting MCP Environment Variables

5. Find "Allowed Tools (JSON Array)" and click to retrieve

  • Purpose: Specify the list of specific sub-tools that the AI assistant is authorized to use under this MCP client. An MCP client may provide multiple different features or sub-tools.

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

After clicking, the system will automatically retrieve the tool content connected to that server and display it in the list:

Tool names defined by MCP

6. 💾 Save 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, it's recommended to test whether the MCP connection is working properly

  • Verify tool functionality in a test environment

Permission Management

  • Carefully select allowed tools to avoid authorizing unnecessary features

  • Regularly review tool usage

Troubleshooting

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

  • Confirm environment variables and parameter formats meet requirements

Last updated

Was this helpful?