跪拜 Guibai
← All articles
AI Programming

MCP and Skill: How an Agent Grows Hands and Learns Routines

By 浪遏 ·
Read original on juejin.cn ↗ Google Translate ↗ Alt translation

Connecting agents to real services and giving them reliable multi-step procedures is what separates a chatbot from a tool that ships work. MCP avoids vendor lock-in and private glue code, while progressive skill loading keeps context windows lean even as an agent's repertoire grows into dozens of capabilities.

Summary

An agent with built-in tools hits two walls fast: the tools are never enough, and knowing how to call a tool is not the same as knowing how to do a job. MCP (Model Context Protocol) solves the first by acting as a USB-style standard socket — any external service that speaks MCP gets normalized, namespaced, and injected into the tool registry so the LLM sees it as identical to a built-in. The second wall falls to Skill, a system of Markdown playbooks that spell out when to use which tools, in what order, and how to decide at each fork. Skills load progressively: a one-line summary per skill sits in the system prompt for about 300 tokens total, while the full instruction text is fetched on-demand only when the agent decides a skill is needed. Workspace-level skills in `.catbuddy/skills/` override built-ins, letting each project carry its own agent behavior without touching harness code. Security boundaries — PathGuard, SSRF filtering, dangerous-command blocking — apply equally to external tools, so the capability surface grows but the permission surface does not.

Takeaways
External MCP tools are wrapped with an `mcp_{server}_{tool}` prefix and schema-normalized so the LLM cannot tell them apart from built-in tools.
McpManager handles the full lifecycle — connect, reload, disconnect — and a single failed service does not block the rest.
All security gates (PathGuard, SSRF filtering, dangerous-command regex) apply to external tools with no special privileges.
Each Skill is a Markdown file containing when to use it, ordered tool-calling steps, and decision rules for branches.
A four-level progressive loading scheme keeps only one-line summaries in the system prompt; full skill text is read on-demand by the agent itself.
Workspace-level skills in `.catbuddy/skills/` automatically override same-name built-ins, enabling per-project agent customization with zero harness changes.
Skill hot-reload uses directory mtime fingerprints to invalidate the prompt cache, so new or disabled skills take effect on the very next message.
Conclusions

Choosing MCP over a custom tool interface is explicitly framed as rejecting the temptation to reinvent the wheel — the ecosystem access is worth far more than the half-day of coding saved.

Schema normalization is the unglamorous work that makes MCP actually interoperate across providers; nullable types and `anyOf` constructs that one LLM API rejects must be flattened into a common shape.

The `mcp_reload` tool is registered so the agent itself can trigger a hot reconnect, turning infrastructure management into just another tool the model can call.

Progressive disclosure is not just a token-saving trick — it mirrors how humans use manuals: you know a manual exists from its title, but you only open it when the task demands it.

Bundling scripts, references, and assets inside a Skill folder turns a prompt fragment into a distributable executable package, blurring the line between documentation and code.

Concepts & terms
MCP (Model Context Protocol)
An open protocol proposed by Anthropic that standardizes how AI agents discover and call external tools. It defines three core operations: list_tools, call_tool, and tool_result, using JSON Schema for parameter definitions.
SSRF (Server-Side Request Forgery)
An attack where an attacker induces a server to make requests to internal or unintended addresses. In agent contexts, this is mitigated by blocking private IP ranges, loopback addresses, and cloud metadata endpoints on every fetch, including after redirects.
Progressive Disclosure (Progressive Loading)
A design pattern where only summary information is kept readily available, and full details are fetched on demand. In catbuddy's Skill system, one-line skill summaries stay in the system prompt while the complete Markdown instructions are read by the agent only when a skill is needed.
Tool Registry
A central registry where all tools — both built-in and external — are registered by name and definition. The agent loop queries this registry to decide which tool to call, without needing to know the tool's origin.
Source: juejin.cn ↗ Google Translate ↗ Backup ↗