Learn what MCP servers are, how they work, and why they matter for AI agents. Explore use cases, architecture, setup guides, security, and top MCP servers.
Your AI agents can reason, plan, and generate, but they can't do anything useful if they can't reach your systems. Without access to databases, APIs, file systems, and enterprise tools, even the most capable large language model is stuck inside its training data.
MCP servers solve this. They give AI applications a standardized way to connect to the outside world, and they're quickly becoming the default integration layer for enterprise AI.
An MCP server is a program that exposes tools, data and prompt templates to AI applications through the Model Context Protocol (MCP), an open standard originally developed by Anthropic for connecting models to external systems. It wraps a database, API or file system so any MCP-compatible agent can use it, which makes it core AI agent infrastructure.
Think of MCP as a USB-C port for AI. USB-C standardized how devices connect to peripherals. MCP standardizes how AI models connect to external systems. Before MCP, every integration between an AI application and an external tool required custom code, unique to both the model and the service. MCP replaces that fragmentation with a single protocol that any AI client and any server can speak.
Put the MCP server definition in practical terms and it's a lightweight service that wraps an existing system (a database, a SaaS API, a local file system, a CI/CD pipeline) and makes its functionality available to AI assistants. The server is not itself a model, and the AI model doesn't call the underlying system directly. Instead, it communicates with the MCP server through a well-defined interface of tools (actions the model can execute), resources (data the model can read for context), and prompts (reusable templates that guide the model through workflows).
For example, a GitHub MCP server might expose tools like create_pull_request and list_issues, resources like repository_readme, and prompts like code_review_workflow. An AI assistant connected to that server can then manage repositories, review code, and triage issues, all through natural language.
MCP servers can run locally on a developer's machine (using standard input/output for communication) or remotely as hosted services (using Streamable HTTP). This flexibility means MCP works across everything from single-developer IDE setups to enterprise-scale multi-agent architectures.
A shared standard matters because of what came before it. Integrating an AI assistant with external tools meant writing custom code for every combination of model and service. OpenAI had GPT Actions. Google had Gemini Extensions. Anthropic had tool use. Each ecosystem required its own integration work, and none of them were interoperable.
This created what the developer community calls the N × M problem. If you have N AI models and M external tools, you need N × M custom integrations. Add a new tool, and you need N new integrations. Add a new model, and you need M new integrations. The complexity scales quadratically, and maintenance becomes unsustainable.
MCP collapses that matrix into a single layer. Tool developers build one MCP server, and it works across every MCP-compatible client, including Claude, ChatGPT, VS Code, Cursor, Windsurf, and dozens more. AI platforms implement one MCP client, and they can connect to every MCP server in the ecosystem. The integration burden drops from N × M to N + M.
The impact on the ecosystem has been fast and measurable. Within months of MCP's public launch, major platforms adopted it:
For developers, this means build once, integrate everywhere. For enterprises, it means AI agents can access internal tools without locking into a single model vendor, and with the right MCP gateway (a proxy that applies authentication, policy and audit across many servers), they can do so with full governance. And for the broader AI ecosystem, it means a shared infrastructure layer that accelerates how quickly new capabilities reach production.
MCP server architecture follows a client-host-server model: a host application such as Claude or an IDE creates one MCP client per server, and each server exposes tools, resources and prompts over JSON-RPC 2.0. Since the 2026-07-28 specification, the protocol is stateless, so every request carries its own protocol version and capabilities.
For an MCP servers design overview, start with the three participants and the layers that connect them. The host owns the user and the model, each client owns one connection, and each server owns one external system.
Every MCP interaction involves three roles:
The specification also builds in isolation. A server receives only the context it needs to handle a request: it can't read the whole conversation, and it can't see into other servers. Only the host holds the full picture.
This separation means the AI model never touches the external system directly. The MCP client acts as an intermediary, routing requests from the host to the correct server and returning results.
MCP servers provide three types of primitives to AI applications:
Tools are executable functions the AI model can invoke. A weather MCP server might expose a get_forecast tool. A database server might expose run_query. Tools accept typed inputs (defined by JSON Schema), perform an action, and return structured results. Importantly, tool execution typically requires user approval: the model proposes a tool call, but the human confirms it.
Resources are read-only data sources that provide context. They're identified by URIs (like file:///path/to/document.md or database://schema/users) and include MIME types for proper handling. Resources support both direct URIs pointing to specific data and dynamic templates with parameters for flexible queries.
Prompts are reusable interaction templates authored by the server developer. They define structured workflows with typed parameters, for example a plan-vacation prompt that accepts destination, duration, and budget. Prompts help the model use tools and resources effectively without the user needing to craft complex instructions manually.
The combination of these three primitives gives MCP servers a layered capability model: tools for actions, resources for context, and prompts for guided workflows.
MCP supports two transport mechanisms that determine how clients and servers communicate:
STDIO (Standard Input/Output) is used for local MCP servers running on the same machine as the host. The host launches the server as a subprocess and communicates through stdin/stdout pipes. There's no network overhead, making STDIO the fastest option for local development. This is how most developers first interact with MCP: configuring a server in Claude Desktop or Cursor that runs on their own machine.
Streamable HTTP is used for remote MCP servers hosted on external infrastructure. Clients send requests via HTTP POST, and servers can stream responses back using Server-Sent Events (SSE). This transport supports standard HTTP authentication methods (bearer tokens, API keys, OAuth) and enables remote servers to serve multiple clients simultaneously. AWS MCP Server, Figma's MCP server, and Sentry's MCP server all use this transport. The older standalone HTTP+SSE transport, which used two endpoints (one to POST, one to stream), is deprecated in favor of Streamable HTTP, so new remote servers should not adopt it. The practical rule: start with STDIO while you experiment, and move to Streamable HTTP when you need remote access, multiple users, or authentication. Once shared servers reach production, put them behind authentication and a gateway that applies identity, policy and audit.
The protocol layer is transport-agnostic: the same JSON-RPC 2.0 messages work identically over both STDIO and Streamable HTTP.
MCP is designed with a human-in-the-loop model. When an AI assistant wants to execute a tool (say, sending an email or modifying a database record), the host application presents the action for user approval before it's executed. This prevents unintended side effects and keeps the human in control of consequential actions.
Beyond user approval, MCP servers can implement authentication and authorization at the transport layer. Remote servers typically use OAuth 2.1 or bearer tokens to verify client identity. Servers can enforce role-based access control (RBAC), restricting which tools or resources are available based on the authenticated user's permissions. For organizations deploying multiple MCP servers, an MCP gateway can centralize these security controls across all connections.
Here's what happens when a user asks an AI assistant a question that requires external data:
tools/list; clients may call server/discover first to learn what the server supports) and decides which tools are needed.tools/call request to the appropriate server with typed arguments.
Since the 2026-07-28 specification, the protocol core is stateless: every request carries its own protocol version and client capabilities, so multi-step workflows get their continuity from explicit handles and results the model passes forward rather than from a protocol-level session.
If an MCP server wraps existing systems, the obvious next question is how it differs from the APIs those systems already have. APIs have been the backbone of software integration for decades. They define structured endpoints, require explicit calls with specific parameters, and return predictable responses. MCP servers build on top of APIs rather than replacing them, but they serve a fundamentally different purpose.
The core distinction: APIs are designed for software-to-software communication. MCP servers are designed for AI-to-system communication.
A traditional REST API requires the calling application to know exactly which endpoint to hit, what parameters to pass, and how to interpret the response. The developer writes code that handles each integration explicitly.
An MCP server, by contrast, exposes capabilities in a way that AI models can discover and reason about dynamically. The model reads tool descriptions, understands input schemas, and decides when and how to use them based on user intent, not hardcoded logic.
| Traditional API | MCP Server | |
|---|---|---|
| Designed for | Application-to-application | AI agent-to-system |
| Discovery | Static documentation (OpenAPI specs) | Dynamic runtime discovery (tools/list) |
| Invocation | Hardcoded endpoint calls | Model-driven, intent-based tool selection |
| Context | Stateless request/response | Self-contained requests; continuity comes from explicit handles the model passes forward |
| Integration effort | Custom code per API per consumer | One MCP server serves all MCP clients |
| User interaction | None (backend process) | Human-in-the-loop approval for actions |
MCP servers don't eliminate APIs; they wrap them. Under the hood, an MCP server for Slack still calls the Slack API. An MCP server for a PostgreSQL database still executes SQL queries. MCP provides the standardized layer that lets AI agents orchestrate those API calls intelligently, choosing the right endpoints, composing multi-step workflows, and adapting to user intent in real time.
In short: APIs remain the plumbing. MCP servers are the AI-native interface layer on top.
Skills and plugins in some AI products are a related but narrower idea, often specific to one vendor. MCP is the open, cross-vendor standard for the same underlying need: giving a model governed access to capabilities.
MCP is often compared to other AI integration approaches. The key difference is scope: MCP is a protocol that governs how AI clients and servers communicate, while RAG, function calling, and frameworks like LangChain are techniques or tools used within specific implementations.
Retrieval-Augmented Generation (RAG) enhances LLM responses by retrieving relevant documents from a knowledge base before generating an answer. RAG focuses on feeding context into the model. An MCP server can serve as the retrieval layer in a RAG pipeline (exposing a search_documents resource that the model queries for context), but MCP itself is broader than retrieval alone.
Function calling (as implemented by OpenAI, Anthropic, and others) allows models to invoke predefined functions during a conversation. MCP standardizes how those functions are discovered, described, and invoked across different models and applications. Function calling is a capability; MCP is the protocol that makes it interoperable.
LangChain and similar frameworks provide developer tooling for building AI applications: chaining prompts, managing memory, orchestrating tool calls. These frameworks can use MCP servers as tool providers. In fact, MCP is designed to be framework-agnostic: a LangChain agent, a CrewAI workflow, or a custom Python script can all act as MCP clients.
The relationship is complementary, not competitive. MCP aims to be the equivalent of HTTP for AI agents, a shared communication standard that any tool, framework, or model can implement.
Once MCP is the interface layer, the real question is what to put behind it. These are the patterns showing up most often wherever AI agents need to interact with real systems in production.
Enterprise data lives in systems like Salesforce, SAP, Workday, and dozens of internal databases. Traditionally, giving an AI assistant access to this data requires building custom integrations for each source and maintaining them as schemas change.
An MCP server can sit in front of these systems and expose structured access. An AI agent can query customer records from a CRM, pull order history from an ERP, or look up employee data from an HCM system, all through the same protocol. The MCP server handles authentication, data formatting, and access control, so the AI model never touches the underlying system directly.
This pattern is particularly valuable for enterprise chatbots and internal copilots that need to answer questions spanning multiple business systems. Organizations deploying agents across SaaS products can use this approach to safely expose product capabilities to AI-driven usage.
Most enterprises don't have a single source of truth. Customer data is fragmented across CRM, support tickets, billing systems, and product analytics. An MCP server can act as a semantic layer that federates access to these silos through a unified interface.
Instead of the AI agent needing to know which system holds which data, it queries the MCP server, which orchestrates retrieval from the appropriate backends. This abstraction simplifies agent development and makes it possible to build AI workflows that span organizational boundaries without requiring a massive data warehouse migration.
MCP servers can wrap external APIs (exchange rate providers, geocoding services, stock market feeds, weather data) and present them as tools. The server handles API keys, rate limiting, response formatting, and error handling. The AI agent simply calls a tool like get_exchange_rate and receives clean, structured data.
This is especially useful when an agent needs to incorporate real-time external data into its responses without the complexity of managing dozens of API integrations at the application layer.
One of the most compelling MCP use cases is connecting AI assistants to infrastructure platforms. The AWS MCP Server gives AI agents authenticated access to AWS APIs, enabling tasks like creating infrastructure, reading CloudWatch logs, and deploying applications through natural language.
Similarly, the Argo CD MCP Server connects AI assistants to GitOps workflows: syncing applications, checking deployment status, and inspecting resources directly from an IDE. These integrations reduce context switching for platform engineers and make infrastructure operations accessible through conversation.
The Figma MCP server enables AI coding assistants to pull design context, variables, components, and layout data directly into an IDE. Developers can select a Figma frame, paste the URL into their AI assistant, and generate code that matches the design, complete with design system components and proper spacing.
The server also supports reverse workflows: capturing live UI from a running web application and sending it back to Figma as editable design layers.
By centralizing data access through MCP servers, organizations can enforce governance policies at a single control point. MCP servers can implement dynamic data masking (hiding sensitive fields based on the requester's role), tokenization, audit logging of every query, and guardrails that prevent unauthorized data access.
This is especially important in regulated industries (healthcare, finance, government), where AI agents must comply with data protection regulations while still being useful. Platforms like Agen sit between AI agents and applications to enforce identity, permissions, and data governance before any action occurs, providing the compliance boundary that ensures sensitive data is never exposed to models or users without appropriate authorization. For a deeper look at how this works, see how organizations are governing AI agents across enterprise apps.
Those patterns already run on real, widely used servers. Here are some of the most common:
GitHub Official Reference Servers: The modelcontextprotocol/servers repository on GitHub contains reference implementations for file systems, databases, Git, Slack, Google Maps, and more. These are designed as starting points for developers building custom servers.
AWS MCP Server: Amazon's managed remote server for authenticated access to AWS services, covered under DevOps above.
Figma MCP Server: Connects coding assistants to Figma designs for design-to-code and code-to-design work, as a remote hosted or local desktop server.
Supabase MCP Server: Connects AI agents to the Supabase platform for database operations, authentication management, edge functions, and storage.
Cloudflare MCP Server: Enables deployment, configuration, and management of Cloudflare resources including Workers, KV, R2, and D1.
Playwright MCP Server: Gives AI agents browser automation capabilities for web testing, scraping, and interaction.
Agen MCP Connector: An enterprise-grade MCP gateway that adds identity-aware connectivity, fine-grained tool authorization, data governance, and observability to any MCP server deployment. Agen sits between AI agents and applications, enforcing permissions and audit controls before any action reaches the underlying system.
mcpservers.org: A community-maintained directory that catalogs hundreds of available MCP servers across categories like web scraping, communication, productivity, development, databases, and cloud services.
Yes. The Model Context Protocol is an open-source standard, and most of the servers above cost nothing to run: anyone can build, deploy, and use MCP servers without licensing fees.
The official SDKs for Python, TypeScript, Java, Go, Rust, and other languages are freely available. Community-built servers on GitHub are open source. Running a local MCP server on your own machine costs nothing beyond compute resources.
For cloud-hosted servers, costs depend on the provider. The AWS MCP Server, for example, has no additional charges for the MCP layer itself; you pay only for the underlying AWS resources consumed. Similarly, Figma's remote MCP server is included with paid Figma plans.
The main cost consideration for enterprises is operational: building custom MCP servers for internal systems, maintaining them as schemas evolve, and implementing the security and governance layers needed for production deployment.
That operational cost starts with building the server, and the official SDKs keep that part straightforward. The Model Context Protocol documentation provides quickstart guides in Python, TypeScript, Java, Kotlin, C#, Ruby, Go, and Rust.
Here's the general workflow using Python as an example.
uv package manager (recommended) or pipInstall the MCP SDK and create a project:
pip install mcp
mkdir my-mcp-server && cd my-mcp-server
touch server.py
The Python SDK provides an MCPServer class (named FastMCP in earlier versions) that uses type hints and docstrings to automatically generate tool definitions:
from mcp.server import MCPServer
mcp = MCPServer("my-server")
@mcp.tool()
def get_weather(city: str) -> str:
"""Get the current weather for a city."""
# Your implementation here
return f"Weather data for {city}"
@mcp.resource("config://app")
def get_config() -> str:
"""Return application configuration."""
return "{ \"version\": \"1.0\" }"
Each tool is a decorated function with typed parameters. The decorator registers it with the MCP server, and the docstring becomes the tool's description that AI models use to decide when to call it. Resources work similarly but expose read-only data through URI-based access.
For production servers, you'll want to add error handling, input validation, and proper logging. The SDK supports structured error responses that help AI models understand and recover from failures.
To test locally, configure your MCP host to connect to your server. In Claude Desktop, edit the configuration file at ~/Library/Application Support/Claude/claude_desktop_config.json:
{
"mcpServers": {
"my-server": {
"command": "python",
"args": ["server.py"]
}
}
}
Restart Claude Desktop, and your server's tools will appear in the connector menu. You can verify by asking Claude to use one of your tools.
When building MCP servers, follow these guidelines:
To build an MCP server with secure read/write access for agents, split read tools from write tools, give each its own OAuth scope, and require human confirmation before any write runs. An image or video generation MCP server, for example, can let agents list and read assets freely while gating generate and delete calls.
Validation and focus keep a server correct; read/write separation keeps it safe once agents can change things. Here's how the split maps onto the protocol:
tools/list return only the tools the caller's granted scopes permit, so an agent holding a read-only token never even sees generate_video or delete_asset.readOnlyHint and destructiveHint help clients decide when to ask for confirmation, but clients must treat them as untrusted unless they come from a trusted server. The server checks the token's scope on every call.resource_link to the stored image or video rather than inline base64, so results stay small and the asset stays behind the same access checks.Put together, every tool on the server lands in one of four cases:
Issue those scopes to each agent's own identity rather than a shared API key, so every write traces back to the agent that made it.
How you host an MCP server depends on who needs to reach it. A local STDIO server is launched by the host on demand, with no network exposure and no separate hosting, which suits individual developer tooling. A remote Streamable HTTP server runs as a long-lived service, such as a container, a serverless function, or a managed platform, reachable over HTTPS, and it is what you deploy for shared and production use. Self-hosting gives you the most control over data residency and network placement; managed hosting trades some of that control for less operational overhead. Internal servers belong on a private network behind authentication and access control, so only authorized agents and users can connect. For the operational detail, see MCP server hosting.
Hosting decides where a server runs; security decides what it can do once something reaches it. Because MCP servers bridge AI agents to real systems (databases, APIs, infrastructure), every tool call is a potential vector for unintended actions.
Authentication and Authorization: Remote MCP servers should implement OAuth 2.1 authorization, as the MCP specification defines it, or bearer token authentication at the transport layer. Every tool and resource should enforce role-based access control (RBAC), ensuring that the authenticated user or agent only accesses what they're entitled to. The protocol describes how authorization works but doesn't enforce it for you (OWASP's MCP Security Cheat Sheet notes it is optional in the protocol): as a recent InfoWorld analysis points out, implementing authentication and authorization properly is the server developer's responsibility.
Data Masking and Tokenization: MCP servers that expose sensitive data should implement dynamic masking, returning redacted or tokenized values based on the requester's access level. A sales agent might see a customer's name and account status, while a support agent sees the full record including billing details.
Audit Logging: Every tool invocation, resource read, and prompt execution should be logged with the authenticated identity, timestamp, input parameters, and output. This creates an audit trail for compliance and incident response.
Human-in-the-Loop Controls: Beyond the per-call approval described in the architecture section, require confirmation for destructive, financial and data-sharing operations, and let read-only calls proceed automatically.
Prompt Injection Defense: MCP servers should validate that tool inputs contain only expected data types and values. Because AI agents may pass user-generated content as tool arguments, servers must sanitize inputs to prevent injection attacks against downstream systems.
Tool Poisoning and Fake Servers: A malicious or compromised tool description can steer the model into harmful behavior, and an agent pointed at a server that impersonates a trusted one can quietly exfiltrate data. Treat any server you did not write as untrusted until it has been reviewed, and prefer known sources. Pin the tool definitions you reviewed, too: a server can change a tool's description after approval (a "rug pull"), so re-review on any change. See MCP tool poisoning for how the attack works.
Credential Exposure and Over-Broad Scopes: Tokens and secrets a server holds can leak through logs, error messages, or over-broad tool outputs, and a server granted more access than it needs widens the blast radius if anything goes wrong. Expose the narrowest set of tools and scopes the use case requires, use OAuth 2.1 for remote servers (see MCP authentication), and apply fine-grained MCP access control. Never pass the MCP access token a client gave you through to upstream APIs; obtain separate credentials for those calls. For the full catalog, read MCP security and MCP security risks.
If data can't leave your network, an on-premises MCP server keeps the server and its credentials inside your perimeter.
Governance Platforms: For organizations managing multiple MCP servers at scale, dedicated governance layers like Agen sit as a gateway between agents and every server, providing centralized identity management, tool authorization policy, data masking, anomaly detection and audit across all agent-to-application interactions, without requiring each individual MCP server to implement these controls independently. The scaling AI agents governance gap is one of the biggest risks enterprises face as MCP adoption accelerates.
What is the difference between MCP and an MCP server? MCP (Model Context Protocol) is the open standard: the specification that defines how AI clients and servers communicate. An MCP server is one implementation of that standard, a running program that follows the protocol to expose tools, resources and prompts from a specific system, such as a database, a SaaS API or a file system.
Which AI tools support MCP servers? Claude Desktop and Claude Code were among the first MCP hosts, and VS Code, Cursor, Windsurf and Zed now connect to MCP servers too. ChatGPT also connects to MCP servers. Because the protocol is open, any application can add an MCP client, so the list of compatible tools keeps growing.
Where do MCP servers run? MCP servers run in three places. Local servers launch on a developer's machine and talk to the host over STDIO. Remote servers run as hosted services over Streamable HTTP with OAuth 2.1 authorization. On-premises MCP servers sit inside your network when data can't leave it. The architecture is the same in each case; only the transport and hosting change.
How do enterprises manage many MCP servers at scale? At scale, enterprises put an MCP gateway in front of their MCP servers. The gateway centralizes authentication, access control and audit, so each server doesn't implement them separately. Agen.co provides this as an accountability layer for agent-to-tool traffic, recording which agent called which tool, on whose behalf, and with what result.

Written by
Keon Armin
Digital Marketing Manager
What is MCP security? Learn the top risks - prompt injection, token theft, supply chain attacks, and enterprise best practices to secure AI agent tool calls.