GuanMCP Integration and User Guide
Overview
GuanMCP connects MCP-compatible AI clients to Guandata BI. Users can search BI resources, understand metric definitions, and query authorized data in natural language. GuanMCP provides resource queries and analysis under the current user's permissions and never bypasses Guandata BI permission checks. Triggering an existing report subscription generates a report and notifies its recipients, so it requires explicit user authorization.
Connect to GuanMCP
Step 1: Choose an access method
| Access method | Recommended for | Identity and permissions |
|---|---|---|
| Centralized administrator-managed access with individual member identities | Custom enterprise AI platforms | An administrator provides one Streamable HTTP service. Each request carries the current user's identity, and access follows that user's Guandata BI permissions. |
| Individual access with a personal PAT or account | Personal remote connections, small teams, specific departments, and local individual use | Each member configures personal credentials in their MCP client, and access follows the credential owner's permissions. |
Choose centralized access if the AI platform can dynamically pass the current member's identity. Choose individual access if each member configures their own credentials, and use a personal PAT to connect to a remote service or start GuanMCP locally. Use an endpoint that supports the chosen method, as provided by your administrator.
Step 2: Complete the connection
Centralized administrator-managed access
Centralized access suits a GuanMCP service maintained by an administrator and shared through one AI entry.
-
Confirm that the AI platform can pass a unique attribute of the current user with every request and that the attribute has been synchronized to the user's Guandata BI profile.
-
Configure
MCP_ENTRYPOINT_TOKENandBI_APP_TOKENon the GuanMCP server:Setting Description MCP_ENTRYPOINT_TOKENCredential generated by the GuanMCP service administrator and used in Authorization: Bearer <MCP service credential>.BI_APP_TOKENDefault Token of the target BI site, injected through a server-side Secret and used to exchange user identities through the BI Public API. MCP_ENTRYPOINT_TOKEN=<MCP service credential>BI_APP_TOKEN=<BI default token injected through a server-side Secret>In the target BI site, open Admin Center > Open Platform > Token Management, enable Allow other systems or modules to access related information, and copy Default Token. In an older interface, use Admin Center > System Integration > Unified Account Integration. Add the actual outbound IP address used by GuanMCP to call BI to IP Whitelist; separate multiple IP addresses with commas. See Token Management.
This allowlist controls requests from GuanMCP to BI. Configure the network allowlist for the AI platform's access to GuanMCP separately at the MCP service entry.
Configure two custom request headers on the AI platform:
bi-user-property-headerspecifies the header carrying the current user's attribute value, andbi-user-property-keyspecifies the internal key of the corresponding Guandata user property. For a custom property, use its actual internal key, not its display name.Platform bi-user-property-header bi-user-property-key Mapping Custom enterprise AI platform Platform-defined identity header Corresponding user property key Platform identifier → Guandata user property With a GuanMCP service that supports these headers, platforms can specify mappings per request and share the same service. Each request must include both mapping headers and the corresponding user attribute value. Incomplete or invalid configuration returns an error. Only when both mapping headers are absent does the service fall back to the existing
BI_USER_PROPERTY_HEADERandBI_USER_PROPERTY_KEYenvironment variables.For many users, maintain mappings through an Account Dataset and Account Sync. For a few users, edit user information directly. Attribute values must exactly match the member identifiers passed by the platform and must be unique.
-
Add a Streamable HTTP MCP service to the AI platform. Enter the complete URL and configure
MCP_ENTRYPOINT_TOKENin the Authorization header. -
Ensure every request carries both mapping headers and the current user's attribute value, injected by the authenticated platform or a trusted gateway. For example:
POST https://bi.example.com/mcpAuthorization: Bearer <MCP service credential>bi-user-property-header: X-Company-User-Idbi-user-property-key: <actual internal user property key>X-Company-User-Id: <current user attribute value> -
Ask the same question as two members with different BI permissions. Each result should match that member's Guandata BI permissions.
MCP_ENTRYPOINT_TOKEN protects the MCP entry point; BI_APP_TOKEN is only for server-side identity exchange. Never interchange them. The gateway for centralized identity mapping must discard externally supplied direct Guandata credentials, mapping headers, and identity headers, including X-Personal-Token, X-GuanBI-Uid-Token, X-GuanBI-Login-Id, and the platform identity header. It must then inject the platform's fixed mapping headers and the authenticated user's identity to prevent impersonation or bypassing user mapping. Never expose real tokens in chats, screenshots, tickets, or repositories.
For a centralized administrator-managed integration, see the custom enterprise guide.
Individual access
Each member configures personal credentials in their own MCP connection. Access follows the credential owner's BI permissions and authorized scope.
Connect to a remote service with a personal PAT
Use this method when a remote GuanMCP endpoint is available and the client supports Streamable HTTP and custom headers. No local Node.js installation or GuanMCP process is required.
-
Obtain the complete HTTPS MCP endpoint that supports personal PAT access from your administrator. If the centralized identity-mapping endpoint filters personal credentials, use the separate personal PAT endpoint provided by the administrator.
-
Sign in to the BI environment associated with that service and create your own PAT.
-
Enter the service URL in your personal MCP connection and set X-Personal-Token to your PAT. For clients that accept JSON configuration:
{"mcpServers": {"guanbi": {"url": "https://bi.example.com/mcp","headers": {"X-Personal-Token": "<your personal PAT>"}}}} -
Save and reconnect. Ask “Show me the datasets I can access” and confirm that only authorized resources are returned. Then complete connection verification.
Personal PAT access requires no additional Authorization header, server-side identity exchange credentials, or a user identity header. Do not substitute Authorization: Bearer <PAT> for X-Personal-Token. Use the complete endpoint path supplied by the administrator, such as https://bi.example.com/mcp.
Each member must use their own PAT. Never configure one person's PAT as a shared agent credential: all requests would run as that BI user instead of switching with the current conversation member. When a PAT expires or becomes invalid, update it in the personal connection and reconnect.
GuanMCP 0.1.43 or later supports calling ChatBI tools with a PAT. See ChatBI features and tools. Confirm that the target BI and ChatBI services support PAT and have the required modules and resource permissions enabled.
Start GuanMCP locally with stdio
Use this method when the MCP client can start a local service.
-
Sign in to Guandata BI and create a personal PAT as described in the PAT User Guide. If the entry is unavailable, ask your BI administrator to check the environment and your permissions.
-
Install Node.js 20 or later and make sure
npxis available. -
Add the following configuration and replace the sample values:
{"mcpServers": {"guanbi": {"command": "npx","args": ["-y", "@guandata/guanbi-mcp-server@latest"],"env": {"BI_BASE_URL": "https://bi.example.com","BI_PAT": "<personal PAT>"}}}} -
Save the configuration and reload the MCP service. When GuanMCP tools appear in the client, complete Step 3: Verify the connection.
PAT is recommended because its permissions, expiration, and revocation can be managed independently. If PAT is unavailable, use a personal account:
{
"BI_BASE_URL": "https://bi.example.com",
"BI_LOGIN_ID": "<login account>",
"BI_LOGIN_PASSWORD": "<login password>"
}
BI_LOGIN_DOMAIN defaults to guanbi. If your login domain differs, confirm it with your BI administrator and add this setting. Account credentials are stored locally, so use this method only when it meets your organization's security requirements.
Step 3: Verify the connection
Ask:
- “What BI capabilities are currently available through GuanMCP?”
- “Show me the datasets I can access.”
- “Query this week's East China sales and identify the metric, card, or dataset used.”
The connection is successful if GuanMCP tools appear, authorized resources are found, and the result includes verifiable data sources.
Use GuanMCP
Common usage
| Purpose | Example prompt |
|---|---|
| Find resources | Find pages, cards, and datasets whose names contain “Store Operations.” |
| Understand definitions | What is the definition of the Sales metric, and which dimensions are available? |
| Query data | Query this week's East China sales and compare them with last week. |
| Continue analysis | Break down the sales change by city, list the three largest changes, and cite the data source. |
Specify the time range, business scope, target metric or resource, and whether you want a summary, trend, or Top N result. If the resource name is unknown, ask the AI to list candidates first.
ChatBI features and tools
Starting with GuanMCP 0.1.43, both local stdio and remote Streamable HTTP support calling ChatBI tools with a PAT. The target BI and ChatBI services must also support PAT authentication and have the required modules enabled. The current user and PAT must have the corresponding permissions.
| Product feature | Tool |
|---|---|
| List accessible dataset agents (topics), optionally filtering for topics that support insights | chatbi_list_themes |
| Ask natural-language questions through a dataset agent | chatbi_query |
| Start a deep insight task and retrieve the analysis report | chatbi_insight_start, chatbi_insight_poll |
| Find reports and existing subscriptions | chatbi_report_composer_list |
| Trigger an existing report subscription, generate the report, and notify its recipients | chatbi_report_composer_trigger_subscription |
| View report subscription run history and execution results | chatbi_report_composer_runs |
Start by asking “List the dataset agents I can access,” choose an agent, and then ask “Query this month's sales by region” or “Analyze this month's sales changes in depth.” Deep insights require starting a task and then checking its progress and final report.
Obtain explicit authorization to send notifications before triggering a report subscription. A successful submission only means the request was accepted. If it times out, check run history before retrying to avoid duplicate triggers.
Permissions and capability boundaries
- Results follow the current user's resource permissions, organizational scope, and row- and column-level permissions.
- Availability of Metric Platform, Metric Tree, and ChatBI depends on service versions, enabled modules, and the permissions of the current user and credentials.
- GuanMCP is suitable for searching resources, reading configurations, and querying data. It is unsuitable for creating, modifying, or publishing BI resources or exporting large volumes of detailed data.
Troubleshooting
This page does not repeat detailed troubleshooting steps. For HTTP, session, stdio, pagination, UTF-8, or SQL issues, see GuanMCP Troubleshooting.