The Aliyun MCP Server allows Claude to interact with Alibaba Cloud services, providing a seamless way to query logs and manage cloud resources through conversational AI. This server implements the Model Context Protocol (MCP) to enable Claude to execute commands on your Aliyun services.
To set up the Aliyun MCP Server, follow these steps:
npm install
npm run build
To integrate the Aliyun MCP Server with Claude Desktop, add the server configuration to your claude_desktop_config.json
file:
{
"mcpServers": {
"aliyun": {
"command": "node",
"args": ["/path/to/aliyun-mcp-server/build/index.js"],
"env": {
"ALIYUN_ACCESS_KEY_ID": "your-access-key-id",
"ALIYUN_ACCESS_KEY_SECRET": "your-access-key-secret",
"SLS_ENDPOINT": "cn-hangzhou.log.aliyuncs.com"
},
"disabled": false,
"autoApprove": []
}
}
}
To use the Aliyun MCP Server with Cline in VSCode, update your cline_mcp_settings.json
file:
{
"mcpServers": {
"aliyun": {
"command": "node",
"args": ["/path/to/aliyun-mcp-server/build/index.js"],
"env": {
"ALIYUN_ACCESS_KEY_ID": "your-access-key-id",
"ALIYUN_ACCESS_KEY_SECRET": "your-access-key-secret",
"SLS_ENDPOINT": "cn-hangzhou.log.aliyuncs.com"
},
"disabled": false,
"autoApprove": []
}
}
}
Make sure to replace /path/to/aliyun-mcp-server
with the actual path to the repository on your system and provide your Aliyun credentials.
Once configured, you can interact with Claude to query Aliyun services. For example, ask Claude to query SLS logs from a specific project and logstore with a query pattern for a specified time range.
Claude will use the MCP server to execute your request and return the results directly in the conversation.
This tool allows you to query Aliyun Simple Log Service (SLS) logs.
Parameters:
project
(required): SLS project namelogstore
(required): SLS logstore namequery
(required): SLS query statementfrom
(optional): Start time in milliseconds (defaults to 1 hour ago)to
(optional): End time in milliseconds (defaults to now)limit
(optional): Maximum number of logs to return (default: 100, max: 1000)offset
(optional): Offset for pagination (default: 0)reverse
(optional): Whether to return results in reverse order (default: false)Example request:
{
"project": "my-project",
"logstore": "my-logstore",
"query": "error",
"limit": 10
}
To use this tool, simply ask Claude to query SLS logs with specific parameters. For example: "Query SLS logs from project 'my-project' and logstore 'my-logstore' with the query 'error' for the last hour."
There are two ways to add an MCP server to Cursor. The most common way is to add the server globally in the ~/.cursor/mcp.json
file so that it is available in all of your projects.
If you only need the server in a single project, you can add it to the project instead by creating or adding it to the .cursor/mcp.json
file.
To add a global MCP server go to Cursor Settings > MCP and click "Add new global MCP server".
When you click that button the ~/.cursor/mcp.json
file will be opened and you can add your server like this:
{
"mcpServers": {
"cursor-rules-mcp": {
"command": "npx",
"args": [
"-y",
"cursor-rules-mcp"
]
}
}
}
To add an MCP server to a project you can create a new .cursor/mcp.json
file or add it to the existing one. This will look exactly the same as the global MCP server example above.
Once the server is installed, you might need to head back to Settings > MCP and click the refresh button.
The Cursor agent will then be able to see the available tools the added MCP server has available and will call them when it needs to.
You can also explictly ask the agent to use the tool by mentioning the tool name and describing what the function does.