New researchThe State of Autonomous Agent Governance: what 300 CISOs and CSOs told us300 CISOs on agent governanceGet the report →
Agen.co
  • Platform
  • Solutions
  • Resources
  • Customers
  • Pricing
  • AI-Native Guide
LoginBook a demo
Platform
Platform overviewOne platform between every agent and everything it touchesArchitectureOne gateway between workforce and systemsWatch it liveThe portal governing, in real time
Capabilities
DiscoverFind the AI agents your systems recordedGovernPer-action verdicts in under 30msShieldAgenShield on the device, BrowserShield in the browser · EA
Foundation
Identity foundationAnchored to the IdP you already runExternal MCPCustomer and partner agents on the same policy plane
Watch the 2-minute platform tour →
By outcome
Confident AI adoptionSay yes to AI, without losing controlAccountability & auditA human answers for every agentAutonomous operationsGovernance that runs itselfRisk preventionStop the breach before the first action lands
By role
The CISOThe security teamIT & platformDevelopers
By industry
Financial servicesSoftware & technologyHealthcareConsumer & digital media
Use cases
Secure enterprise copilotsCopilot, Cursor, Claude Code, governed per actionGovern autonomous agentsAutonomy on the work, humans on the triggerStop AI data leaksBrowserShield stops the paste, early accessApprove agents in hoursOnboarding as a policy decisionMCP governanceInternal and external, one planeContinuous audit evidenceThe binder writes itself
The AI-Native Guide 2026: what an AI-native company actually runs →
Featured
State of Agent GovernanceNew research: 300 CISOs on the agents insideAI-Native Guide 2026Five stages, eight departments, one checklistPlatform comparisonsScored against vendor docs, every source publishedCustomer storiesProof from the field
Learn
All resourcesBlog & resource center ↗Learning CenterUse casesIndustriesWho it serves
Company
AboutTrust & securityPricingContact
Agen.cobyFrontegg
Identity-native agentic governance.
Scale AI agents. Keep a human accountable for every one.
SOC 2ISO 27001GDPR
Platform
OverviewDiscoverGovernPolicy engineShieldIdentity foundation
Solutions
Confident AI adoptionAccountability & auditAutonomous operationsRisk prevention
Learn
AI-Native Guide 2026Use casesAgen for WorkAgen for SaaSIndustriesWho it serves
Company
AboutCustomersTrust & securityPricingBook a demo
Resources
Blog & resource centerLearning CenterPlatform comparisonsMCP GatewayAgent governance researchLive sessionsDocs
© 2026 Agen.co by Frontegg
Privacy PolicyTerms of Service
  1. Learning Center
  2. /
  3. MCP
  4. /
  5. What is an MCP Server? A Guide to Model Context Protocol Servers
MCPGuide

What is an MCP Server? A Guide to Model Context Protocol Servers

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.

Keon Armin
Keon ArminDigital Marketing Manager
March 12, 2026/22 min read
What is an MCP Server? A Guide to Model Context Protocol Servers

In this article

  1. What is an MCP Server?
  2. Why MCP Servers Matter for AI Development
  3. MCP Server Architecture: How MCP Servers Work
  4. MCP Server vs. API: What's the Difference?
  5. MCP Server vs. RAG, Function Calling, and LangChain
  6. Top MCP Server Use Cases
  7. Popular MCP Server Examples
  8. Is MCP Server Free?
  9. How to Build an MCP Server (Step-by-Step)
  10. MCP Server Security Considerations
  11. MCP Server FAQ

In this article

  1. What is an MCP Server?
  2. Why MCP Servers Matter for AI Development
  3. MCP Server Architecture: How MCP Servers Work
  4. MCP Server vs. API: What's the Difference?
  5. MCP Server vs. RAG, Function Calling, and LangChain
  6. Top MCP Server Use Cases
  7. Popular MCP Server Examples
  8. Is MCP Server Free?
  9. How to Build an MCP Server (Step-by-Step)
  10. MCP Server Security Considerations
  11. MCP Server FAQ

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.

What is an MCP Server?

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.

Why MCP Servers Matter for AI Development

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.

One protocol turns N x M integrations into N + M: point-to-point wiring on the left, one shared protocol on the right
A shared protocol is why MCP servers scale: each model and each tool integrates once, so connections grow as N + M instead of N × M.

The impact on the ecosystem has been fast and measurable. Within months of MCP's public launch, major platforms adopted it:

  • Claude Desktop and Claude Code were among the first native MCP hosts
  • OpenAI added MCP support so ChatGPT can connect to MCP servers
  • VS Code and Cursor integrated MCP for connecting coding assistants to external tools
  • AWS, Cloudflare, Supabase, and Figma all shipped official MCP servers
  • Community directories like mcpservers.org now catalog hundreds of available servers

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: How MCP Servers Work

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.

Core Components: Host, Client, Server

Every MCP interaction involves three roles:

  • MCP Host: The AI application the user interacts with. This could be Claude Desktop, VS Code with Copilot, Cursor, or any application that supports the protocol. The host coordinates user requests and manages connections to one or more servers.
  • MCP Client: A connector that lives inside the host application. Each client communicates with exactly one MCP server and attaches the protocol version and its capabilities to every request. When a host connects to three servers, it creates three separate client instances.
  • MCP Server: The program that exposes capabilities from an external system. It translates protocol requests into actions on the underlying service (querying a database, calling an API, reading a file) and returns structured responses.

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 server architecture in four layers: four stacked bands: host and clients, protocol, MCP servers, external systems
MCP server architecture separates the host, the protocol layer, the MCP servers and the systems they wrap, so the model never touches a system directly.

