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

MCP Commands

codearts mcp commands are used to manage MCP servers, including adding, listing, authenticating, and debugging MCP servers.

codearts mcp add

This command adds an MCP server.

This example uses the project-level configuration in Windows as an example.

  1. Go to D:/tmp/test_hc_cli, right-click in the blank area, and select Open Windows Terminal here. In the displayed PowerShell window, run the following command and set parameters as prompted:

    codearts mcp add

  2. Set Location parameters.

    Figure 1 Setting Location parameters
    Table 1 lists the Location parameters.
    Table 1 Location parameters

    Parameter

    Description

    Current project

    Project where the MCP server is to be added: Project root directory/.codeartsdoer/codearts_cli.jsonc

    Global

    Path where the MCP server is to be added: ~/.codeartsdoer/codearts_cli.jsonc

  3. Set the Enter MCP server name, Select MCP server type, and Enter command to run parameters as prompted.

    Figure 2 Configuration example
    For details about the parameters, see Table 2.
    Table 2 Other MCP server parameters

    Parameter

    Description

    Enter MCP server name

    Name of the MCP server

    Select MCP server type

    Running mode of the MCP server. The options are as follows:

    • Local: You can run a local command, such as npx, uvx, or python to start the server. The communication mode is stdio.
    • Remote: You need to enter the URL of the remote MCP server. CodeArts Agent CLI connects to the server over HTTP or SSE.

    Enter command to run

    Command for running the MCP server

  4. Run codearts mcp list to check whether the configured MCP server is available.

codearts mcp list

This command lists all configured MCP servers and their connection statuses.

For example, you can run the following command to view the MCP servers configured in the D:/tmp/test_hc_cli project directory and their connection statuses:

codearts mcp list

There are four MCP servers in the current directory. The git-mcp-server, sentry, and mcp-character-tools servers are connected, and the composio server is pending authentication.

Figure 3 Example

The following table describes the MCP server statuses.

Table 3 MCP server statuses

Icon

Status

Connected

Pending authentication

Uninitialized or disabled

Failed

codearts mcp auth list

This command lists the MCP servers that support authentication and their authentication statuses.

For example, you can run the following command in the D:/tmp/test_hc_cli project directory to view the MCP servers that support authentication and their statuses.
codearts mcp auth list

As shown in the following figure, two MCP servers in the current project are pending authentication.

Figure 4 Servers pending authentication

codearts mcp auth [name]

This command authenticates an MCP server.

  1. Run the following command to list the MCP servers that have not been authenticated. In the command output, select the MCP servers you want to authenticate and press Enter to start authentication.

    codearts mcp auth

    As shown in the following figure, there are two MCP servers pending authentication in the current project. Select the MCP server you want to authenticate and press Enter to start authentication.

    Figure 5 MCP servers pending authentication

    You can perform authentication by referring to the following example configuration:

    "mcp": {
        "sentry": {
          "type": "remote",
          "url": "https://mcp.sentry.dev/mcp",
          "oauth": {}
        }
      }

  2. After the configuration is complete, run the following command to open a browser window for authentication and connect CodeArts Agent CLI to your Sentry account. In the command, sentry is the MCP server name configured in the preceding step.

    After the authentication is complete, the Sentry configuration is added to the ~/.codeartsdoer/cli-data/mcp-auth.json file.
    codearts mcp auth sentry

    As shown in the following figure, the Sentry account authentication is complete.

    Figure 6 Sentry account authentication

  3. Run the codearts mcp auth ls command again. The command output shows that the sentry server has been authenticated.

    Figure 7 Successful authentication

codearts mcp logout [name]

This command removes the authentication credentials of an MCP server.

For example, go to the D:/tmp/test_hc_cli project directory and run the following command to remove the authentication credentials of the project:

The MCP configuration in the ~/.codeartsdoer/cli-data/mcp-auth.json file is deleted.

Figure 8 Removing authentication credentials

codearts mcp debug <name>

This command displays the authentication information and connection test result.

Example:

The following figure shows how to debug an MCP server for which OAuth authentication has not been performed.

Figure 9 Debugging

The following figure shows how to debug an MCP server for which OAuth authentication has been performed.

Figure 10 Debugging