Skill Composition: Multi-Skill Collaboration + MCP Composition

Today we move to Multi-Skill Collaboration + MCP Composition, which is important because it connects the Skill design capabilities with MCP Tools / Servers.

What does “Skill Composition” mean?

什么叫 Skill Composition?Composition means combining multiple specialized capabilities to accomplish a larger task.
Composition 的意思就是把多个专业能力组合起来完成一个更大的任务。

Multi-Skill = an Agent has multiple specialized capabilities and selects and combines them according to the task.
Multi-Skill = 一个 Agent 拥有多个专业能力,并根据任务选择和组合这些能力。

We have already learned that a Skill is a capability/work procedure, while an MCP Tool is an external execution capability.
Skill 是“能力/工作方法”,MCP Tool 是“外部执行能力”。

This topic addresses a practical problem: a real Agent cannot realistically have only one capability or call only one Tool.
一个真实 Agent 不可能只会一种能力,也不可能只调用一个 Tool。

MCP Composition = Skills do not implement every external operation themselves; they obtain external capabilities such as databases, APIs, filesystems, and Databricks through MCP.
MCP Composition = Skill 不直接实现所有外部操作,而是通过 MCP 获得数据库、API、文件系统、Databricks 等外部能力。

So, we can simply think this:

Skill = “我知道怎么做”
Skill = “I know how to do it.”

MCP Tool = “我有办法真正去做”
MCP Tool = “I have the ability to actually do it.”

LLM/Agent = “我决定什么时候做什么”
LLM/Agent = “I decide what to do and when to do it.”

ConceptEnglish中文
SkillDefines how to accomplish a capability定义如何完成一个能力
ToolDefines an executable operation定义一个可以执行的操作
AgentDecides what to do决定做什么
MCPProvides standardized access to external capabilities提供标准化的外部能力访问方式

Think about it like a human organization.
可以把它想象成人类组织。

Agent = Manager
Agent = 经理

Skill = Expert’s operating procedure
Skill = 专家的工作方法

Tool = Equipment the expert can use
Tool = 专家可以使用的工具

MCP = Standard interface connecting the expert to external equipment
MCP = 连接专家与外部工具的标准接口

Imagine that you have an AI Data Engineering Team, there are three experts in this team. They are: SQL Developer, Data Quality Engineer and Pipeline Auditor.

CapabilitiesSkillMCP
SQL DeveloperSQL Generation SkillDatabricks MCP
Data Quality EngineerDQ Report SkillDatabricks MCP
Pipeline AuditorPipeline Audit SkillDatabricks MCP

The team receiced this “Inspect the sales_orders pipeline, identify data-quality issues, generate SQL validations, and give me a report.”
“检查 sales_orders pipeline,找出数据质量问题,生成 SQL 验证,并给我一份报告。”

Agent may work this way:
User Request
│
▼
Agent
│
├── Pipeline Audit Skill
│ │
│ └── MCP → Databricks
│
├── SQL Generator Skill
│ │
│ └── MCP → Databricks
│
└── DQ Report Skill
│
└── MCP → Databricks

The Agent does not put all logic into one giant Skill. Instead, each Skill focuses on one clearly defined responsibility.
Agent 不是把所有逻辑塞进一个巨大 Skill。而是让每个 Skill 专注一个明确的职责。

Who should coordinate the Skills?

谁负责协调这些 Skill?Normally, Skill A should not directly control Skill B. Instead, the Agent or Orchestrator should coordinate them.
通常情况下,Skill A 不应该直接控制 Skill B。相反,应该由 Agent 或 Orchestrator 来协调它们。

             Agent
               │
   ┌───────────┼───────────┐
   │           │           │
   ▼           ▼           ▼
Skill A     Skill B     Skill C

The Agent decides which capability is needed. The Skill provides the instructions and workflow for that capability. This gives us a clean separation of responsibilities.
Agent 决定需要哪个能力。Skill 提供该能力所需要的 Instructions 和 Workflow。这样就实现了清晰的职责分离。

Skill Composition 的核心思想

Why we need Multi-Skill? A Skill can eventually contain thousands of lines of instructions. The LLM may have to process a large amount of information unrelated to the current task. This reduces focus, maintainability, and reliability.

First principle: One Skill should have one coherent capability
第一个原则:一个 Skill 应该负责一个内聚的能力

A Skill should have a clear purpose and a reasonably narrow scope.
一个 Skill 应该有明确的目的和相对清晰的职责范围。

