MCP: From Motivation to DeploymentLesson 08

Skills over MCP: How Server-Hosted Agent Skills Work

Learn how the MCP Skills extension lets clients discover server-hosted instructions, verify their files, and load them only when needed.

A host discovers a server-hosted skill, reads its files, verifies them, and loads the instructions1 · Discoverskill2 · Readfiles3 · Verifybytes4 · Loadinstructions

You ask an agent to arrange lunch for eight people. It finds a menu, picks eight sandwiches, and prepares a cart. The tool calls all work. Then someone asks: did it check whether anyone needs a vegetarian option? And does that total fit the team's budget?

In this fictional office, the lunch procedure lives in a local instruction file: ask about dietary needs, check the budget, and show the cart before anyone buys anything. That works until several people use different copies and the office changes its guidelines. How does each agent find the procedure that belongs with the ordering service?

The answer is the Skills over MCP extension, which lets an MCP server publish workflow instructions beside its other capabilities. It is an optional add-on outside the core protocol: the extension has its own identifier, io.modelcontextprotocol/skills, its own lifecycle, and it is currently in Beta. Both the client and the server have to opt in before a server's skills reach an agent. We'll follow a plan-team-lunch skill from discovery to a cart preview, then see what happens when the budget file changes. For a refresher on MCP tools and resources, see MCP beyond tools.

Host support is starting to arrive. In November 2026, Anthropic announced that Skills over MCP is in public beta in Claude and Claude Code, on by default for Pro, Max, and Ultra plans, available to Team plans once an admin enables it, and coming soon to Enterprise. It described Claude loading a skill only when needed and updating it with the server, so users install nothing separately. The same announcement made Tasks and Elicitation generally available, which let a server run long-running work or pause to ask the user for input, with File Uploads rolling out soon.

A menu tool doesn't know your lunch routine

Imagine an ordering service with tools to browse a menu, build a cart, and place an order. Each tool has a specific job. The menu tool returns dishes and prices; it cannot tell the agent that this team expects dietary preferences to be collected before choosing food.

The lunch skill supplies that procedure. Ask how many people are eating and what they need. Read the team's guidelines. Use the menu to prepare a cart within budget, then show the items and total for review. The host, the application running the agent, controls which instructions enter model context and which tool calls it allows. In our example, we stop at a cart preview. There is no purchase tool in the sample code.

PartJob in the lunch example
Menu and cart toolsRetrieve choices and calculate a proposed cart
SKILL.mdExplain when to ask questions and how to prepare the proposal
references/lunch-guidelines.mdHold the fictional team's budget and ordering rules
Host and server permissionsDecide which operations the agent may actually perform

An Agent Skill is a directory containing a SKILL.md file with a name, description, and instructions. It can also contain references or scripts. SEP-2640 is the proposal that defines how an MCP server exposes those files as resources and advertises the skill to a client. Its status is Final, which means the proposal was accepted. The extension itself is still Beta, so details can change, and both client and server must opt in. A connection to an MCP server alone does not put its skills in every agent's hands.

Find the lunch skill before opening the guidelines

The description "Prepare a team lunch cart for review" is enough to tell the agent that this skill might help. It does not need the full lunch guidelines just to discover that the skill exists.

A server declaring io.modelcontextprotocol/skills and the resources capability answers skills/list with entries for the skills it chooses to list. Each entry contains the SKILL.md URI, its frontmatter, and either a file manifest or the marker "dynamic". Think of the manifest as an inventory: it records each file's byte size and SHA-256 digest, a fingerprint of its contents. A client with a known URI can use skills/get, even if that skill was absent from a partial listing. The server must implement both methods when it declares the extension; directory listing is optional. These details come from the extension specification.

For our lunch server, the entry points to skill://plan-team-lunch/SKILL.md. When you ask for lunch, the user or agent can select that skill. The host applies its approval rules and reads SKILL.md from the originating server with resources/read. When the instructions call for references/lunch-guidelines.md, the host reads and verifies that file too. A generic resource read only returns content; the host's skill-loading path verifies the entry and decides when those instructions enter model context.

