Agents, Skills & MCP
Claude Code extends its capabilities through three mechanisms: Agents, Skills, and MCP servers. They look similar but serve different purposes. This guide explains what each one does, how they differ, and when to use which.
Overview
Think of Claude as the brain. Agents, Skills, and MCPs are different ways to give that brain new capabilities. Here's the quick version:
Agents
Autonomous workers
Separate Claude instances that run independently to complete complex tasks. They have their own context and return results when done.
Skills
Defined workflows
Instruction sets that tell Claude how to perform specific tasks. They run in the current conversation, not as separate processes.
MCP Servers
External connections
Bridges to external systems—APIs, databases, browsers, services. They give Claude tools to interact with the outside world.
Agents
Agents are autonomous Claude instances spawned via the Task tool.
When you ask Claude to do something complex, it can delegate work to specialized
agents that run in parallel or sequence.
How Agents Work
- Claude receives a task that would benefit from delegation
- It spawns an agent using
Taskwith a specificsubagent_type - The agent runs independently with its own context window
- When complete, it returns results to the parent Claude
- Claude synthesizes the results and continues
Key Characteristics
- Separate process: Agents don't share memory with the main conversation. They start fresh with only the prompt you give them.
- Specialized types: Different agent types have access to different tools.
An
Exploreagent can search but can't edit. ABashagent runs commands. - Parallel execution: Multiple agents can run simultaneously. Ask Claude to "research X and Y in parallel" and it spawns two agents.
- Background mode: Agents can run in the background while you continue
working. Check on them later with
TaskOutput.
// Claude uses the Task tool internally:
Task(
subagent_type: "Explore",
prompt: "Find all API endpoints",
description: "Search for endpoints"
)Skills
Skills are instruction files that teach Claude how to perform specific tasks.
When you invoke a skill (like /commit), Claude reads the skill file
and follows its instructions within your current conversation.
How Skills Work
- User invokes a skill with
/skill-nameor Claude detects it should use one - Claude reads the
SKILL.mdfile for that skill - The instructions become part of Claude's current context
- Claude follows the defined workflow step by step
- Everything happens in your conversation—no separate process
Key Characteristics
- Same conversation: Skills run in your current context. Claude remembers what you discussed before invoking the skill.
- Defined workflows: Skills contain step-by-step instructions. They ensure consistent, repeatable processes.
- User-invokable: Many skills can be triggered with
/command. Others activate automatically based on context. - Customizable: Skills are just markdown files. You can edit them,
create new ones, or override defaults in your project's
.claude/skills/folder.
Skill File Structure
Skills live in .claude/skills/skill-name/SKILL.md. The file contains
instructions, examples, and any context Claude needs to execute the workflow.
# Skill Name
## Trigger
When user says "/command"
## Steps
1. First, do X
2. Then check Y
3. Finally, output Z
## Examples
...MCP Servers
MCP (Model Context Protocol) servers are external processes that give Claude access to tools it doesn't have natively. They're bridges to APIs, databases, browsers, and other systems.
How MCP Works
- MCP servers run as separate processes alongside Claude Code
- They register tools with Claude (like
mcp__github__create_issue) - When Claude needs that capability, it calls the MCP tool
- The MCP server executes the action and returns results
- Claude continues with the response
Key Characteristics
- External connections: MCPs connect to things Claude can't access directly—GitHub API, Supabase, Slack, browsers, etc.
- Tool providers: Each MCP exposes specific tools. The GitHub MCP
provides tools like
create_issue,create_pull_request, etc. - Always available: Once configured, MCP tools are available in every conversation. No need to invoke them specially.
- Requires setup: MCPs need configuration in your settings. They often require API keys or authentication.
Configuration
MCPs are configured in ~/.claude/settings.json or your project's .claude/settings.json. Each server specifies a command to run and
any required environment variables.
// settings.json
{
"mcpServers": {
"github": {
"command": "npx",
"args": ["-y", "@anthropic/mcp-github"],
"env": {
"GITHUB_TOKEN": "ghp_..."
}
}
}
}Key Differences
The confusion usually comes from the fact that all three "extend" Claude's capabilities. But they do so in fundamentally different ways:
When to Use What
Use an Agent when...
- The task requires extensive searching or exploration
- You want work done in the background
- Multiple independent tasks can run in parallel
- The task is self-contained and doesn't need conversation history
- You want to reduce context window usage in main conversation
Use a Skill when...
- You want a consistent, repeatable process
- The workflow needs access to conversation context
- User interaction might be needed during execution
- You want to customize how Claude handles specific tasks
- The process should follow your team's standards
Use MCP when...
- You need to interact with external APIs or services
- Claude needs capabilities it doesn't have natively
- You want persistent connections to tools like GitHub, Slack
- The integration requires authentication or API keys
- You're automating across multiple systems
Real-World Examples
Codebase Exploration
"I need to understand how authentication works in this project"
Explore agentWhy agent: Extensive file searching would bloat the main conversation. Agent does the work and returns a digest.
Git Commit Workflow
User types "/commit" after making changes
Why skill: Consistent process every time. Follows team conventions. Runs in context so Claude knows what was changed.
GitHub Integration
"Create a GitHub issue for the bug we just discussed"
mcp__github__create_issueWhy MCP: Claude can't access GitHub API directly. MCP provides the bridge with proper authentication.
Blog Post Creation
User types "/blog-writer" to create an SEO article
Why combined: Complex workflows often use all three. Skill orchestrates, MCP provides data, agents do research.