A simple MCP Tool

from mcp.server.fastmcp import FastMCP


# Create the MCP Server.
# 创建 MCP Server。
#
# The MCP Server exposes external capabilities to an Agent.
# MCP Server 把外部系统能力暴露给 Agent。
mcp = FastMCP("Databricks MCP Server")


@mcp.tool()
def execute_sql(sql: str) -> str:
    """
    Execute SQL in Databricks.
    在 Databricks 中执行 SQL。
    
    This function represents an executable operation.
    这个函数代表一个可以执行的操作。
    """

    # In a real implementation, this section would connect
    # to Databricks and execute the SQL statement.
    # 在真实实现中,这里会连接 Databricks 并执行 SQL。

    # We return a simulated result for learning purposes.
    # 为了教学目的,这里返回一个模拟结果。
    return f"SQL executed: {sql}"


@mcp.tool()
def get_table_schema(table_name: str) -> str:
    """
    Retrieve table schema.
    获取表结构。
    """

    # In a real system, this would query Databricks metadata.
    # 在真实系统中,这里应该查询 Databricks metadata。
    return (
        f"Schema for {table_name}: "
        "customer_id, order_id, order_date, amount"
    )


# Start the MCP server.
# 启动 MCP Server。
if __name__ == "__main__":
    mcp.run()

Comparison of MCP vs REST API

MCP vs REST API is not a battle between two competing technologies. Rather, it’s about understanding two different paradigms for different consumers. REST API is a general-purpose interface designed for human developers to build software integrations. MCP (Model Context Protocol) is an AI-native protocol designed for AI agents to discover and use tools dynamically.

CN:
MCP与REST API的对比,不是两种竞争技术的对决,而是理解两种面向不同消费者的不同范式。REST API是面向人类开发者的通用接口,用于构建软件集成。MCP(模型上下文协议)是面向AI Agent的AI原生协议,用于动态发现和使用工具。

MCP 和 REST API 是 互补的,而非竞争关系。

维度 (Aspect)REST APIMCP
设计目标人类可读的Web APIAI优化的上下文交换
通信协议HTTP/1.1JSON-RPC 2.0
数据格式JSON/XMLJSON
接口设计资源导向上下文导向
状态管理无状态有状态,持久会话
发现机制静态API文档动态能力协商
实时性轮询/WebSocket内置通知
错误处理HTTP状态码结构化错误对象
学习曲线低低-中等
典型用途CRUD API需要动态外部访问的AI系统

Key Takeaways 

要点 (Key Point)ENCN
MCP不替代RESTMCP doesn’t replace REST; it wraps itMCP不替代REST,而是包装REST
不同消费者REST serves developers; MCP serves AI agentsREST服务于开发者;MCP服务于AI Agent
状态管理REST is stateless; MCP maintains stateful sessionsREST无状态;MCP维护有状态会话
发现机制REST requires static docs; MCP enables dynamic discoveryREST需要静态文档;MCP支持动态发现
N×M问题REST = N×M integrations; MCP = N+M componentsREST = N×M个集成;MCP = N+M个组件
通信协议REST uses HTTP/1.1; MCP uses JSON-RPC 2.0REST使用HTTP/1.1;MCP使用JSON-RPC 2.0
安全模型REST uses token-based auth; MCP uses capability-based permissionsREST使用基于令牌的认证;MCP使用基于能力的权限
架构分层MCP is the AI-native layer above your REST APIsMCP是你的REST API之上的AI原生层

MCP Architecture Overview

MCP stands for Model Context Protocol. It is an open standard introduced by Anthropic in November 2024 that standardizes how AI applications communicate with external data sources and tools.

Think of it as the USB-C port for AI applications — a universal, standardized interface that lets any AI model (Claude, GPT, DeepSeek, etc.) plug into any external tool, database, or service without custom integration code.

CN:

MCP 全称 Model Context Protocol(模型上下文协议) 。它是 Anthropic 在 2024 年 11 月推出的一个开放标准,用于标准化 AI 应用与外部数据源和工具之间的通信方式。

你可以把它理解为 AI 应用的 USB-C 接口 —— 一个通用的标准化接口,让任何 AI 模型(Claude、GPT、DeepSeek 等)都能即插即用地接入任何外部工具、数据库或服务,而无需编写定制化的集成代码。

MCP Architecture Overview — Core Concepts

MCP follows a client-host-server architecture.

3.1 Three Core Participants

三个核心角色

