Create an MCP tool

This guide will walk you through creating a new MCP tool in the platform.

MCP (Model Context Protocol) tool is used to integrate multi-cloud platform services or run local client applications.

Quickly create MCP tool

1. Go to the tool management interface

First, please enter the " AI Features" section, then click "🔧 Tools". After entering the tool list page, click the "➕ Add Tool" button in the top right corner.

工具列表頁面與新增按鈕
Click "➕ Add Tool" to start creating

2. Choose tool type

Please choose tool type MCP.

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 shown in the platform interface for all users to see.

  • Recommendation: Choose a name that clearly expresses the main function of the tool to help users understand. There is no strict format requirement for this name.

4. Fill in MCP configuration

a. 🔗MCP server URL

  • Purpose:MaiAgent currently accepts external MCP servers. By providing the service address (URL) of an MCP server, the AI can call MCP services to connect external applications.

  • Format:

    • Please enter the full URL (for example:https://mcp.dev/maiagent/mcp_service).

  • Note:This field is required.

To learn how to obtain the MCP URL, please refer toTechnician Manual — Remote MCP Service Overview

Paste your MCP server URL here; the system will automatically fetch the list of tools linked in that server:

b. 🎛️ MCP command arguments (mcp_args)

  • Purpose:Defines the names of parameters that need to be passed when executing MCP commands or calling MCP services; the content is automatically generated by the AI.

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

    • Examples (JSON array):

      [
          "--user",
          "admin",
          "--config",
          "/path/to/config.yaml"
      ]
    • At runtime:The AI will pass these parameters 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 a list of arguments. To avoid ambiguity, using a JSON array is recommended.

MCP 命令參數設定示意圖
Set MCP command arguments

c. 🌳 MCP environment variables (mcp_env)

  • Purpose:Set the necessary environment variables for the execution environment of MCP commands.

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

    • Examples:

      {
        "API_KEY": "{{SECRET_MCP_API_KEY}}",
        "REGION": "us-west-1",
        "DEBUG_MODE": "true"
      } 
MCP 環境變數設定示意圖
Set MCP environment variables

5. Find “Allowed tools (JSON array)”, then tap Refresh

  • Purpose:Specifies the concrete list of sub-tools that the AI is authorized to use under this MCP client. A single MCP client may provide multiple different functions or sub-tools.

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

After tapping, the system will automatically fetch the tool contents linked to that server and display them in the list:

Tool names defined by the 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 reminder

Connection test

  • After creating the tool, it is recommended to first test whether the MCP connection is working properly

  • You can verify the tool functionality in a test environment

Permission management

  • Carefully choose the allowed tools to avoid granting too many unnecessary permissions

  • Regularly check tool usage

Troubleshooting

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

  • Confirm that environment variables and parameter formats meet the requirements

Last updated

Was this helpful?