Skip to main content

What are MCP Servers?

MCP Servers are the powerhouse behind agents in the mcp-agent framework. They provide specialized capabilities to agents through the Model Context Protocol (MCP), acting as external tools, data sources, and services that agents can access. Think of MCP servers as:
  • Tools that agents can call to perform specific tasks
  • Data sources that provide access to information and resources
  • Services that extend agent capabilities beyond the base LLM
  • Independent processes that can be developed, deployed, and scaled separately
Core Concept: MCP Servers extend agent capabilities by providing tools, resources, and prompts through a standardized protocol.

Server Types and Transports

The mcp-agent framework supports multiple transport mechanisms for connecting to MCP servers:

STDIO (Standard Input/Output)

Best for local development and subprocess-based servers:

Server-Sent Events (SSE)

Ideal for streaming responses and real-time data:

WebSocket

For bidirectional, persistent connections:

Streamable HTTP

For HTTP-based servers with streaming support:

Server Capabilities

MCP servers can provide three main types of capabilities:

1. Tools

Functions that agents can call to perform actions:

2. Resources

Data and content that agents can read and reference:

3. Prompts

Reusable prompt templates that agents can utilize:

Configuration Examples

Basic Server Configuration

Advanced Server Configuration

Creating Your Own MCP Server

FastMCP provides the easiest way to create MCP servers:

Integration Patterns

Using Servers with Agents

Server Development Best Practices

1. Error Handling

2. Input Validation

3. Async Operations

Advanced Features

Elicitation Support

Elicitation allows servers to request additional structured input from users during tool execution:

Production Considerations

Security

Performance

Monitoring

Getting Started

Explore example MCP servers and learn implementation patterns.

FastMCP Documentation

Learn more about FastMCP and the official MCP server toolkit.

Agent Integration

Learn how agents discover and use MCP server capabilities.