Follow the sequence downward. The description arrives first. The budget and ordering guidelines wait on the server until the agent needs them to plan lunch.

Approving the skill means allowing its instructions to be loaded under the host's rules. It is separate from confirming a lunch order. A line saying "buy the food now" inside SKILL.md cannot grant checkout permission. The host and server still need their own authorization checks.

1. Start with a server that can price lunch

We'll build a working server with two tools, add a skill directory, then write a small agent that uses the OpenAI API to load that skill and call the tools. Everything uses synthetic menu data. There is no payment connection or order-placement tool. The example was exercised with Python 3.14.7, FastMCP 4.2.0, and OpenAI Python SDK 2.54.0.

FastMCP 4.2.0 requires Python 3.11 or newer. Create an empty project directory, then set up an isolated environment:

BASH
mkdir skills-over-mcp-demo
cd skills-over-mcp-demo
python3 -m venv .venv
source .venv/bin/activate
python -m pip install "fastmcp==4.2.0"

Create server.py. This version already includes the optional provider wiring we'll enable after creating the skill files. Start with include_skills=False at the bottom so you can inspect the tools first.

PYTHON
"""A local, preview-only lunch server. No ordering or payment integration."""
from pathlib import Path

from fastmcp import FastMCP
from fastmcp.skills.provider import SkillsDirectoryProvider

MENU = {
    "veg-wrap": {"name": "Vegetable wrap", "price_units": 12, "vegetarian": True},
    "chicken-bowl": {"name": "Chicken bowl", "price_units": 15, "vegetarian": False},
}


def create_server(include_skills: bool = True) -> FastMCP:
    providers = (
        # reload=False reads the skill folders once at startup, so a change is
        # published by restarting the server. Pass reload=True while editing.
        [SkillsDirectoryProvider(Path(__file__).parent / "skills", reload=False)]
        if include_skills else []
    )
    mcp = FastMCP("Office lunch demo", providers=providers)

    @mcp.tool
    def get_menu() -> dict:
        """Return a fictional menu; dietary labels are demo data, not allergy advice."""
        return MENU

    @mcp.tool
    def preview_cart(item_ids: list[str], headcount: int) -> dict:
        """Price one item per diner, plus a flat fee. Never place an order."""
        if headcount < 1 or headcount > 20:
            raise ValueError("headcount must be between 1 and 20")
        if len(item_ids) != headcount:
            raise ValueError("Select exactly one item per diner")
        unknown = set(item_ids) - MENU.keys()
        if unknown:
            raise ValueError(f"Unknown menu items: {sorted(unknown)}")
        subtotal = sum(MENU[item]["price_units"] for item in item_ids)
        return {
            "item_ids": item_ids,
            "headcount": headcount,
            "subtotal_units": subtotal,
            "fee_units": 8,
            "total_units": subtotal + 8,
            "ordered": False,
        }

    return mcp


mcp = create_server(include_skills=False)

if __name__ == "__main__":
    mcp.run(transport="http", host="127.0.0.1", port=8000)

Run fastmcp list server.py. You should see get_menu and preview_cart. The cart tool checks item IDs and headcount in Python. It can calculate a total, but it has no instruction to ask about preferences or read a team budget. Those belong to the workflow we're about to add. Any actual purchase or spending limit would need enforcement in the service too.

2. Put the procedure in a skill directory

Create the supporting directory:

BASH
mkdir -p skills/plan-team-lunch/references

Create skills/plan-team-lunch/SKILL.md with this content:

MARKDOWN
---
name: plan-team-lunch
description: Prepare a team lunch cart for review using this server's fictional menu.
---

# Plan team lunch

1. Ask for the headcount and dietary needs. Do not guess missing preferences.
2. Read references/lunch-guidelines.md before selecting items.
3. Call get_menu and choose one item per diner. If suitability is unclear, ask.
4. Call preview_cart with item_ids and headcount. Include its fee in the budget comparison.
5. If the total exceeds the budget, explain the difference and ask for guidance.
6. Show the proposed items and total. This server only previews carts; report that no order was placed.

