MCP Server¶
What is MCP Server?¶
MCP Server, the Model Context Protocol (MCP), is an open protocol designed to standardize secure connections and data source access between applications and AI models. Its core goal is to enable developers to easily provide contextual information (such as data, content, operations) to models through unified "tools" and "resources", thereby enhancing model capabilities without the need to retrain the models.
Services built based on MCP Server ultimately provide a unified multi-model callable interface. This service supports multi-client access and employs an API Key authentication mechanism to securely access the core features of Guance, including Monitors, Logs, Dashboards, and DQL queries.
Getting Started¶
This example uses the Cherry Studio integration method.
Integration Methods
More integration methods are under development. Stay tuned!
Download Version¶
-
Download the MCP Server client Cherry Studio and select the corresponding version.
-
Open Cherry Studio and start configuring the basic large model service.
This example uses Volcengine to configure the API key.
Configure Guance MCP Service¶
- Customize the service name and description.
- Select the type as
streamableHttp. - Define the URL:
https://obsy-ai.guance.com/obsy_ai_mcp/mcp. - The request header format is:
Authorization=DF-API-KEY;Endpoint=SITE_KEY. - After configuring the MCP service, save it and enable it. Then return to the homepage and select the MCP service.
Configuration Instructions¶
-
The interface uses API KEY for authentication. Each request uses the value of
DF-API-KEYin the request header for validity checks and as the basis for limiting the workspace for this request (using the workspace to which this DF-API-KEY belongs). -
All interfaces currently displayed by the MCP service only require providing an API KEY (Header:
DF-API-KEY) as the credential. If the credential exists and is valid, authentication is considered passed. -
The MCP Endpoint configuration parameter is
SITE_KEY, for example:cn1. The specific corresponding MAP is as follows:
SITE_KEY_MAP = {
# === China SaaS Deployment ===
"cn1": "https://openapi.guance.com", # China Region 1 (Hangzhou) — Default
"cn2": "https://aws-openapi.guance.com", # China Region 2 (Ningxia)
"cn4": "https://cn4-openapi.guance.com", # China Region 4 (Guangzhou)
"cn6": "https://cn6-openapi.guance.one", # China Region 6 (Hong Kong)
"us1": "https://us1-openapi.guance.com", # Overseas Region 1 (Oregon)
"eu1": "https://eu1-openapi.guance.one", # Europe Region 1 (Frankfurt)
"ap1": "https://ap1-openapi.guance.one", # Asia-Pacific Region 1 (Singapore)
"za1": "https://za1-openapi.guance.com", # Africa Region 1 (South Africa)
"id1": "https://id1-openapi.guance.com", # Indonesia Region 1 (Jakarta)
}
Using the MCP Service¶
Tool Name |
Function | Input Example | Notes |
|---|---|---|---|
| Monitor Management | List the monitors in Guance | List the monitors in Guance | Queries the first 10 entries by default |
| Log Data Access Rules | List the log data access rules in Guance | List the log data access rules in Guance | Queries the first 10 entries by default |
| Dashboard Management | Get the list of dashboards in Guance | Get the list of dashboards in Guance | Queries the first 10 entries by default |
| Log Query | Execute a DQL log query | Last 15 minutes query Metrics "namespace": "L", Measurement "datasource": "worker-0", Query method "select-clause": "last(*)", Filter "where-clause": "{ host = 'cluster' }", Group by "group-by-clause": "host" |
Default Query: Last 5 minutes, namespace L, Measurement default, get all logs and fields, no additional filtering Required Fields: namespace: Metrics category (M/L/T/R, etc.)datasource: Metrics source (cpu/worker/kodo-inner/view, etc.)select-clause: Query method (e.g., last(*)) |
| Metrics Query | Execute a DQL metrics query | Last 15 minutes query Metrics "namespace": "M", Measurement "datasource": "cpu", Query method "select-clause": "avg(load5s)", Filter "where-clause": "{ host = 'cluster' }", Group by "group-by-clause": "host" |
Default Query: Last 5 minutes, average of load5s under the cpu Measurement, no filtering or grouping Required Fields: namespace: Metrics category (M/L/T/R, etc.)datasource: Metrics sourceselect-clause: Query method (e.g., avg(load5s)) |
| Trace Query | Execute a DQL trace query | Last 15 minutes query Metrics "namespace": "T", Measurement "datasource": "kodo-inner", Query method "select-clause": "last(*)", Filter "where-clause": "{ host = 'cluster' }", Group by "group-by-clause": "service" |
Default Query: Last 5 minutes, latest value of kodo-inner trace metrics, no filtering or grouping Required Fields: namespacedatasourceselect-clause |
| RUM Query | Execute a DQL RUM query | Last 15 minutes query Metrics "namespace": "R", Measurement "datasource": "view", Query method "select-clause": "avg('loading_time') as average", Filter "where-clause": "{ view_path = xxxx AND app_id = 'xxx' }", Group by "group-by-clause": "app_id" |
Default Query: Last 5 minutes, average loading_time of all views, no filtering or grouping Required Fields: namespacedatasourceselect-clause |
