Updated on 2026-07-29 GMT+08:00

MCP

CodeArts Agent connects to an MCP server using the Model Context Protocol (MCP). It leverages the server's extra tools and resources to enhance its capabilities.

What Is MCP?

The Model Context Protocol (MCP) is an open standard that specifies how applications interact with large language models (LLMs). It creates a consistent way for LLMs to access external data and tools. The main role of the MCP server is to enable LLMs to call on external resources to help answer questions or perform tasks. For more information about MCP, see the MCP official documentation.

Table 1 Comparison between MCP servers and other functions

Dimension

Rule

Skill

MCP Server

Definition

Constrains the behavior of an agent.

Describes how to complete a specific task.

Invokes external tools.

Loading method

Is loaded into the context at the beginning of a chat for continuous inference.

Is loaded on demand to reduce context usage.

Is not involved in the inference process; calls external interfaces as required.

Application scenario

Defines code specifications, output formats, team collaboration agreements, etc.

Example: Code must comply with PEP 8 specifications.

Encapsulates testing processes, development tasks, complex business logic, etc.

Example: executing UI automated testing.

Connects to external systems to perform specific operations.

Example: controlling browser-related operations.

Key differences

Controls how an agent should behave, defining the behavior boundary.

Specifies how to complete a task, serving as a process guide.

Provides the capability to invoke tools, representing the execution dimension.

Disclaimer

MCP servers are built, published, and maintained by third-party developers or organizations. CodeArts Agent does not review, verify, or endorse the code implementation, security, stability, data processing practices, or service quality of third-party MCP servers.

CodeArts Agent shall not be held liable for any risks arising from the use of third-party MCP servers, including but not limited to issues caused by defects in the MCP servers themselves, configuration errors, service anomalies, API changes, call failures, or the accuracy, completeness, and security of returned data.

Certain MCP servers may be inaccessible in specific countries or regions due to applicable laws and regulations, network constraints, policy adjustments by third-party services, or changes in service availability. CodeArts Agent has no control over these factors and cannot guarantee that all MCP servers will remain continuously available or fully functional across different regions or network environments.

Before using a third-party MCP server, users should independently assess its suitability and security risks, and ensure compliance with local laws and regulations as well as the terms of use and licensing requirements of the relevant third party.

For MCP servers involving sensitive operations on code, data, files, or account permissions, users are advised to fully understand their scope of permissions, data processing methods, and security policies before use, and to implement necessary security measures based on their specific business scenarios.

Configuring MCP Servers and Using Them

Currently, two types of MCP servers are supported, depending on the communication mode between the MCP server and the MCP client (CodeArts Agent).

Type

Transmission Protocol

Environment

MCP server based on standard input and output (stdio)

stdio

Local

HTTP-based MCP server

SSE

Local/Remote

Streamable HTTP

Local/Remote

