Agent Skills vs MCP: one capability built both ways, with token counts and a 300-run test
The same GSTIN checker built as a SKILL.md skill and as an MCP server. Token counts from the model's own tokenizer, 300 local runs, and where each one breaks.
An Agent Skill is a folder with a SKILL.md file: a name, a one-line description, and Markdown instructions, plus optional scripts and reference files. The agent sees only the name and description at the start and loads the rest when a task needs it. An MCP server is a separate process that exposes typed tools over a protocol, and the agent sees every tool's name, description and JSON Schema up front.
Both get pitched as "how you give an agent new abilities", so I built one capability both ways and ran them against each other: a validator for Indian GST numbers (GSTIN), with nine decoy capabilities next to it, on two local models. Every number below comes from those runs.
If you want the protocol background first, MCP from zero and the MCP reference guide cover it.
The short answer#
| Agent Skill | MCP server | |
|---|---|---|
| What it is | A folder of instructions, scripts and files | A process that serves typed tools |
| What the model sees at the start | Name + description (about 50-100 tokens each) | Name + description + JSON Schema for every tool |
| What runs the code | The agent's own shell or script tool | The server, in its own process |
| Context cost at 200 capabilities (measured below) | 10,105 tokens | 21,477 tokens |
| Turns for one GSTIN check (measured) | 3 (activate, run script, answer) | 2 (call tool, answer) |
| Works with a small model that is weak at following instructions | Badly, in my test | Yes |
| Auth, multi-user, remote access | Not covered by the spec | Built into the protocol (OAuth for HTTP) |
Skills are cheaper to keep loaded and easier to write. MCP tools are more reliable to call and carry their own security boundary. An agent can use both: MCP servers for the systems it talks to, and skills for the know-how about using them.
Where the two standards stand#
- Anthropic launched skills in October 2025 inside Claude Code, published the format as an open standard in December 2025, and on 22 October 2026 donated it to the Agentic AI Foundation (AAIF) under the Linux Foundation. MCP went to the same foundation earlier.
- In that same post Anthropic says more than 70 agent platforms support skills, including ChatGPT, Cursor, GitHub Copilot and VS Code.
- The specification is short.
name(lowercase letters, digits and hyphens, up to 64 characters, must match the folder name) anddescription(up to 1,024 characters) are required.license,compatibility,metadataand an experimentalallowed-toolsare optional.
The capability: a GSTIN checker#
A GSTIN is 15 characters: a two-digit state code, the business's 10-character PAN, an entity number, a Z, and a check character computed from the first 14. The check character is a Luhn mod 36 checksum, so any single wrong character fails validation. That makes it a good test: a model cannot answer it from memory, so it has to use the capability.
# skills/gstin-check/scripts/gstin.py
"""Validate an Indian GSTIN: format, state code and check character."""
import json, re, sys
CHARS = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ"
STATES = {"27": "Maharashtra", "29": "Karnataka", "33": "Tamil Nadu", "07": "Delhi"} # full table (01-38, 97, 99) in the repo
PATTERN = re.compile(r"^[0-9]{2}[A-Z]{5}[0-9]{4}[A-Z][1-9A-Z]Z[0-9A-Z]$")
def check_char(first14: str) -> str:
total = 0
for i, ch in enumerate(first14):
p = CHARS.index(ch) * (2 if i % 2 else 1)
total += p // 36 + p % 36
return CHARS[(36 - total % 36) % 36]
def validate(gstin: str) -> dict:
g = gstin.strip().upper()
if not PATTERN.match(g):
return {"gstin": g, "valid": False, "reason": "bad format"}
if g[:2] not in STATES:
return {"gstin": g, "valid": False, "reason": f"unknown state code {g[:2]}"}
want = check_char(g[:14])
if g[14] != want:
return {"gstin": g, "valid": False, "reason": f"check character should be {want}"}
return {"gstin": g, "valid": True, "state": STATES[g[:2]], "pan": g[2:12]}
if __name__ == "__main__":
print(json.dumps(validate(sys.argv[1])))
$ python gstin.py 27AAPFU0939F1ZV
{"gstin": "27AAPFU0939F1ZV", "valid": true, "state": "Maharashtra", "pan": "AAPFU0939F"}
$ python gstin.py 29AAACI1681G1ZK
{"gstin": "29AAACI1681G1ZK", "valid": false, "reason": "check character should be L"}
Version 1: the skill#
skills/gstin-check/
├── SKILL.md
├── scripts/gstin.py
└── references/structure.md
---
name: gstin-check
description: Validate an Indian GST registration number (GSTIN) and report its state and embedded PAN. Use when the user gives a 15-character GSTIN, asks whether a supplier or invoice GSTIN is genuine, or asks which state a GSTIN belongs to.
license: MIT
---
# GSTIN check
Never judge a GSTIN by eye. The 15th character is a checksum, and a GSTIN that looks fine is often wrong by one character.
## Steps
1. Pull every 15-character GSTIN out of the user's message. Upper-case it.
2. For each one, run `scripts/gstin.py <GSTIN>`. It prints JSON with `valid`, and either `state` and `pan`, or a `reason`.
3. Report per GSTIN: valid or invalid, the state, and the reason when invalid.
4. Do not claim the business is registered or active. The script checks the number's structure only.
For what each position means, read `references/structure.md` only if the user asks.
That file is three levels of loading in one place. The frontmatter is what the agent sees at startup. The body loads when the skill is activated (186 tokens here). references/structure.md loads only if the body sends the agent there. The spec calls this progressive disclosure and recommends keeping the body under 5,000 tokens and 500 lines.
A skill does nothing by itself. The agent's harness has to find skill folders, show the catalog to the model and give it a way to load one. The spec's implementor guide describes two ways: let the model read SKILL.md with a file tool, or give it an activate_skill tool. My harness uses the tool, with the skill name constrained to an enum as the guide suggests, plus a run_skill_script tool that refuses to run anything outside the activated skill's folder:
def run_skill_tool(name, args, active):
if name == "activate_skill":
n = args.get("name")
if n not in CATALOG:
return f"unknown skill {n}"
active.add(n)
files = [str(f.relative_to(SKILLS / n)) for f in (SKILLS / n).rglob("*")
if f.is_file() and f.name != "SKILL.md"]
return (f'<skill_content name="{n}">\n{CATALOG[n][1]}\n'
f'<skill_resources>{" ".join(files)}</skill_resources>\n</skill_content>')
if name == "run_skill_script":
n, script = args.get("skill"), args.get("script", "")
if n not in active:
return "error: activate the skill first"
path = (SKILLS / n / script).resolve()
if not path.is_relative_to((SKILLS / n).resolve()) or not path.exists():
return f"error: no such script {script}"
argv = args.get("args") or []
r = subprocess.run([sys.executable, str(path), *map(str, argv)],
capture_output=True, text=True, timeout=20)
return (r.stdout or r.stderr).strip()
The catalog goes into the system prompt in the XML shape the guide shows:
<available_skills>
<skill><name>gstin-check</name><description>Validate an Indian GST registration number ...</description></skill>
<skill><name>ifsc-lookup</name><description>Look up an Indian bank branch from an IFSC code ...</description></skill>
... eight more
</available_skills>
The nine decoys (PDF merge, SQL review, invoice PDF, IFSC lookup, resume tailoring, meeting notes, CSV profiling, changelog, PAN check) are there so the model has to pick. Several sit close to GSTIN on purpose: PAN check, IFSC lookup and GST invoice creation.
Version 2: the MCP server#
The same validate() function, served with the official Python SDK (mcp 2.3.0):
import sys
from pathlib import Path
from mcp.server.mcpserver import MCPServer
sys.path.insert(0, str(Path(__file__).parent / "skills/gstin-check/scripts"))
import gstin # the same code the skill's script runs
server = MCPServer("india-tools")
@server.tool()
def validate_gstin(gstin_number: str) -> dict:
"""Validate an Indian GST registration number (GSTIN) and report its state and embedded PAN.
Use when the user gives a 15-character GSTIN or asks whether a supplier GSTIN is genuine.
Checks structure and the check character only, not live registration status."""
return gstin.validate(gstin_number)
# ... the nine decoys, as tools with the same descriptions
if __name__ == "__main__":
server.run()
The client lists the server's tools over stdio and hands them to the model as function definitions. This is what the model gets for one tool:
{
"name": "validate_gstin",
"description": "Validate an Indian GST registration number (GSTIN) ...",
"inputSchema": {
"type": "object",
"properties": {"gstin_number": {"title": "Gstin Number", "type": "string"}},
"required": ["gstin_number"],
"title": "validate_gstinArguments"
}
}
Token cost, counted by the model's own tokenizer#
I counted tokens with Ollama's prompt_eval_count, which is the model's real tokenizer applied to the real chat template, tool definitions included. Each figure is the request's count minus a baseline request with no catalog and no tools. Model: qwen3:4b-instruct.
| What is in context | Tokens |
|---|---|
| 10 skills: catalog + instructions + the two harness tools | 855 |
| 10 MCP tools (descriptions + schemas) | 1,122 |
| The GSTIN skill body, once activated | 186 |
The gap grows with the number of capabilities, because every MCP tool carries a schema and the template wraps each one. I repeated the ten capabilities with numbered names to see the slope:
| Capabilities | Skills catalog | MCP tool list |
|---|---|---|
| 10 | 847 | 1,142 |
| 50 | 2,775 | 5,402 |
| 100 | 5,185 | 10,727 |
| 200 | 10,105 | 21,477 |
That is about 48 tokens per skill against about 107 per MCP tool, with short schemas. Tools with nested objects and long enums cost more.
For a real install I ran the same count over the 18 skills on my own laptop. Their catalog costs 2,018 tokens. Their bodies add up to 45,411 tokens (median 2,226, largest 6,172). Loading every body up front, which is what you would do with plain system-prompt instructions, would cost 22 times what the catalog costs.
The cheaper catalog does not make each task cheaper. A skill needs an extra round trip (activate, then run the script), and every round trip re-sends the whole conversation. Summed over all model calls in one GSTIN task:
| Setup | Model calls per task | Prompt tokens per GSTIN task (median) | Prompt tokens per unrelated task (median) |
|---|---|---|---|
| Skill, catalog in system prompt | 3 | 3,345 | 895 |
| Skill, catalog in the tool description | 3 | 2,913 | 751 |
| MCP tools | 2 | 2,435 | 1,162 |
With ten capabilities, the skill setups win on requests that do not need the capability and lose on requests that do. As the capability count grows, the always-loaded MCP list grows with it and the balance moves toward skills.
The behaviour test: 300 runs#
Ten prompts: six about GSTINs (three valid, three invalid in different ways, one written in lowercase) and four that should use nothing ("What is 18% GST on Rs 2,450?", a commit message, a translation, and "What does PAN stand for?", which sits next to the PAN-check decoy). Each prompt ran 5 times per setup with different seeds at temperature 0.7, on two models served by Ollama 0.40.18 on a MacBook.
A GSTIN answer counts as correct only if the verdict matches the script's. An unrelated prompt counts as correct if the answer is right and no capability was called.
| Model | Setup | GSTIN correct | Unrelated: correct, no spurious call |
|---|---|---|---|
| qwen3:4b-instruct | Skill, catalog in system prompt | 30/30 | 20/20 |
| qwen3:4b-instruct | Skill, catalog in tool description | 30/30 | 20/20 |
| qwen3:4b-instruct | MCP tools | 30/30 | 20/20 |
| qwen2.5:7b | Skill, catalog in system prompt | 12/30 | 20/20 |
| qwen2.5:7b | Skill, catalog in tool description | 0/30 | 19/20 |
| qwen2.5:7b | MCP tools | 30/30 | 20/20 |
The newer 4B model handled every setup. The older 7B model handled MCP perfectly and mostly failed with skills. Every one of its 48 failures was an empty reply.
Why the 7B model returned nothing#
I replayed one prompt through the raw completion endpoint to see the text the model produced before Ollama parsed it:
<tool_call>
{"name": "gstin-check", "arguments": {"name": "33aabcu9603r1zu"}}
</tool_call>
The model called the skill as if it were a function. There is no tool named gstin-check, only activate_skill. Ollama dropped the call because the name did not match any declared tool, and the reply that reached my code had empty content and no tool calls. Moving the catalog into the tool description made it worse (0/30), probably because the skill names then sit right next to the tool definitions.
Two lessons for anyone building a skills loader:
- Test activation on the exact model you ship. Skills add a step that function calling does not: the model has to know that a skill name is an argument, not a function. Small or older models trained on plain tool calling get this wrong.
- Handle unknown tool names. If your runtime lets you see them, map a call to an unknown name that matches a skill onto
activate_skill, or return an error the model can recover from. A silent drop gives you an empty answer and no log line.
A smaller problem: details the model adds#
All three setups got every verdict right with qwen3:4b-instruct, but the explanations had errors. For 29AAACI1681G1ZK the script says "check character should be L". The model then often wrote "should be L, not Z". The last character is K. Z is the 14th. In a regex check over the two invalid-checksum prompts, the wrong character appeared in 8 of 10 answers with the system-prompt skill, 6 of 10 with the tool-description skill, and 2 of 10 with MCP.
The skill body says to "quote the expected character", which pushes the model to explain the failure, and it filled in the rest by reading the string itself. The fix belongs in the script, not the prompt: return "got K, expected L" so the model has nothing to work out. A tool should hand back every fact the model is likely to repeat.
A YAML trap I hit while building this#
My first decoy skill had this frontmatter:
description: Profile a CSV file: row count, column types, nulls, outliers. Use when ...
PyYAML refused it: mapping values are not allowed here. The second colon makes YAML read Profile a CSV file as a key. The implementor guide warns about this exact case: skills written for one client may contain YAML that another client's parser rejects. Quote descriptions that contain a colon, and if you write a loader, fall back to a lenient parse instead of skipping the skill.
Security is different in kind#
A skill runs with the agent's permissions. When the body says "run scripts/gstin.py", that script runs on the user's machine with whatever access the agent has. The guide recommends loading project-level skills only from folders the user has marked as trusted, because a freshly cloned repository can ship a .agents/skills/ folder with instructions you did not write. allowed-tools lets a skill declare which tools it expects, but the spec marks it experimental and clients treat it differently.
An MCP server runs in its own process, often on another machine. The agent can only do what the server's tools allow, and over HTTP the server can demand OAuth. The trade is that an MCP server is a service to deploy, version and monitor, and a skill is a folder you copy.
Both carry prompt-injection risk. A skill's instructions and an MCP tool's description both go straight into the model's context, so treat third-party skills and third-party servers with the same care as third-party code. The red-teaming post has tests you can point at either.
How they fit together#
The two do not compete for the same job:
- MCP is the connection. Use it when the agent has to reach a system: a database, a SaaS API, a service with its own users and auth, anything another agent or IDE should reach too.
- A skill is the know-how. Use it for procedures, house rules, templates and small scripts: how your team writes release notes, which checks to run before a refund, which MCP tools to call in which order for a task.
A skill whose body says "use the validate_gstin tool from the india-tools server, then check the state against the shipping address" is a normal pattern. The MCP server does the work and the skill holds the judgement about when and how.
When the only goal is to cut the token cost of a large MCP tool list, a skill is one option. The other is to stop sending tool definitions at all and let the model write code against them, which Anthropic and Cloudflare call code execution or "code mode". I tested that next: MCP code mode in Python.
Reproduce it#
python3 -m venv v && v/bin/pip install mcp==2.3.0 pyyaml httpx
OLLAMA_HOST=127.0.0.1:11435 ollama serve & # a private Ollama instance
ollama pull qwen3:4b-instruct && ollama pull qwen2.5:7b
v/bin/python harness.py 5 qwen3:4b-instruct # skill, skill-tool, mcp; 10 prompts x 5 seeds
v/bin/python harness.py 5 qwen2.5:7b
v/bin/python tokens.py # the token tables
Versions: Python 3.15.2, mcp 2.3.0, PyYAML 6.0.4, Ollama 0.40.18. Valid test GSTINs were computed with the script above, not taken from real businesses, except 27AAPFU0939F1ZV, a sample GSTIN that appears in many GST examples online.