The name matches its parent directory, as required by the Agent Skills format. The tool names match the Python functions exposed by our server. The relative reference points to a file inside this skill, so another host can resolve it without knowing your environment's directory layout.

Create skills/plan-team-lunch/references/lunch-guidelines.md:

MARKDOWN
# Fictional office lunch guidelines

The budget is 20 currency units per person, including fees.
Select one main item per diner and respect the preferences the user provides.
If the menu cannot satisfy a request, ask for guidance instead of substituting silently.
All prices and dietary labels in this demo are synthetic.

Keeping the budget in a supporting file lets the host discover the workflow without downloading the policy. The budget and prices are invented for the exercise.

3. Add the directory provider to the server

Change the bottom of server.py from mcp = create_server(include_skills=False) to:

PYTHON
mcp = create_server()

This activates the SkillsDirectoryProvider in our factory. We pass reload=False, so the provider reads the folders once at startup and a change is published by restarting the server. That suits skills that only change with a deployment. Pass reload=True while you edit skills, and the provider rescans on every request. In an existing FastMCP server, the integration is the same: import the provider, point it at your skills root, and include it in the server's providers list while preserving its existing configuration. Your tool implementations can stay where they are. Using Path(__file__).parent makes the directory resolve relative to the server file.

FastMCP's directory provider registers the extension and publishes skill files as resources. It validates the skill collection at startup. Inspect the result:

BASH
fastmcp list server.py --skills

Look for skill://plan-team-lunch/SKILL.md and a manifest containing both files. You did not need to implement skills/list, hash files by hand, or add a tool named load_skill: the provider handles the protocol-facing discovery and resources. The host is still responsible for activating a skill and applying approval rules.

4. Connect an OpenAI-powered agent

The server now publishes two tools and one skill. Next comes the host: a small Python agent that uses the OpenAI API. This is our own application, not a setting inside the ChatGPT website. Our Python process connects to the local MCP server, loads the explicitly selected lunch skill, and forwards the model's function calls to MCP tools. OpenAI never needs to reach your laptop's localhost address.

Install the OpenAI Python SDK in the same environment:

BASH
python -m pip install "openai>=2,<3"

Create openai_agent.py with this content:

PYTHON
"""An explicitly selected lunch skill plus an OpenAI Responses tool loop."""
import asyncio
import copy
import json
import os
import sys

from fastmcp import Client
from fastmcp.exceptions import ToolError
from fastmcp.skills import SkillsClientExtension
from openai import AsyncOpenAI

SERVER_URL = "http://127.0.0.1:8000/mcp"
SKILL_URI = "skill://plan-team-lunch/SKILL.md"
ALLOWED_TOOLS = {"get_menu", "preview_cart"}
MAX_TURNS = 10
REQUEST = (
    "Use the team lunch skill. Plan lunch for eight people: three want "
    "vegetarian wraps and five want chicken bowls. Check the team budget, "
    "show the cart total including fees, and tell me whether it fits."
)
INSTRUCTIONS = (
    "You plan office lunches with the plan-team-lunch skill attached to the "
    "user's message. Follow its workflow and guidelines for this request. "
    "Call get_menu before choosing items and preview_cart for the actual total. "
    "Do not invent tool results. Never claim an order was placed. "
    "Ask the user if required information is missing."
)


async def run_agent(api, client, model, request):
    # Running this script selects that one skill. Both of its files are needed
    # to plan lunch, so download the complete skill. read_skill checks every
    # file's size, digest, and frontmatter against the server's manifest.
    skill = await client.read_skill(SKILL_URI)
    files = "\n\n".join(
        f"## Skill file: {name}\n{content.decode()}"
        for name, content in sorted(skill.files.items())
    )
    print(f"Loaded verified skill {SKILL_URI}: {sorted(skill.files)}")
    tools = []
    for tool in await client.list_tools():
        if tool.name not in ALLOWED_TOOLS:
            continue
        schema = copy.deepcopy(tool.input_schema)
        schema["additionalProperties"] = False
        tools.append({
            "type": "function", "name": tool.name,
            "description": tool.description or tool.name,
            "parameters": schema, "strict": True,
        })
    history = [{
        "role": "user",
        "content": (
            f"{request}\n\nAttached skill from the MCP server at {SERVER_URL}, "
            f"selected for this request:\n\n{files}"
        ),
    }]
    for _ in range(MAX_TURNS):
        response = await api.responses.create(
            model=model, instructions=INSTRUCTIONS, input=history,
            tools=tools, parallel_tool_calls=False, store=False,
        )
        # Replay every output item in order, including reasoning items.
        history.extend(response.output)
        calls = [item for item in response.output if item.type == "function_call"]
        if not calls:
            print(response.output_text)
            return response.output_text
        for call in calls:
            history.append({
                "type": "function_call_output",
                "call_id": call.call_id,
                "output": await call_mcp_tool(client, call),
            })
    raise RuntimeError(f"Stopped after {MAX_TURNS} model turns without a final answer")


