MCP (Model Context Protocol) defines a standardized interface for context exchange between large models and development environments, enabling models to securely access real-time domain knowledge. Observable MCP Server provides full observability for AI interactions, supporting the analysis of multimodal data through natural language. It seamlessly integrates with Cursor, Cline, Windsurf, and various agent frameworks, enabling enterprise users to use observable data more efficiently and reliably.
This project has been refactored in Go for single-binary deployment and no runtime dependencies. To use the original Python version, visit V1.
Key benefits
Unified data access: Connect once to query data from multiple observability products, including Log Service (SLS), Application Real-Time Monitoring Service (ARMS), CloudMonitor, and Prometheus. This unifies logs, metrics, and traces into a single view.
Natural language queries: Query logs, traces, and metrics with natural language, eliminating the need for complex query statements. The service returns structured answers.
Enterprise-grade security: Relying on the Alibaba Cloud AccessKey authentication mechanism, the server-side component does not collect additional data and strictly validates the input and output for each tool, ensuring your data stays secure and within your control.
Single-binary deployment: The service is a single executable file compiled from Go, eliminating the need to install a runtime environment. It supports Linux, macOS, and Windows.
High reliability: Built-in mechanisms, such as retry with exponential backoff, circuit breakers, and graceful shutdown, ensure the service's reliability for production environments.
Paid features
Some AI-powered tools in Observable MCP Server call the APIs of Alibaba Cloud STAROps on the backend. Using these tools incurs charges.
Paid tools
Each call to the following AI-powered tools creates a STAROps AI conversation session and incurs charges:
Tool name | Feature | Description |
| Natural language to SQL query | Converts a user's natural language question into an executable SLS SQL statement. |
| Natural language to SPL query | Converts a user's natural language question into an SPL statement and executes it. |
| Log Service intelligent O&M assistant | Provides O&M suggestions for Log Service based on an AI conversation. |
| natural language data query | Directly queries observability data in natural language by using DataAgent. |
Billing
Alibaba Cloud STAROps bills you for these paid tools. For details, see the billing description.
If you do not need AI-powered capabilities, you can edit the
config.yamlfile under theenabled_toolskey to include only free tools and avoid unexpected charges.toolkit: scope: all enabled_tools: - sls_list_projects - sls_list_logstores - sls_execute_sql - sls_execute_spl - cms_execute_promql # ... Add other free tools as needed
Get started
Step 1: Configure permissions
Follow the instructions in Create an AccessKey to get the required Alibaba Cloud AccessKey ID and AccessKey Secret.
If you use a RAM user, note the following:
You must grant the RAM user or role associated with your AccessKey the required permissions to access relevant cloud services.
Follow the principle of least privilege: To minimize security risks, grant only the permissions required for the MCP tools you use.
ImportantDuring runtime, Observable MCP Server uses the AccessKey you provide to call Alibaba Cloud OpenAPI. However, it does not store your AccessKey in any form or use it for any purpose other than its designed functionality.
Step 2: Install the MCP server
Choose the installation method that fits your needs. We strongly recommend deploying the MCP Server in an internal network or trusted environment, such as a VPC, to avoid direct exposure to the public internet. For network-level isolation and security, we recommend deploying with Alibaba Cloud Function Compute (FC) and configuring it for VPC-only access.
Pre-compiled binaries
Download the binary file for your platform from the Releases page:
# Linux amd64
wget https://github.com/aliyun/alibabacloud-observability-mcp-server/releases/latest/download/alibabacloud-observability-mcp-server-linux-amd64.tar.gz
tar -xzf alibabacloud-observability-mcp-server-linux-amd64.tar.gz
# macOS arm64 (M1/M2)
wget https://github.com/aliyun/alibabacloud-observability-mcp-server/releases/latest/download/alibabacloud-observability-mcp-server-darwin-arm64.tar.gz
tar -xzf alibabacloud-observability-mcp-server-darwin-arm64.tar.gzThe extracted package contains:
alibabacloud-observability-mcp-server: The executable fileconfig.yaml: The default configuration file
After configuring your credentials, you can start the server:
# Set your Alibaba Cloud AccessKey credentials
export ALIBABA_CLOUD_ACCESS_KEY_ID=<YOUR_ACCESS_KEY_ID>
export ALIBABA_CLOUD_ACCESS_KEY_SECRET=<YOUR_ACCESS_KEY_SECRET>
# Start in stdio mode (for local integrations like Cursor, Kiro, and Cline)
./alibabacloud-observability-mcp-server start --stdio
# Start in SSE or streamable-http mode (determined by server.transport in config.yaml)
./alibabacloud-observability-mcp-server start --config config.yamlBuild from source
Go 1.22 or later is required.
# Clone the source code
git clone https://github.com/aliyun/alibabacloud-observability-mcp-server.git
# Go to the source code directory
cd alibabacloud-observability-mcp-server
# Build for the current platform
make build
# Start the server in stdio mode
./bin/alibabacloud-observability-mcp-server start --stdio
# Start the server in SSE/streamable-http mode (requires config.yaml)
./bin/alibabacloud-observability-mcp-server start --config config.yamlTo build binary files for all platforms, run the following command:
# Build for all platforms (Linux, macOS, and Windows)
make build-allThe generated binary files are located in the bin/ directory.
Configuration
The configuration is structured in two layers:
config.yaml: For server configuration, including transport mode, logging, networking, and toolsets..envfile or environment variables: For credentials and runtime parameters, such as sensitive AccessKey information.
config.yaml structure
The server searches for config.yaml first in the current directory, and then in the ./config/ directory. In stdio mode, if config.yaml is not found, the server uses built-in default settings.
# Server configuration
server:
transport: streamable-http # stdio, sse, streamable-http
host: "0.0.0.0"
port: 8180
# Logging configuration
logging:
level: info # debug, info, warn, error
debug_mode: false
# Toolkit configuration
toolkit:
scope: all # all, paas, iaas
# Fine-grained tool selection (optional)
# When enabled_tools is not empty, only the tools in the list are registered (scope still determines which toolkits are loaded).
# Uncomment the tools you need to enable them. Keep the others commented out.
# enabled_tools:
# ## ── Shared Tools (General) ──
# - introduction # Get service introduction information
# - list_workspace # List available workspaces
# - list_domains # List entity domains in a workspace
# Network configuration
network:
max_retry: 1
retry_wait_seconds: 1
read_timeout_ms: 610000
connect_timeout_ms: 30000
# Localization configuration
locale:
timezone: Asia/Shanghai
language: zh-CN
# Endpoint override configuration (optional, for intranet access or custom endpoints)
# endpoints:
# sls:
# cn-hangzhou: "cn-hangzhou-intranet.log.aliyuncs.com"
# cms:
# cn-hangzhou: "cms.cn-hangzhou.aliyuncs.com"Parameters
Parameter | Description | Options |
| The transport mode. | Possible values are |
| The listen address (for | Default: |
| The listen port (for | Default: |
| The log level. | Valid values: |
| When enabled, outputs full requests and responses. | Default: |
| Specifies the tools to enable. | Valid values: |
| An optional list for fine-grained tool selection. If specified, only the tools in this list are registered. The | The default value is empty, which registers all tools within the |
| The maximum number of retries. | Default: |
| The read timeout period in milliseconds. | Default: |
| The connection timeout period in milliseconds. | Default: |
| The time zone for time parsing. | Default: |
| The language for error messages and other output. | Default: |
.env file and environment variables
The server reads credentials from the .env file first. If the file is not found, it reads the credentials from shell environment variables.
Environment variable | Description | Required |
| Your Alibaba Cloud AccessKey ID. | Yes |
| Your Alibaba Cloud AccessKey Secret. | Yes |
| The STS token for temporary credentials (optional). | No |
| The default region. | No |
| The default workspace (required for PaaS tools). | No |
Warning: To prevent significant security risks, never expose an MCP Server SSE/HTTP endpoint with your AccessKey configured to the public internet without proper authentication and access control.
If an AccessKey ID and AccessKey Secret are not provided during initialization, the server searches for access credentials in the following order:
If the ALIBABA_CLOUD_SECURITY_TOKEN environment variable is set, the server uses the STS token as the default credentials.
If the ALIBABA_CLOUD_SECURITY_TOKEN environment variable is not set, the server checks if both ALIBABA_CLOUD_ACCESS_KEY_ID and ALIBABA_CLOUD_ACCESS_KEY_SECRET are set and non-empty. If so, it uses them as the default credentials.
CLI commands
Command | Description | Parameters |
| Starts the MCP server. |
|
| Displays version information. | None. |
| Lists all registered MCP tools. | None. |
MCP service examples
Your projects
After running the MCP service, ask the large model in natural language to list your projects.
MCP Server performs this query by calling the sls_list_projects tool, which correlates data from multiple sources.
The query returns a total of 52 SLS projects in the China (Hangzhou) region (cn-hangzhou). The AI assistant then categorizes them by purpose into groups: CMS workspace-associated projects, ARMS/XTrace tracing projects, Kubernetes log projects, and other projects.
Available cloud monitor metrics
Ask the large model a question in natural language, such as "List the available metrics under the CloudMonitor namespace". The model queries data by calling tools provided by the MCP Server, such as
cms_list_metricsandcms_list_namespaces, to return a list of available monitoring metrics for the specified namespace. When you enter "List the available metrics under the CloudMonitor namespace." in the dialog box, the AI assistant sequentially calls tools such ascms_list_namespaces,list_workspace,cms_natural_language_query,list_domains,umodel_search_entity_set, andumodel_list_data_set. This process retrieves and displays the available monitoring metrics for an ECS instance, organized into categories such as CPU-related metrics, memory-related metrics, and disk I/O-related metrics.
Query entity instance data
Ask the large model a natural language question, such as "I want to query specific entity instance data," to retrieve detailed information about entity instances. The AI assistant does this by calling tools provided by the MCP Server, such as
umodel_get_entities,umodel_get_metrics, andumodel_list_data_set. In the AI assistant chat interface, the AI assistant calls a sequence of three APIs—umodel_search_entity_set,umodel_get_entities, andumodel_search_entities—to find a total of 10 APM service entity instances in the current workspace. The AI assistant displays the results in a table with columns such as Service name, Language, Source, Resource group ID, and Last observed time. These services cover multiple languages, including Java, Python, Node.js, Ruby, Rust, Go, and WebJS, and form a microservices architecture.
AI tool integration
Cursor / Kiro / Cline (streamable-http mode)
In
config.yaml, setserver.transport: streamable-http.Start the service:
./alibabacloud-observability-mcp-server start --config config.yaml.Configure
mcp.jsonin your AI tool:
{
"mcpServers": {
"alibaba_cloud_observability": {
"url": "http://localhost:8180/streamhttp"
}
}
}Cursor / Kiro / Cline (stdio mode)
Configure mcp.json in your AI tool:
{
"mcpServers": {
"alibaba_cloud_observability": {
"command": "./bin/alibabacloud-observability-mcp-server",
"args": ["start", "--stdio"],
"env": {
"ALIBABA_CLOUD_ACCESS_KEY_ID": "<YOUR_ACCESS_KEY_ID>",
"ALIBABA_CLOUD_ACCESS_KEY_SECRET": "<YOUR_ACCESS_KEY_SECRET>"
}
}
}
}In stdio mode, if config.yaml does not exist, the server will use its built-in defaults.Related references
Supported tools
The list of MCP tools is updated frequently. You can view all registered tools by running the ./alibabacloud-observability-mcp-server tools command.