Skip to main content

Skills over MCP

A skill is a folder of instructions, with a SKILL.md file and any templates or scripts it needs, that tells an assistant how to do one job the way your team does it. Spanway can store skills in its own database, as described in store a skill on the gateway. The gateway's MCP endpoint at /mcp now also serves those skills through the standard MCP skills extension, so any MCP client that understands it lists your skills, reads their files and loads them, with no extra setup and no second address to configure. Each caller only sees the skills their own key may read, the same rule the skills API already applies.

A real-world scenario​

A platform team writes a release-notes skill that explains how the company groups changes and words each line, with a weekly template beside it. They store it on the gateway once. Every developer already has their coding assistant connected to the company's Spanway /mcp address for tools. The next time an assistant connects, it asks the gateway which skills exist, sees release-notes with a one-line description, and loads the instructions only when a developer asks for release notes. When the team updates the skill, the file fingerprints in the listing change, so assistants that cached the old version know to fetch the new one. Nobody has to copy skill files to laptops or send around install commands.

What the gateway serves​

The gateway follows the MCP skills extension (identifier io.modelcontextprotocol/skills). It answers three methods on /mcp:

MethodWhat it does
skills/listLists the skills the caller can read, 50 per page. Each entry has the skill's address, its SKILL.md frontmatter, and every file with its SHA-256 fingerprint and size. A nextCursor value fetches the next page.
skills/getReturns one skill's entry by the address of its SKILL.md. It answers for any skill the caller can read.
resources/readReturns one file of a skill, given its skill:// address. Text files come back as text and other files, such as images, as base64.

Every skill address has the form skill://<skill id>/<skill name>/<file path>, for example skill://spanway_skill_3f6c1a2e-8d4b-4c1e-9a7f-2b5d6e8c0a11/release-notes/SKILL.md. The skill id keeps two skills with the same name apart.

A client on MCP protocol version 2026-07-28 sees the extension, together with the resources capability, in the gateway's server/discover answer whenever the caller can read at least one stored skill. Clients on the older protocol versions cannot see extensions in the handshake, because those versions have no field for them, but a client that knows the extension can still call skills/list and skills/get on any version. The methods are not offered on /mcp/proxy, which only serves tools.

Which skills are served​

  1. Only skills stored on the gateway itself, the ones whose id starts with spanway_skill_. Skills kept in a provider account, and Claude Code plugins from the Skills page, are not served here.
  2. Only the skills the calling key may read. A key sees the skills created by its user, team, organization or key. A proxy admin key sees every stored skill. A caller with no identity sees none.
  3. Only to keys that may call the skills API. A key with an allowed_routes list must be allowed /v1/skills to list skills and /v1/skills/<skill id> to read one, for example through anthropic_routes. A key limited to mcp_routes can still call tools on /mcp, but its skills requests are refused and server/discover does not offer it the extension, so a route limit an admin set on a key keeps covering skill content.
  4. Only skills a standard client can load. An uploaded zip must hold SKILL.md in one top-level folder, and its frontmatter must have a name in lower case letters, digits and dashes and a description. A skill stored with instructions only, and no files, is served with a SKILL.md the gateway writes from the skill's title, description and instructions. A skill with more than 512 files or more than 16 MiB in total is left out, because clients are not required to load it. The gateway checks those limits from the zip's own file list before it unpacks anything, so an oversized upload costs almost no work.

There is no setting to turn this on. Serving a skill over MCP gives a key nothing it could not already read through GET /v1/skills.

The gateway unpacks each stored skill once per version and keeps the listing details in memory for up to an hour, so clients that list skills often do not make the gateway unpack the same upload again. Small skills, up to 64 KiB of files, are kept whole, so reading one of their files is answered from memory too. A changed skill gets a new version, so the next listing shows its new fingerprints at once. At most four skills are unpacked at the same time on each gateway process, however many clients ask at once.