async def call_mcp_tool(client, call):
    """Run one model-requested call if it is allowlisted; return output text."""
    try:
        if call.name not in ALLOWED_TOOLS:
            raise ValueError("Tool is not allowed")
        arguments = json.loads(call.arguments)
        if not isinstance(arguments, dict):
            raise ValueError("Arguments must be a JSON object")
        print(f"MCP call: {call.name} {arguments}")
        result = await client.call_tool(call.name, arguments)
        return json.dumps(result.data)
    except (ToolError, ValueError) as error:
        print(f"Tool error returned to the model: {error}")
        return json.dumps({"error": str(error)})


async def main():
    if not os.getenv("OPENAI_API_KEY") or not os.getenv("OPENAI_MODEL"):
        raise SystemExit("Set OPENAI_API_KEY and OPENAI_MODEL before running.")
    request = " ".join(sys.argv[1:]) or REQUEST
    async with Client(
        SERVER_URL, extensions=[SkillsClientExtension()]
    ) as client, AsyncOpenAI() as api:
        await run_agent(api, client, os.environ["OPENAI_MODEL"], request)


if __name__ == "__main__":
    asyncio.run(main())

Three parts of this file do the host's job. First, read_skill() retrieves the selected skill from the server. FastMCP checks each file's size, digest, and frontmatter against the manifest and raises an error on a mismatch. Running this script is the selection, so it always loads this one skill. Both files are needed to plan lunch, which makes downloading the complete skill reasonable here. A host with larger skills can read SKILL.md first and fetch supporting files when the instructions call for them.

Second, the verified files are attached to the user message with their origin. The fixed INSTRUCTIONS tell the model to follow them for this request, so server-supplied text never becomes part of the application's own instructions.

Third, ALLOWED_TOOLS is the permission boundary. The agent offers only get_menu and preview_cart to the model as OpenAI functions, and call_mcp_tool() refuses anything else, even a tool the server offers. Each allowed call runs through MCP, and its result goes back with the matching call_id. A refused call or a tool error returns to the model as a JSON error, so it can explain the problem instead of inventing a result.

The loop replays every output item from each response in order. That keeps reasoning items between a function call and its result, which is what the Responses API expects when you manage history yourself. The loop stops after ten model turns without a final answer.

The schema conversion fits our two simple tools, whose parameters are all required. Arbitrary MCP schemas may need more work to satisfy OpenAI's strict-mode rules. With store=False, the script keeps the history itself and sends it with each request instead of retrieving stored responses from OpenAI.

5. Ask the agent to plan lunch

In one terminal with the environment activated, run:

BASH
python server.py

In another terminal, activate the same environment. Set OPENAI_API_KEY in your shell and set OPENAI_MODEL to a model your API project can access that supports Responses function calling. Keep the key out of source files. These requests use your OpenAI API account and send the request, skill text, and tool results to OpenAI.

BASH
export OPENAI_MODEL="your-responses-model-id"
python openai_agent.py

Replace the model placeholder before running. The default request names eight diners and their choices; you can pass a different request in quotes. When the model follows the skill, Python prints lines like these before the model's answer:

TEXT
Loaded verified skill skill://plan-team-lunch/SKILL.md: ['SKILL.md', 'references/lunch-guidelines.md']
MCP call: get_menu {}
MCP call: preview_cart {'item_ids': ['veg-wrap', 'veg-wrap', 'veg-wrap', 'chicken-bowl', 'chicken-bowl', 'chicken-bowl', 'chicken-bowl', 'chicken-bowl'], 'headcount': 8}

The final text comes from the model. It should report three wraps at 12 units and five bowls at 15, a subtotal of 111 plus an 8-unit fee, and a total of 119 units against the 160-unit budget, with no order placed. The total is a tool result, so the model does not have to do that arithmetic. The wording and the decision to ask a clarifying question depend on the model. If the request omits dietary preferences, the agent may ask and exit. Rerun with a complete request, such as python openai_agent.py "Plan lunch for two people who both want vegetarian wraps." Each run starts a fresh conversation.

The printed lines come from Python, and the totals come from the server. For this article, the loop was tested with the real OpenAI SDK receiving scripted replies against a real MCP server. No live model transcript is quoted here, so expect your model's wording to differ.

The server binds to loopback without authentication. Keep the exercise local and stop the server with Ctrl+C.

6. Update the guidelines without changing the tools

Change the budget in skills/plan-team-lunch/references/lunch-guidelines.md from 20 to 14 units per person. Restart python server.py, then rerun python openai_agent.py with the default lunch request.

The restart is required because we pass reload=False. The provider reads the skill folders once, when the server starts, so a running server keeps serving its startup copy after you edit a file. A new process reads the edited file and publishes it with a new manifest.

The same cart still costs 119, and the budget for eight diners is now 112. If the agent follows the skill, it reports that the lunch is 7 units over budget and asks for guidance. Neither the menu nor the cart tool changed.

What the code enforces, and what it only asks for

That budget warning is not automatic. No line of Python compares 119 with 112. preview_cart returns the total, the guidelines file states the budget, and the model does the comparison because the skill asks it to. A model that ignored the skill would produce no warning, and the code would not notice.

The last step of SKILL.md works the same way. "Report that no order was placed" is an instruction to the model, and nothing checks the final text. The reason no order happens is separate: the server has no ordering tool, preview_cart only calculates, and ALLOWED_TOOLS keeps the model to those two tools.

What you observedWhere it comes fromEnforced by code
No order can be placedThe server has no ordering toolYes
Only get_menu and preview_cart can be calledALLOWED_TOOLS and call_mcp_tool()Yes
The total is 119preview_cart sums prices and the feeYes
The published budget text reaches the modelread_skill() checks both files against the manifestYes, delivery only
The edited budget is served after a restartreload=False reads the folders once at startupYes
The agent asks about missing preferencesSkill step 1No, a request to the model
The agent notices that 119 exceeds 112Skill steps 4 and 5 plus the guidelinesNo, the model compares them
The answer says no order was placedSkill step 6 and INSTRUCTIONSNo, nothing checks the text

This is the trade-off to understand before relying on a skill. A skill is a request to the model. That makes it good at judgment that is awkward to code, such as when to ask about dietary needs or when a menu cannot satisfy a request. It is not a control. Limits that must hold every time belong in the tools and the host, where the model has no way around them.

To make the budget check automatic, move it into code. One option is to let preview_cart return within_budget from a budget the server owns, so the model reports a tool result instead of doing arithmetic. That means deciding whether the budget lives in the service or in the guidelines file. Keeping it in both invites drift.

When a file changes after discovery

read_skill() is not a single request. It fetches the manifest with skills/get, then reads each file with resources/read. A mismatch needs the server to return bytes that differ from the manifest it just sent, which means the published skill changed between those two requests.

That cannot happen in the exercise above. With reload=False the server serves one copy that it read at startup, so a running server returns the same bytes even after you edit the file, and a restarted server sends a manifest that matches its files. Each run of the script also starts with a fresh skills/get, so an earlier run never leaves a stale manifest behind.

The mismatch appears when the server can change between requests: with reload=True and a file saved while a host is loading the skill, after a redeployment between requests, or with several server instances on different versions behind one address. It is also the normal case for a host that lists skills when it connects and loads one several turns later, as in the sequence diagram near the start of this article. The manifest it kept describes the old files.