What MCP Servers Expose (Tools, Resources, Prompts)

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.

Transport Mechanisms (STDIO and Streamable HTTP)

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 transport from prototype to production: local STDIO, then remote Streamable HTTP, then servers behind a gateway
Most MCP servers start on STDIO, move to Streamable HTTP when they need remote users, and reach production behind authentication and a gateway.

Security and Human-in-the-Loop Controls

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.

Step-by-Step Request Flow

Here's what happens when a user asks an AI assistant a question that requires external data:

  1. User sends a message: The user types a question or instruction in the host application.
  2. Model analyzes intent: The LLM reviews the available tools (listed via tools/list; clients may call server/discover first to learn what the server supports) and decides which tools are needed.
  3. Client routes the request: The MCP client sends a tools/call request to the appropriate server with typed arguments.
  4. Server executes the action: The MCP server processes the request against the underlying system (queries the database, calls the API, reads the file).
  5. Server returns results: Structured response data flows back through the client to the host.
  6. Model formulates a response: The LLM uses the tool results as context to generate a natural language answer.
  7. User sees the response: The final answer is displayed, often with the option to view the underlying tool calls for transparency.
How an MCP server handles a tool call: seven steps in two rows, from the user's message to the answer they see
A single MCP server tool call passes through the host, client and server and back, and the model only ever sees the structured result.

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.

MCP Server vs. API: What's the Difference?

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 APIMCP Server
Designed forApplication-to-applicationAI agent-to-system
DiscoveryStatic documentation (OpenAPI specs)Dynamic runtime discovery (tools/list)
InvocationHardcoded endpoint callsModel-driven, intent-based tool selection
ContextStateless request/responseSelf-contained requests; continuity comes from explicit handles the model passes forward
Integration effortCustom code per API per consumerOne MCP server serves all MCP clients
User interactionNone (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 Server vs. RAG, Function Calling, and LangChain

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.

Top MCP Server Use Cases

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.

Connecting AI Agents to Enterprise Data (CRM, ERP, HCM)

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.

Federating Access Across Data Silos

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.

Integrating with APIs and External Services

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.

DevOps and Infrastructure Management

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.

Design-to-Code Workflows

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.

Data Privacy and Compliance Enforcement

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.

Popular MCP Server Examples

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.

Is MCP Server Free?

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.

How to Build an MCP Server (Step-by-Step)

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.

Prerequisites and System Requirements

  • Python 3.10 or higher
  • The uv package manager (recommended) or pip
  • An MCP-compatible host for testing (Claude Desktop, VS Code, or Cursor)

Setting Up Your Environment

Install the MCP SDK and create a project:

pip install mcp
mkdir my-mcp-server && cd my-mcp-server
touch server.py

Building Your First MCP Server

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\" }"

Implementing Tools and Resources

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.

Testing with Claude for Desktop

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.

Logging and Best Practices

When building MCP servers, follow these guidelines:

  • Never write to stdout in STDIO-transport servers: it corrupts JSON-RPC messages. Log to stderr, or use OpenTelemetry for structured telemetry; the protocol-level logging feature is deprecated as of the 2026-07-28 specification.
  • Keep servers narrowly focused: A server that does one thing well is easier for AI models to reason about than a server that exposes dozens of unrelated tools.
  • Validate inputs rigorously: Treat all tool inputs as untrusted. Use JSON Schema validation and sanitize parameters before passing them to underlying systems.
  • Implement proper error handling: Return structured error messages that help the AI model understand what went wrong and suggest corrective actions.

Building an MCP Server With Secure Read/Write Access for Agents

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:

  • Scope the tool list: The specification lets 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.
  • Enforce on the server, not the annotation: Tool annotations such as 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.
  • Validate, access-control and rate-limit every invocation: The specification requires servers to do all three. On a generation server, the rate limit doubles as a cost cap, since every render burns GPU time.
  • Return generated media as a link: Hand back a 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:

  1. Routine reads (list or read assets): allow automatically.
  2. Sensitive reads (private assets, customer data): mask fields and log every access.
  3. Routine writes (rename, tag, reversible edits): require the write scope plus a confirmation.
  4. High-impact writes (generate video, delete assets): confirm, rate-limit and audit every call.
Read vs write access for agent tools: a 2x2 grid of read and write tools by impact, with destructive writes most gated
Secure MCP server design gates access by impact: reads flow freely, while destructive or costly writes need scope, confirmation and limits.

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.

Deploying and Hosting

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.

MCP Server Security Considerations

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.

MCP server security through one gateway: a central MCP gateway applying identity, policy and audit to four MCP servers
MCP server security scales through one gateway that applies identity, policy and audit to every server instead of rebuilding them in each.

MCP Server FAQ

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.

Keep reading

More from MCP

View all
MCP

What Is the OWASP Top 10 for MCP?

The OWASP Top 10 for MCP lists the ten biggest Model Context Protocol security risks. Here is every entry, real CVEs, and where to enforce each fix.

Agen.co·July 29, 2026
MCP

MCP Security: Risks, Best Practices & Enterprise Guide

Keon Armin

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.

Keon ArminKeon Armin·March 13, 2026
MCP

What Is MCP Authentication? Complete Guide

Learn how MCP authentication secures AI agent access to tools and APIs using OAuth 2.1, PKCE, and token validation. Covers flows, patterns, and best practices.

Keon ArminKeon Armin·March 13, 2026
View all guides