The MCP marketplace integrates featured MCP servers from the AgentArts platform, allowing you to browse and install them.

  1. Log in to CodeArts Agent IDE as instructed in Quick Start.
  2. Click in the upper right corner of CodeArts Agent IDE to open the settings page.
  3. In the navigation pane on the left, choose MCP.
  4. On the Marketplace tab, find the required MCP server (such as Master of Ink Draft) and click on the right to install it.

    There is no hard limit on the number of MCP servers you can add on CodeArts Agent. However, for the best performance, we recommend the following:

    • Keep the total number of created servers under 20.
    • Keep the number of enabled servers under 8.
    • Enable 3 servers for the optimal experience.

    After the installation is completed, you can view the installed MCP server on the Installed tab.

  5. Use the installed MCP server.

    1. At the bottom of the input box on the chat panel, choose Built-in > Agent to switch to the agent mode. The selected model is displayed on the right. You can select a model as required from the drop-down list.

      If the chat panel of CodeArts Agent is not displayed, click (Expand AI Sidebar) in the upper right corner of the top menu bar to open it.

    2. In the input box, enter the following information and click :
      Convert the AGENTS.md file to a Word file.
    3. View the invocation result of the MCP tool.

      If a corresponding Word file is generated in the project directory under the explorer, the MCP tool has been successfully invoked.

      Figure 1 Viewing the invocation result

  1. Log in to CodeArts Agent IDE as instructed in Quick Start.
  2. Click in the upper right corner of CodeArts Agent IDE to open the settings page.
  3. In the navigation pane on the left, choose MCP.
  4. Click Configure MCP to open the mcp_settings.json file, and edit it.

    There is no hard limit on the number of MCP servers you can add on CodeArts Agent. However, for the best performance, we recommend the following:

    • Keep the total number of created servers under 20.
    • Keep the number of enabled servers under 8.
    • Enable 3 servers for the optimal experience.

    The following is a general template for MCP configuration:

    {
      "mcpServers": {
        "Server name": {
          "command": "Command for starting the process",
          "args": [
            "Parameter array"
          ],
          "env": {
            "Environment variables"
          }
        }
      }
    }
    Table 2 Parameters

    Parameter

    Description

    Server name

    A unique name or identifier (maximum 64 characters) used to distinguish between different MCP servers.

    NOTE:

    If the server name exceeds 64 characters, the request may fail with the following error. For details, refer to the definition of Tools under Core Server Features.

    • type: session.error info
    • length over limit, maximum is 64

    command

    (Mandatory) Enter the path of the command or program needed to start the MCP server.

    args

    (Optional) Enter the list of parameters for the command. Use this along with command to configure the MCP server's operation.

    env

    (Optional) Enter the environment variables passed to the MCP server. These variables must be strings.

    For example, you want to use Playwright to directly control the browser to perform automatic operations such as web page navigation, click, input, screenshot, and data extraction. The mcp_settings.json file is configured as follows:
    {
      "mcpServers": {
        "playwright": {
          "command": "npx",
          "args": [
            "@playwright/mcp@latest"
          ]
        }
      }
    }

    In this example, you need to install the node.js environment on the local host. The node-v24.x version is recommended. The agent can install it for you upon request.

  5. After the configuration is complete, press shortcut keys (Ctrl+S for Windows/Linux and Command (⌘)+S for macOS) to save the settings and wait until the tool is started.

    If issues arise during setup, go back to the chat page for assistance from the agent.

  6. Use the installed MCP server.

    1. At the bottom of the input box on the chat panel, choose Built-in > Agent to switch to the agent mode. The selected model is displayed on the right. You can select a model as required from the drop-down list.

      If the chat panel of CodeArts Agent is not displayed, click (Expand AI Sidebar) in the upper right corner of the top menu bar to open it.

    2. In the input box, enter the following information and click :
      Access https://codearts.huaweicloud.com and view all download options.

      The agent invokes the Playwright MCP server to open the webpage. Then you can download required items.

  1. Log in to CodeArts Agent IDE as instructed in Quick Start.
  2. Click in the upper right corner of CodeArts Agent IDE to open the settings page.
  3. In the navigation pane on the left, choose MCP.
  4. Click Configure MCP to open the mcp_settings.json file, and edit it.

    There is no hard limit on the number of MCP servers you can add on CodeArts Agent. However, for the best performance, we recommend the following:

    • Keep the total number of created servers under 20.
    • Keep the number of enabled servers under 8.
    • Enable 3 servers for the optimal experience.
    • General MCP configuration template for the server-sent events (SSE) protocol; applicable to event-driven, real-time push scenarios.
      {
        "mcpServers": {    
          "Server name": {
            "url": "https://example.com/mcp/sse",
            "type": "sse"
          }
        }
      }
    • General MCP configuration template for the Streamable HTTP protocol; applicable to general streaming data transmission scenarios.
      {
        "mcpServers": {
          "Server name": {
            "url": "https://example.com/mcp",
            "type": "streamableHttp"
          }
        }
      }
    Table 3 Parameters

    Parameter

    Description

    Server name

    A unique name or identifier (maximum 64 characters) used to distinguish between different MCP servers.

    NOTE:

    If the server name exceeds 64 characters, the request may fail with the following error. For details, refer to the definition of Tools under Core Server Features.

    • type: session.error info
    • length over limit, maximum is 64

    url

    Enter the address for accessing the remote MCP server. Make sure it is a valid HTTP or HTTPS URL.

    type

    Communication protocol type of the MCP server. The value can be sse or streamableHttp.

    CAUTION:

    If the type parameter is missing from the following example, manually add it before use to ensure normal operation in CodeArts Agent.

    For example, if you want to integrate the Amap MCP server with the Amap app, configure the mcp_settings.json file as follows:

    {
      "mcpServers": {
        "amap-maps-streamableHTTP": {
          "url": "https://mcp.amap.com/mcp?key=Key you have applied for on the Amap official website",
          "type": "streamableHttp"
        }
      }
    }

  5. After the configuration is complete, press shortcut keys (Ctrl+S for Windows/Linux and Command (⌘)+S for macOS) to save the settings and wait until the tool is started.

    If issues arise during setup, go back to the chat page for assistance from the agent.

  6. Use the installed MCP server.

    1. At the bottom of the input box on the chat panel, choose Built-in > Agent to switch to the agent mode. The selected model is displayed on the right. You can select a model as required from the drop-down list.

      If the chat panel of CodeArts Agent is not displayed, click (Expand AI Sidebar) in the upper right corner of the top menu bar to open it.

    2. In the input box, enter the following information and click :
      Help me plan a one-day tour in Beijing that includes the Palace Museum, the Great Wall, and local delicacies.

      The agent will call Amap via the MCP server to generate a personalized one-day itinerary for you.

Managing MCP Servers

  • Enabling or disabling an MCP server: After an MCP server is installed, on the settings page of CodeArts Agent IDE, choose MCP > Installed. Click / next to the target MCP server to enable or disable it.
  • Editing an MCP server: On the settings page of CodeArts Agent IDE, choose MCP > Installed. Click Configure MCP in the upper right corner to open the mcp_settings.json file.

    Assume that you have installed the Master of Ink Draft MCP server from the marketplace and now need to add a server based on the Streamable HTTP protocol. The following is a configuration example of mcp_settings.json:

    {
      "mcp": {
        "aigroup-mdtoword-mcp": {
          "command": "npx",
          "args": [
            "-y",
            "aigroup-mdtoword-mcp"
          ],
          "env": {},
          "description": "",
          "disabled": false,
          "timeout": 60
        },
        "amap-maps-streamableHTTP": {
        "url": "https://mcp.amap.com/mcp?key=7047c506c***526ceee",
        "type": "streamableHttp"
    }
      }
    }
  • Restarting an MCP server: On the settings page of CodeArts Agent IDE, choose MCP > Installed. Click next to the target MCP server. Generally, you need to restart an MCP server in the following scenarios:
    • Applying configuration changes: If you have edited mcp_settings.json (such as adding new environment variables, changing startup commands, etc.), the IDE's internal cache may not update automatically. In this case, you must restart the MCP server for the new configuration to take effect immediately.
    • Service recovery: When the MCP server becomes unresponsive, freezes, or encounters errors, restarting it can reset the process state.
  • Deleting an MCP server: On the settings page of CodeArts Agent IDE, choose MCP > Installed. Click next to the target MCP server.

    To minimize memory consumption and avoid cluttering your context space, promptly delete or disable any MCP servers you do not frequently use.