Alibaba Cloud Bailian provides end-to-end MCP (Model Context Protocol) services — supporting both in-platform configuration (e.g., agents, workflows) and external invocation for integration into third-party applications or personal projects.
- Integration into third-party applications: One-click automatic configuration enables rapid external invocation.
- Integration into personal projects: Use the MCP SDK for flexible coding and deep customization.
Enable MCP Services
Bailian’s MCP service has been upgraded from the legacy SSE protocol to the new Streamable HTTP protocol. Please follow the appropriate steps below based on your situation.
Externally Invoking MCP Services
Integration into Third-Party Applications
Alibaba Cloud Bailian supports configuring MCP services into Cherry Studio and Cursor, with both automatic and manual configuration options. The following uses Amap Maps as an example.
If the model fails to invoke MCP tools, refer to the troubleshooting section below.
Development Integration via SDK
Invoke Alibaba Cloud Bailian MCP services programmatically using the MCP SDK for maximum flexibility.
The example below demonstrates invoking Bailian’s WebSearch MCP service using both the OpenAI SDK and the MCP SDK to perform web searches.
1
Install dependencies
2
Configure Bailian API Key as environment variable
Refer to the Configure Bailian API Key documentation to complete setup.
3
Write code
4
Run the code
Running the script yields the following output:
Frequently Asked Questions (FAQ)
What should I do if I cannot connect to the MCP service?
- MCP service not enabled or not upgraded: Confirm that you have enabled or upgraded the MCP service in the Bailian MCP Plaza.
- Invalid API Key: Ensure you’re using a valid, active Bailian universal API Key.
- Quota exhausted: Some MCP services (e.g., WebSearch) enforce monthly usage quotas. Once exceeded, invocation automatically stops.
The model responds normally and no MCP errors occur, yet MCP tools still fail to invoke — why?
Large language models require explicit instructions to correctly invoke MCP tools. Be sure to clearly specify the tool name and its capabilities in your prompt. Example:“Use the Alibaba Cloud Bailian Amap Maps MCP service to plan a self-driving route from Hangzhou to Shanghai.”