Introduction to MCP services

更新时间:
复制 MD 格式

The Model Context Protocol (MCP) is an open protocol that provides a channel for information exchange between large models and external tools. Function Compute (FC) is an ideal runtime for hosting MCP services on the cloud and provides elastic invocation capabilities. You can use the built-in MCP service template in Function AI of Function Compute to quickly deploy and experience MCP services.

Why develop and host MCP services in Function Compute?

Function Compute is a serverless computing service that offers elastic scaling and fine-grained resource specifications. It allocates resources and bills based on requests, which helps businesses handle unpredictable traffic in lightweight scenarios.

MCP services hosted as public cloud services in AI scenarios often face unpredictable traffic. Function Compute uses its underlying technology to ensure persistent connections are compatible with pay-as-you-go billing and to balance stateless elasticity with affinity scheduling. By meeting the requirements for MCP Server-Sent Events (SSE) affinity scheduling and leveraging the elasticity of stateless computing, Function Compute allows MCP services to scale out quickly in response to unpredictable traffic.

Billing

  • MCP services hosted in Function Compute are billed on a pay-as-you-go basis for the elastic resources used. No charges are incurred when there are no requests. During request periods, billing is based on the number of requests and resource usage.

  • If an MCP service created in Function Compute is connected to Alibaba Cloud Model Studio, additional invocation or deployment fees from Model Studio apply.

Create an MCP service

Function Compute provides an MCP runtime that supports the SSE protocol and concurrency. Existing STDIO-mode MCP services can be converted to SSE-compliant remote services without any changes.

You can use Function AI to develop an MCP service. The resulting functions automatically include MCP SSE affinity scheduling.

Use an MCP service

After you create an MCP service in Function Compute, you must register it with Alibaba Cloud Model Studio by deploying a custom MCP service in the Alibaba Cloud Model Studio console. Then, you can configure the MCP service in an agent or workflow.

Alibaba Cloud Model Studio agent and workflow applications support MCP services:

  • Agent applications

    Agent applications can connect to multiple MCP services. Each service contains a set of tools. In a single conversation, the agent calls one or more tools.

  • Workflow applications

    You can integrate a single tool from the MCP service as an MCP node.