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.
- 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
- Set Location parameters. Figure 1 Setting Location parameters
Table 1 lists the Location parameters. - 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
- 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.
The following table describes the 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.
codearts mcp auth list
As shown in the following figure, two MCP servers in the current project are pending authentication.
codearts mcp auth [name]
This command authenticates an MCP server.
- 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": {} } } - 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
- 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.
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.
The following figure shows how to debug an MCP server for which OAuth authentication has been performed.
Feedback
Was this page helpful?
Provide feedbackThank you very much for your feedback. We will continue working to improve the documentation.See the reply and handling status in My Cloud VOC.
For any further questions, feel free to contact us through the chatbot.
Chatbot