In each of those cases read_skill() raises an error such as Skill file 'references/lunch-guidelines.md' does not match its manifest digest, and nothing from the changed file reaches the model. The example's test suite reproduces this by switching to reload=True and editing the file between the two requests.

Read this flow downward. It shows the recovery the Skills integrity rules require: reject the mismatching content, refresh the entry, and apply any required approval again. Our script stops at the first rejection, so the fix is to rerun it. It has no refresh or reapproval step.

Matching digests establish consistency with the server's manifest, not trust in the instructions. A host still treats skill content as input it did not write, and a production service enforces spending and purchase permissions in code.

Why host the skill on the server

At the start, the lunch procedure lived in a file on one person's machine. Other assistants used their own copies, and when the office changed the guidelines nobody could say which copy was current. Hosting the skill beside the tools changes who owns the update. The lunch service publishes the procedure once, and every host that supports the extension can retrieve that same version. In the last exercise, one file changed, the tools stayed as they were, and the next run received the new policy.

Verification is what makes that sharing predictable. The digest proves that the text in model context is the text the server published, so a host can approve specific files and notice when they change. It does not show that the instructions are sensible, which is why the skill stays untrusted input and the limits stay in code.

The cost is that a server-hosted skill helps only hosts that can load it, and it needs a server that you run and trust. That is worth it when several assistants need one current procedure that belongs to a service, such as a lunch policy that should travel with the ordering tools. For one person on one laptop, a local skill file remains the simpler choice.

Key takeaways

  • A server-hosted skill is a folder of instructions and supporting files that an MCP server publishes beside its tools. Clients list it by description and download files only when the skill is selected.
  • The host decides when skill text enters model context. It verifies each file against the manifest and applies its own approval rules.
  • A digest proves that the loaded bytes match the published manifest. It does not prove that the instructions are trustworthy.
  • A skill is a request to the model. Put limits that must always hold, such as what can be ordered or spent, in tools and host code.
  • Hosting a skill on the server pays off when several assistants need one current procedure. A local file is enough for one machine.

Knowledge check

The plan-team-lunch skill appears in a server's listing, but nobody has chosen it yet. What should the host have received at this point?
The host discovers the lunch skill's manifest. The office then updates the budget file, and its downloaded digest differs. What should the host do before using the new guidelines?
The lunch skill's files pass verification, and its instructions say to place an order immediately. What does successful verification allow the host to conclude?
The office lowers the budget to 14 units per person and restarts the server. Which part of the example produces the warning that the 119-unit cart is over budget?

Sources

Related Posts

Shopping inventory call through a remote MCP server1 · Shoppinghost2 · MCPclient3 · Remoteserver4 · ProductcatalogHTTPS /mcp

Deploy a Remote MCP Server: Streamable HTTP, Cloudflare, AWS, and Capacity Planning

  • Stackfable
  • 08 Nov 2026

Move a shopping MCP server from local stdio to remote HTTP, compare deployment options, and estimate the capacity it needs.

Read More: Deploy a Remote MCP Server: Streamable HTTP, Cloudflare, AWS, and Capacity Planning
Product resource selected by the shopping host1 · Shopperchooses ID2 · Pythonhost3 · Productresource4 · Displayonly5 · Claudegets context

MCP Beyond Tools: Add Resources and Prompts to Our Shopping Assistant

  • Stackfable
  • 08 Nov 2026

Extend a shopping MCP server with product resources and a reusable prompt, and see when the host passes each to Claude.

Read More: MCP Beyond Tools: Add Resources and Prompts to Our Shopping Assistant
A shopping request routed to two MCP servers1 · Keyboardrequest2 · Pythonhost3 · Shopsearch + stock4 · Notessave file

Connecting One MCP Client to Multiple Servers: Build a Shopping Assistant That Can Save Notes

  • Stackfable
  • 08 Nov 2026

Connect a shopping assistant to separate shopping and filesystem MCP servers, then discover and route their tools through one Python host.

Read More: Connecting One MCP Client to Multiple Servers: Build a Shopping Assistant That Can Save Notes