Model Context Protocol (MCP)
Model Context Protocol (MCP)
The Model Context Protocol (MCP) forces a separation between the definition of a tool (the server) and the consumption of a tool (the client/agent). Instead of hardcoding API integrations inside your agent's codebase, you build an MCP Server that exposes resources (data) and tools (functions). Any MCP-compliant agent can then discover and use these tools without custom glue code.
When to Use
- Standardization: When building an ecosystem of tools that many different agents need to use.
- Security: To expose internal data safely without giving the LLM direct database access.
- Modularity: To keep your agent logic clean and focused on reasoning, while the MCP server handles the "dirty work" of API connections.
- Portability: Tools built with MCP can be used by Claude Desktop, IDEs, and custom agents alike.
Use Cases
- Database Access: An MCP server that exposes safe SQL queries as tools.
- File System: An MCP server that allows an agent to read/write files in a sandboxed directory.
- API Wrapper: An MCP server that wraps the GitHub API, exposing actions like
create_issueorlist_prs.
Implementation Pattern
# MCP Server Implementation (Conceptual)
from fastmcp import FastMCP, tool
# Create a server
mcp = FastMCP("MyTools")
# Expose a tool
@mcp.tool()
def calculate_vat(amount: float, country: str) -> float:
"""Calculates VAT for a given country."""
rate = get_rate(country)
return amount * rate
# The Agent (Client) simply connects to this server
# and automatically "sees" the calculate_vat tool available for use.
# client.connect(mcp_server)
# response = client.chat("How much VAT for 100 EUR in Germany?")
More from lauraflorentin/skills-marketplace
multi-agent-collaboration
A structural pattern where multiple specialized agents communicate and coordinate to solve a problem that is too complex for a single agent. Use when user asks to "build a multi-agent system", "agents working together", "agent collaboration", or mentions team of agents, distributed agents, or swarm.
21reflection
A recursive pattern where an agent evaluates and critiques its own output to iteratively improve quality and catch errors. Use when user asks to "add self-reflection", "agent introspection", "self-critique", or mentions self-evaluation, meta-cognition, or quality self-assessment.
18human-in-the-loop
A hybrid pattern where the system pauses execution to request human approval, input, or disambiguation before proceeding with critical actions. Use when user asks to "add human approval", "require human review", "human-in-the-loop", or mentions approval workflows, human oversight, or escalation.
16planning
A high-level cognitive pattern where an agent formulates a structured sequence of actions (a plan) before executing any of them, ensuring goal-directed behavior. Use when user asks to "add planning to my agent", "task planning", "agent planning", or mentions plan generation, plan execution, or step-by-step planning.
14parallelization
A concurrency pattern where multiple agent tasks are executed at the same time to speed up processing or gather diverse perspectives. Use when user asks to "run agents in parallel", "parallelize tasks", "concurrent execution", or mentions parallel processing, fan-out, or batch execution.
13routing
A control flow pattern where a central component classifies an input request and directs it to the most appropriate specialized agent or tool. Use when user asks to "route between agents", "agent routing", "task dispatch", or mentions classifier routing, intent detection, or agent selection.
12