① Host(主机) — The AI application itself (e.g., Claude Desktop, Claude Code, an IDE).

The host acts as the container and coordinator:

  • Creates and manages multiple client instances
  • Controls client connection permissions and lifecycle
  • Enforces security policies and consent requirements
  • Handles user authorization decisions
  • Coordinates AI/LLM integration and sampling
  • Manages context aggregation across clients

② Client(客户端) — Created by the host, each client maintains a 1:1 dedicated connection with exactly one server.

Each client:

  • Communicates with exactly one server
  • Attaches protocol version and capabilities to every request
  • Routes protocol messages bidirectionally
  • Manages subscriptions and notifications
  • Maintains security boundaries between servers

③ Server(服务器) — A program that provides specialized context and capabilities to AI applications.

Each server:

  • Exposes Resources, Tools, and Prompts via MCP primitives
  • Operates independently with focused responsibilities
  • Can be local processes (STDIO transport) or remote services (HTTP/SSE transport)
  • Must respect security constraints — cannot read the whole conversation or “see into” other servers

CN:

① Host(主机) — AI 应用本身(如 Claude Desktop、Claude Code、IDE)。

主机扮演 容器和协调器 的角色:

  • 创建和管理多个客户端实例
  • 控制客户端连接权限和生命周期
  • 执行安全策略和同意要求
  • 处理用户授权决策
  • 协调 AI/LLM 集成和采样
  • 管理跨客户端的上下文聚合

② Client(客户端) — 由主机创建,每个客户端与一个服务器保持 1:1 专属连接。

每个客户端:

  • 只与一个服务器通信
  • 在每个请求中附加协议版本和能力信息
  • 双向路由协议消息
  • 管理订阅和通知
  • 维护服务器之间的安全边界

③ Server(服务器) — 向 AI 应用提供专业上下文和能力的程序。

每个服务器:

  • 通过 MCP 原语暴露 Resources(资源)、Tools(工具)和 Prompts(提示模板)
  • 独立运行,职责聚焦
  • 可以是本地进程(STDIO 传输)或远程服务(HTTP/SSE 传输)
  • 必须遵守安全约束 —— 不能读取整个对话,也不能“看到”其他服务器

3.2 Two Layers

MCP consists of two layers:

LayerENCN
Data LayerDefines the JSON-RPC based protocol for client-server communication, including lifecycle management, and core primitives (tools, resources, prompts, notifications)定义基于 JSON-RPC 的客户端-服务器通信协议,包括生命周期管理、核心原语(工具、资源、提示模板、通知)
Transport LayerDefines communication mechanisms and channels (STDIO, HTTP/SSE) for data exchange, including connection establishment, message framing, and authorization定义通信机制和通道(STDIO、HTTP/SSE),包括连接建立、消息帧和授权

CN:

MCP 由两层组成:

层ENCN
数据层Defines the JSON-RPC based protocol for client-server communication, including lifecycle management, and core primitives (tools, resources, prompts, notifications)定义基于 JSON-RPC 的客户端-服务器通信协议,包括生命周期管理、核心原语(工具、资源、提示模板、通知)
传输层Defines communication mechanisms and channels (STDIO, HTTP/SSE) for data exchange, including connection establishment, message framing, and authorization定义通信机制和通道(STDIO、HTTP/SSE),包括连接建立、消息

3.3 Three Core Primitives

三种核心原语

MCP servers expose three types of primitives to AI applications:

PrimitiveENCNControl
PromptsPre-defined templates or instructions that guide language model interactions预定义的模板或指令,用于引导语言模型的交互User-controlled (用户控制)
ResourcesStructured data or content that provides additional context to the model结构化的数据或内容,为模型提供额外的上下文Application-controlled (应用控制)
ToolsExecutable functions that allow models to perform actions or retrieve information可执行的函数,允许模型执行操作或检索信息Model-controlled (模型控制)

3.4 Design Principles

MCP is built on four key design principles:

1. Servers should be extremely easy to build(服务器应该极易构建)

  • Host applications handle complex orchestration
  • Servers focus on specific, well-defined capabilities
  • Simple interfaces minimize implementation overhead

2. Servers should be highly composable(服务器应该高度可组合)

  • Each server provides focused functionality in isolation
  • Multiple servers can be combined seamlessly
  • Shared protocol enables interoperability

3. Servers should not be able to read the whole conversation(服务器不应能读取完整对话)

  • Servers receive only necessary contextual information
  • Full conversation history stays with the host
  • Each server maintains isolation — cannot “see into” other servers
  • Cross-server interactions are controlled by the host

