Agent Skills与MCP:定义、区别与落地选型
作者:渣渣辉2026.11.16 11:23浏览量:0简介:Many teams simply install a pile of Agent Skills when building AI programming workflows, but delivery still goes wrong. This article explains what Agent Skills and MCP (Model Context Protocol) each are. In short, Skills define how AI works: processes, standards and steps. MCP defines which external systems AI can access: tools, APIs and data. It covers their composition, principles and typical use cases, plus how they differ from project rules, RAG and fine-tuning. It also gives a security checklist, helping readers replace "the more, the better" thinking with a clear choice between the "process layer" and the "connection layer".
一、开篇结论:先分清“流程问题”和“连接问题”
Many teams hit the same wall when adopting AI programming assistants:
- Workflows are unstable. Requirements get handled haphazardly, and one change touches a dozen files at once.
- Systems can’t be reached. The assistant can’t access internal backends, payment systems or ticketing systems, and installed skills don’t help.
- Boundaries are invisible. For third-party skills of unknown origin, no one can say whether they will leak keys or code.
Most of these failures come from a layer mismatch. Teams expect a “process package” to provide “connection capability”, or expect a “connection protocol” to supply “work standards”. To choose correctly, decision-makers need to answer three questions first:
- What is each one? Agent Skills defines how AI works. MCP (Model Context Protocol, 模型上下文协议) defines which external systems AI can access.
- How are they different? Skills are essentially declarative knowledge and methods. MCP is a runtime communication protocol for connecting to systems. They complement each other rather than compete.
- How should they be combined? Project rules set the hard limits, Skills provide reusable workflows, and MCP provides safe, controllable access. The layers shouldn’t be mixed up.
| Comparison | Agent Skills | MCP |
|---|---|---|
| Literal meaning | Agent skills (technical documents) | Model Context Protocol |
| Core question | How should AI do the work? | What can AI access? |
| Nature | Declarative knowledge and methods | Runtime connection protocol |
| Form | Folder + a main skill file + optional resources | An independent service process |
| Provided content | Steps, standards, taboos, examples | Tools, resources, prompt templates |
| Failure it prevents | Unstable output, chaotic changes | Being cut off from systems, unsafe connections |
| Main risks | Unknown sources, outdated content, prompt injection | Excessive permissions, key leakage, data sent outside the network |
二、概念定义:Skills、MCP与项目规则分别是什么
agent-skills-">2.1 Agent Skills:用“技能文件夹”封装可复用的做事方法
定义:Agent Skills is a skill packaging specification for AI agents. A skill is a folder. Its core file, SKILL.md, consists of two parts:
- Header metadata: the skill’s name and description, stating what it does and when to use it.
- Main content: steps to follow, constraints to observe, and examples.
The folder can also carry scripts, document templates, checklists and other resources.
Underlying idea: A general-purpose large model knows common coding best practices. But it doesn’t know your team’s branching strategy, commit granularity, review checklist, directory conventions or legacy system taboos. A skill captures this experience in a standardized format so the agent can call it up consistently when needed.
Metaphor: Picture the AI programming assistant as a new engineer who is very smart but unfamiliar with your codebase. Skills are like handing them standard operating procedures and onboarding notes, not like buying them a new brain.
2.2 MCP:AI assistant and external system connected via a standard interface
Definition: MCP (Model Context Protocol) is an open protocol for connecting AI assistants to external data sources and tools. It standardizes how assistants discover, call and receive results from outside systems. An assistant acts as the client, and the system being accessed is wrapped as a server.
Metaphor: If the AI assistant is a new employee, MCP is the building access card and tool kit. Through one standard interface, the assistant can get past gates (identity verification), open cabinets (read data) and operate equipment (invoke tools). Each connected system doesn’t need custom integration for every assistant.
Architecture: A typical MCP setup has three roles:
- Host: the AI assistant or development environment the user interacts with, such as an IDE plugin or a chat application.
- Client: a component inside the host that maintains one connection to one server.
- Server: exposes the system’s capabilities and, when called, talks to the actual target such as a database or an internal platform.
2.3 Project rules: the hard limits that hold steady
Most AI programming assistants support keeping a project-level instruction file in the repository root. By convention, it’s often named like “project instructions” or “context rules”, though the exact name varies by tool. It describes the tech stack, directory structure, build commands and “thou shalt not touch” list.
Rules work like factory regulations on an employee badge: short, always in effect, and the same for everyone. Skills are more like task-specific operating procedures: longer, more detailed, and loaded only when needed. The two are different in form and in what they’re suited for.
三、背景与价值:为什么会出现Skills和MCP
3.1 Background: two bottlenecks when AI programming assistants go into production
Large models have strong general coding ability, but there are two gaps between “working in a demo” and “working on the delivery line”:
- Knowledge gap: the model doesn’t know how your team does things.
- Capability gap: the model can only generate text, can’t log into systems, query databases or invoke APIs, and can’t verify whether it got things right.
There’s also a governance gap: when connection capability is cobbled together ad hoc, permissions and audit trails become hard to control.
“Install a pile of skills and AI will work like an engineer” overlooks the latter two gaps. It can produce lively demos, but two weeks into real use, problems appear: requirements are still handled haphazardly, connections to internal systems still fail, and keys may leak without anyone noticing.
3.2 Value of Skills: turning “doing it right once” into “doing it right every time”
The value of Skills can be summed up in three words: explicit, reusable and combinable.
- Explicit: steps and taboos are written out so the team can review and adjust them.
- Reusable: the same skill serves different tasks and projects. Newcomers inherit the team’s experience without relying on word of mouth.
- Combinable: each skill focuses on one thing, and the assistant loads the needed ones by scenario.
For technical leaders, Skills also have a management benefit. They turn “this is how we work” into artifacts that can be versioned, reviewed and evaluated.
3.3 Value of MCP: opening up systems without giving up control
MCP’s value also comes down to three words: standard, controllable and reusable.
- Standard: the assistant and the system interact through a unified protocol, without needing separate integration for each assistant.
- Controllable: each server exposes only the capabilities it’s meant to. Read-only, write and high-risk operations can be managed by category, and calls can be logged.
- Reusable: internal systems can be wrapped as MCP servers once and shared by many assistants, across teams and roles.
On the security side, keys are stored with the server or injected at runtime. They never enter the model context, reducing the risk of plaintext keys being sent along with the conversation.
四、核心组成:一个技能包和一套连接协议里都有什么
4.1 Anatomy of a skill: metadata, main content and optional resources
A typical skill folder looks like this:
release-check/├── SKILL.md # Main file: metadata + steps├── checklist.md # Release checklist├── templates/│ └── release-notes.md # Release notes template└── scripts/└── precheck.sh # Pre-release automated check script
Inside SKILL.md, the header metadata sits between two “—-“ lines:
---name: release-checkdescription: 发布前检查流程。当需要发起发布、生成发布说明或做上线前自检时使用;不适用于日常功能开发。---# 发布前检查## 执行步骤1. 汇总本次变更清单,标明涉及的模块和负责人2. 运行单元测试、静态检查和构建3. 按 checklist.md 逐项确认4. 按模板生成发布说明,列出已知风险与回滚方案5. 发现未通过项时停止发布并反馈## 禁忌事项- 未经确认,不修改发布脚本- 不在流程中写入任何密钥或令牌- 数据库变更须附回滚方案
- Metadata is the index. name is the skill’s unique identifier. description states its purpose and when to use it, and is the main basis for the assistant to decide whether to load it. A clear description, including “when not to use it”, improves matching accuracy.
- The main content is the execution instructions. Each step should be something the assistant can carry out as written, avoiding vague wording like “check appropriately”.
- Optional resources are the toolbox. Scripts provide deterministic behavior, templates make output consistent, and reference documents hold long specifications so the main file stays lean.
4.2 Anatomy of MCP: host, client, server, and three capability primitives
MCP servers usually provide three core types of capability:
- Tools: callable actions, such as querying ticket details, fetching log entries or writing a work order. Tools can have side effects, so the assistant generally has to decide whether and how to call them.
- Resources: readable context data, such as file contents and database records. Resources are typically chosen and loaded by the host application, mainly used to provide context for the model.
- Prompt templates: parameterized templates users can invoke, such as a standard “incident review” template. They’re typically triggered by the user rather than decided by the model.
Additionally, one server can serve a local application or several remote hosts through an ordinary network connection. When the server runs locally, it can also be started on demand by the host.
五、工作原理:Skills按需加载,MCP运行时调用
5.1 Skills: progressive disclosure, loading only what’s needed
The loading of Skills generally follows three steps:
- Scan: at startup, the assistant reads only each skill’s name and description. Usually just a few dozen tokens each, so installing many skills doesn’t instantly fill up the context.
- Match: when the user’s request matches a skill’s description, the assistant loads its full text as guidance for the current task.
- Execute: when a step needs a script, template or reference document, the assistant reads or runs it only then.
This “load only what’s needed” design is called progressive disclosure. It’s why Skills can be packaged without overloading every session. But “doesn’t overload the context” doesn’t mean “the more the better”. When skills overlap, descriptions are vague, or scripts are outdated, the assistant may follow the wrong one or stop at reading the steps without executing them. Quality matters more than quantity.
5.2 MCP: connection, negotiation, discovery, invocation and return
The runtime flow of MCP can be broken into five steps:
- Connect: following client configuration, the assistant starts a local server process or connects to a remote server address, attaching the required credentials.
- Negotiate: the client and server exchange protocol versions and capability declarations, confirming the version each supports and the capabilities the server provides. They also complete authentication.
- Discover: the client gets the server’s tool list, including names, descriptions and parameter definitions, and provides it to the model as available capabilities.
- Invoke: when the model decides to call a tool, the host performs permission checks (usually with a user confirmation step) and forwards the request through the client. The server then calls the actual target system.
- Return: the result (text, structured data, images, etc.) goes back through the server and client to the model, which uses the real data to continue reasoning.
MCP’s governance mechanisms mostly live in this flow:
- Capability declarations determine what the model can see and use.
- Host-side confirmation is the last line of defense for high-risk operations.
- Server-side credentials and permission scope decide what can actually be done.
- Call logs make it possible to trace what happened afterwards.
5.3 When multiple layers work together: rule-based control, skill-based methods, connection via MCP
In actual use, the three layers often work together:
- Rules determine the hard limits: which modules can’t be touched and which operations must not be performed.
- Skills determine the steps to follow and the quality standards.
- MCP determines what can be accessed and with what permissions.
For example, for a release preparation task:
- The project rules remind the assistant “database changes must include a rollback plan”.
- The release-check skill is loaded, telling the assistant to follow the check steps in order.
- The assistant connects through MCP to fetch the change list from the ticketing system and read logs from the log service. It generates the release notes using the template and marks high-risk items.
Process, connection and control are in place at the same time. This is the working division of labor that “just install a pile of skills” can’t achieve.
六、典型场景:什么问题用Skills,什么问题用MCP
6.1 Scenarios where Skills excel: repetitive processes and quality consistency
Skills are suited to “how to do it” problems that are repetitive and need consistent quality, such as:
- Clarifying requirements: asking about acceptance criteria, edge cases and scope changes before writing code.
- Test-driven, small-step development: write tests first, then code, and submit in small increments to keep changes reviewable.
- Team conventions: directory structure, naming, commit granularity and self-check checklists before merging code.
- Specific operations: database changes, API design, incident review. Turn each into standard steps so the assistant follows them exactly.
Decision rule: if the problem is repeated and you can write down a clear “do this, then that”, turn it into a skill.
6.2 Scenarios where MCP shines: accessing real systems and external capabilities
MCP is suited to “can access” problems that require identity verification and real data, such as:
- Read-only queries: database queries, reading resource lists in object storage, fetching log entries, querying monitoring metrics and reading ticket details.
- Operations with confirmation: creating work orders, adding log alerts, starting tasks on a compute platform. The assistant prepares the content, and a person confirms before submission.
- Internal system access: having assistants in different roles invoke internal platforms through the same MCP servers. For example, product and test assistants query requirement status, while development assistants pull repo and build results.
- Browser automation: some assistants provide a server that lets the model drive a browser to fetch pages or fill in forms. However, account credential risk is higher, so it should be used only for low-risk tasks, with sensitive operations left to people.
Decision rule: if it requires connecting to a system, reading real data or invoking a capability, choose MCP or a formal API.
6.3 Common combination patterns
| Scenario | Rules | Skill | MCP |
|---|---|---|---|
| Changing a requirement | Constraints on module scope | Clarify requirements, then make small changes and self-check | Read ticket details and logs, query database table structure |
| Fixing a production incident | Must leave a rollback plan | Incident investigation steps | Fetch logs and monitoring metrics, create and update work orders |
| Routine release | Must not touch the payment module | Release check process | Fetch the change list, read build results |
| Connecting internal platforms | Keys must not be committed to the repo | Internal platform quick reference | Query resource lists, read configuration items |
七、相关概念区别:Skills、MCP、项目规则、RAG和微调
These concepts often get mentioned together, and are easy to confuse:
| Concept | Essence | When it takes effect | What problem it mainly solves | Cost and frequency of change |
|---|---|---|---|---|
| Prompt | Temporary instructions a user types | Instant, one-off | Guiding a single task | Lowest, changeable at any time |
| Project rules | A project-level instruction file | Injected into context each session | Hard project constraints | Low, updated as the project evolves |
| Agent Skills | A folder of process and method documents | Loaded when relevant | Output stability, process consistency | Medium, packaged by scenario |
| RAG | Retrieving knowledge fragments and injecting them into the context | Triggered by the user’s question | Injecting domain knowledge | Medium, depends on the knowledge base update cycle |
| Fine-tuning | Additional training that adjusts model parameters | Already reflected in the model | Stable, hard-to-describe patterns | High, slow to iterate |
| MCP | A runtime connection protocol | Connected at session start, called as needed | Connecting systems, invoking tools | Server changes take effect without retraining |
Tips for telling them apart:
- Prompt vs Skills: prompts are temporary, and the model can’t “remember” what previous sessions agreed on. Skills are persisted and reused.
- RAG vs Skills: RAG answers “what the knowledge is”, while Skills answer “how to do it”. The two can be combined: in a skill, specify that certain steps must consult a knowledge base.
- Fine-tuning vs the others: fine-tuning suits stable, generalized patterns. Rules, Skills and MCP are “external” configurations. When processes change, change the configuration, not the model.
- Skills vs MCP: one is the method, the other the connection. A skill can’t log into a system; an MCP server doesn’t know your team’s process.
This also explains why “installing a pile of Skills” often fails:
- If the core problem is system access, no number of skills will solve it.
- Too many skills with overlapping descriptions make selection less accurate.
- Skills from unknown sources carry supply chain risk.
- Workflows aren’t fixed. Once a team has rules plus a few high-quality skills, adding more brings diminishing returns.
八、使用注意事项:安全、工程与管理
8.1 Security: Skills and MCP add up to a new attack surface
- Check sources: third-party skills can carry unexpected instructions. A skill file can tell the assistant to read environment variables and send their contents to a specific address. Read the main file and scripts before installing, fix the version, and allow only sources your team trusts.
- Guard against prompt injection: data returned by MCP servers, like database contents, ticket descriptions and web pages, may have malicious instructions mixed in. The assistant must treat external content as untrusted data and execute only instructions authorized by the rules and skills.
- Keys and least privilege:
- Keep keys in environment variables or a dedicated key management service, and never let them enter the model context.
- Give MCP servers dedicated accounts and separate credentials for each environment.
- Default to read-only, and leave write operations and cross-environment operations to people.
- Network exposure: if the assistant connects to a remote MCP server over an ordinary network connection, the server must provide authentication and access control. Don’t expose a server without authentication to the public internet.
- Approval and logging: connect a high-risk server only after review. Log invocation time, parameters and results so actions can be traced.
On cloud platforms such as Baidu AI Cloud, you can deploy and govern MCP servers using common managed services, including container platforms, identity authentication, key management, log services and monitoring alerts. They support account permissions, audit logging and fault alerting. This helps a skill that “should only read data” actually stay read-only.
8.2 Engineering: verify at the task level before scaling up
- Skills: start from high-frequency, high-pain tasks, keep them small, and have each skill do only one thing. Name them clearly, and state in description “when to use” and “when not to use” to improve matching accuracy.
- MCP: when choosing or building a server, check its permission model, supported authentication, and whether invocation logs are available. For tools that write or delete data, require user confirmation before execution.
- Verification: choose a few typical tasks and run the same task repeatedly, checking process adherence, change range and security compliance. Only then expand to more scenarios.
8.3 Management: a checklist technical leaders can accept against
Before approving rollout, leaders can check these six questions:
- Necessity: does each installed skill solve a real, recurring problem? If not, remove it.
- Boundaries: is it clear what AI may touch, what it may only read, and what it may not touch at all? Have these been written into the project rules?
- Source: are all skills and MCP servers on file, with version and owner recorded, and were third-party ones reviewed?
- Permissions: do MCP servers use dedicated accounts, follow least privilege, and keep high-risk operations to confirmation only?
- Audit: can every tool call be traced to its operator, time and parameters?
- Effect: can you name a metric, such as “fewer files changed per requirement”, “shorter review cycles” or “fewer incidents”, to measure whether the configuration actually helped?
九、总结:回到定义,理清边界
Agent Skills answers “how AI should work”, and MCP answers “what AI can access”. One packages process, standards and methods as skill folders. The other connects external systems through a standard protocol. Neither replaces the other:
- Skills can’t replace system connections. Without MCP or formal APIs, they can only guide AI to talk about processes, not carry them out.
- MCP can’t replace process standards. Without Skills and project rules, even with system access, AI’s output can be chaotic and risky.
In practice, project rules set the hard limits, Skills provide reusable workflows, and MCP provides secure, controllable connections. Only when the three work together can AI programming assistants move from “lively demos” to “stable delivery”.
As AI assistant ecosystems keep evolving, Skills and MCP specifications may keep iterating. But the underlying logic won’t change: first work out whether a problem is a process problem or a connection problem, choose the tool accordingly, and manage security and permissions through the whole chain.
The ability to tell them apart and combine them is what decides how far an enterprise’s AI programming practice can go.

登录后可评论,请前往 登录 或 注册