Steps​

  1. Store a skill on the gateway with the API. The Admin UI has no page for gateway-stored skills yet, its Skills page manages Claude Code plugins.

    curl -X POST "http://localhost:4000/v1/skills?custom_llm_provider=spanway_proxy" \
    -H "Authorization: Bearer $SPANWAY_API_KEY" \
    -F "display_title=Release notes writer" \
    -F "description=Drafts release notes from merged changes" \
    -F "files[]=@release-notes.zip"

    Expected result: the new skill with an id such as spanway_skill_db832f8a-9f39-4f0c-b3a5-a008f98da13a. The zip in this example holds release-notes/SKILL.md and release-notes/templates/weekly.md.

  2. Connect an MCP client to http://localhost:4000/mcp with the same key, or list the skills from a terminal:

    curl -s http://localhost:4000/mcp \
    -H "Authorization: Bearer $SPANWAY_API_KEY" \
    -H "Accept: application/json, text/event-stream" \
    -H "Content-Type: application/json" \
    -d '{"jsonrpc":"2.0","id":1,"method":"skills/list","params":{}}'

    Expected result, shortened:

    {"jsonrpc": "2.0", "id": 1, "result": {"skills": [{"uri": "skill://spanway_skill_db832f8a-9f39-4f0c-b3a5-a008f98da13a/release-notes/SKILL.md", "frontmatter": {"name": "release-notes", "description": "Drafts release notes from merged changes"}, "resources": [{"uri": "skill://spanway_skill_db832f8a-9f39-4f0c-b3a5-a008f98da13a/release-notes/SKILL.md", "digest": "sha256:52f4b27579e90b08fc55ea6bfc0f4499a6a19457071640686d6f7bac3829af85", "size": 175}, {"uri": "skill://spanway_skill_db832f8a-9f39-4f0c-b3a5-a008f98da13a/release-notes/templates/weekly.md", "digest": "sha256:49649e733885f3d33e552bfea61b6320047b804664464b3872caa0e5cc8e3215", "size": 27}]}], "ttlMs": 0, "cacheScope": "private", "resultType": "complete"}}
  3. Read one skill's entry, or one of its files:

    curl -s http://localhost:4000/mcp \
    -H "Authorization: Bearer $SPANWAY_API_KEY" \
    -H "Accept: application/json, text/event-stream" \
    -H "Content-Type: application/json" \
    -d '{"jsonrpc":"2.0","id":2,"method":"resources/read","params":{"uri":"skill://spanway_skill_db832f8a-9f39-4f0c-b3a5-a008f98da13a/release-notes/templates/weekly.md"}}'

    Expected result:

    {"jsonrpc": "2.0", "id": 2, "result": {"contents": [{"uri": "skill://spanway_skill_db832f8a-9f39-4f0c-b3a5-a008f98da13a/release-notes/templates/weekly.md", "mimeType": "text/markdown", "text": "# Week of {date}\n\n## Fixes\n"}]}}

    skills/get takes the SKILL.md address the same way, as "params": {"uri": "skill://.../release-notes/SKILL.md"}, and answers {"skill": {...}} with the same entry the listing shows.

Security notes​

Skill content is text that a model reads and may act on, so treat a skill like a prompt. Store only skills you trust, especially ones with scripts. Uploads already pass skill scanning when it is set up, see skills. The fingerprints in a listing come from the gateway itself, so they prove a client received what the gateway listed, not that the skill is safe. Well-behaved MCP clients ask the user before they run anything a skill asks for.

Errors​

These come back as JSON-RPC errors with code -32602 (invalid params), the code the MCP skills extension asks for.

MessageMeaningFix
Unknown skill: <uri>skills/get got an address that is not the SKILL.md of a skill this key may read. The same message covers a skill that does not exist and one owned by someone else, so ids cannot be guessed.Copy the uri from skills/list, and use the key that owns the skill.
Resource not found: <uri>resources/read asked for a skill:// file that is not in that skill's listing, or a skill this key may not read.Read only the file addresses the skill's resources list shows.
Invalid skills/list cursorThe cursor sent to skills/list is not one the gateway gave out.Send the nextCursor value from the previous page unchanged, or leave it out for the first page.
This key may not read skills, its allowed_routes do not include <route>The key has an allowed_routes list that leaves out /v1/skills (for listing) or /v1/skills/<skill id> (for reading one skill).Add anthropic_routes, or the two skills routes, to the key's allowed routes, or use a key that may call the skills API.
Operation unavailable on /mcp/proxy (code -32601)The skills methods were called on /mcp/proxy.Call them on /mcp.

An empty skills list with no error means the key owns no servable skill, the gateway has no database, or the skills table could not be read (see the WARNING line below).

Logs​

LevelLineMeaningAction
INFOMCP skills: served <what> to user <user id>, team <team id>A key listed skills (a list of <n> skills) or read a skill entry or file (its skill:// address). The line names no file content.Normal. Use it to see who read which skill. It shows when the log level is INFO or lower.
WARNINGMCP skills: the skills table could not be read, so no skills are served: <ExceptionType>The database query for skills failed, for example on a timeout or a missing table. The skills methods answered as if the key had no skills, and server/discover left the extension out, while tools kept working.Check the database connection and that migrations ran.
DEBUGMCP skills: skill <id> is not served over MCP because <reason>A stored skill was left out of skills/list or refused by skills/get, for example because its SKILL.md has no description or it is larger than 512 files or 16 MiB.Normal. Fix the skill's upload if it should be served. The line shows only with debug logging on.

Skill reads write no audit row, because they reveal nothing the key could not already read through the skills API. Each read runs inside the same MCP request context and trace as other /mcp requests, and writes the INFO line above, so the access can be traced.

Metrics and traces​

Three Prometheus series show skills over MCP at work. None of them names a skill or a key.

MetricLabelsWhat it shows
spanway_mcp_skill_requests_totalmethod (skills/list, skills/get, resources/read), outcome (served, denied, not_found, invalid)Every skills request by result. A rise in denied means keys without the skills routes are trying to read skills, not_found usually means a client kept an old skill:// address.
spanway_mcp_skill_request_duration_secondsmethodHow long a skills request took. Large skills that are not cached yet take longest.
spanway_mcp_skill_store_errors_totalnoneTimes the skills table could not be read, the same event as the WARNING line above.

With OpenTelemetry turned on, each request is an mcp skills/list, mcp skills/get or mcp resources/read span inside the /mcp request, with spanway.mcp_skills.method and spanway.mcp_skills.outcome as attributes. Skill reads write no spend log, so they are not in Explore. Use the metrics and the INFO line instead.