4. Features can be added progressively(功能可渐进式添加)

  • Core protocol provides minimal required functionality
  • Additional capabilities can be negotiated as needed
  • Backwards compatibility is maintained

CN:

MCP 建立在四个关键设计原则之上:

1. 服务器应该极易构建

  • 主机应用处理复杂的编排工作
  • 服务器聚焦于具体、明确定义的能力
  • 简单接口最小化实现开销

2. 服务器应该高度可组合

  • 每个服务器独立提供聚焦的功能
  • 多个服务器可以无缝组合
  • 共享协议实现互操作性

3. 服务器不应能读取完整对话

  • 服务器只接收必要的上下文信息
  • 完整对话历史保留在主机
  • 每个服务器保持隔离 —— 不能“看到”其他服务器
  • 跨服务器交互由主机控制

4. 功能可渐进式添加

  • 核心协议提供最小必需功能
  • 额外能力可按需协商
  • 保持向后兼容性

3.5 Capability Negotiation

MCP uses a capability-based negotiation system. During initialization, clients and servers explicitly declare what features they support.

  • Servers declare: tool support, resource subscriptions, prompt templates
  • Clients declare: sampling support, elicitation handling
  • Both parties must respect declared capabilities throughout the session
  • Additional capabilities can be negotiated through protocol extensions

This ensures clients and servers have a clear understanding of supported features while keeping the protocol extensible.

CN:

MCP 使用 基于能力的协商系统 。在初始化期间,客户端和服务器明确声明它们支持的功能。

  • 服务器声明:工具支持、资源订阅、提示模板
  • 客户端声明:采样支持、elicitation 处理
  • 双方在整个会话期间必须遵守已声明的能力
  • 额外能力可通过协议扩展协商

这确保客户端和服务器对支持的功能有清晰的理解,同时保持协议的可扩展性。

3.6 Stateful vs Stateless

有状态 vs 无状态 

Important note: The MCP specification has evolved. Earlier versions (2025-06-18) described MCP as a “stateful session protocol.” However, the July 28, 2026 revision made MCP stateless at its core — every request is self-contained and carries its own protocol version and capabilities.

This change:

  • Removes the need for session affinity
  • Simplifies horizontal scaling and load balancing
  • Makes the protocol easier to operate at scale

For our learning purposes, we’ll focus on the current stateless model while understanding that the SDKs abstract away most of these concerns.

CN:

重要提示: MCP 规范已经演进。早期版本(2025-06-18)将 MCP 描述为“有状态会话协议”。 但是,2026 年 7 月 28 日的修订 使 MCP 在核心层面变为 无状态 —— 每个请求都是自包含的,携带自己的协议版本和能力信息。

这一变化:

  • 消除了对会话亲和性的需求
  • 简化了水平扩展和负载均衡
  • 使协议更易于大规模运维

就我们的学习目的而言,我们将聚焦于 当前的无状态模型,同时理解 SDK 抽象了大部分这些 concerns。

Key Takeaways

要点ENCN
MCP 全称Model Context Protocol, introduced by Anthropic in Nov 2024模型上下文协议,Anthropic 于 2024 年 11 月推出
MCP 类比USB-C port for AI applicationsAI 应用的 USB-C 接口
架构模式Client-Host-Server architecture客户端-主机-服务器架构
三个核心角色Host (coordinator) → Client (1:1 connection) → Server (capability provider)主机(协调器)→ 客户端(1:1 连接)→ 服务器(能力提供者)
两层架构Data Layer (JSON-RPC) + Transport Layer (STDIO/HTTP-SSE)数据层(JSON-RPC)+ 传输层(STDIO/HTTP-SSE)
三种原语Prompts (user-controlled), Resources (app-controlled), Tools (model-controlled)Prompts(用户控制)、Resources(应用控制)、Tools(模型控制)
四大设计原则Easy to build, Composable, Isolated (can’t read full conversation), Progressively extensible易于构建、可组合、隔离(不能读完整对话)、渐进可扩展
能力协商Clients and servers declare supported features during initialization客户端和服务器在初始化时声明支持的功能
MCP vs RESTComplementary, not competing — MCP is AI-native, REST is general-purpose互补而非竞争 —— MCP 是 AI 原生的,REST 是通用目的的
最新变化July 2026 revision made MCP stateless at its core2026 年 7 月修订使 MCP 在核心层面变为无状态