MCP Servers

7 Mins to read

MCP servers production

What is an MCP Server? (Introduction to the Ecosystem)

An MCP Server is the specialized bridge within the Model Context Protocol that connects AI models to specific external data sources and tools. By standardizing how systems communicate, these servers act as the “limbs” of agentic AI, empowering autonomous agents to not only retrieve information but to execute complex tasks across your infrastructure safely.

Building on the foundational concepts covered in our first blog, this article focuses on the next critical hurdle for production deployments: authorization. The MCP ecosystem is gaining rapid momentum, with major players like AWS, Google, Databricks, and Microsoft actively developing servers. The landscape has expanded to include:

  • 20+ Reference Servers: Built‑in examples demonstrating core protocol features.
  • 115+ Official Integrations: Production‑quality servers maintained by platform vendors.
  • 300+ Community Servers: A growing library of community‑contributed implementations.
  • 10+ Frameworks: SDKs and tools designed to accelerate server and client builds.

As agentic AI adoption expands, one challenge becomes clear: how do we ensure AI infrastructure doesn’t get more access than it needs?

While MCP servers make integration seamless, they introduce risk. If an MCP server is granted full, unchecked authorization, it could expose confidential information or allow unintended actions by autonomous agents.

MCP server concept explained

Understanding the Problem

By design, agentic AI and AI agents can operate autonomously and interact with multiple systems. If we hand them unrestricted access, we lose the ability to control what data or actions they can perform, increasing the risk of data leaks, compliance violations, or even malicious behavior.

MCP server resolves the problem

Why Do We Need Authorization at All?

MCP servers often handle sensitive data and critical actions, making authorization a fundamental aspect of their security. OAuth 2.0 / 2.1 serves as the foundation for MCP’s authorization framework, enabling users to grant AI agents limited access without exposing passwords or API keys.

OAuth in MCP: The Challenge

The MCP specification mandates the use of OAuth 2.0 / 2.1 for authorization but leaves the implementation details to developers. This flexibility can lead to misunderstandings—some teams may assume that every MCP server must operate its own OAuth service.

In reality, OAuth defines distinct roles: the Authorization Server, which issues tokens, and the Resource Server (your MCP API), which validates them. Requiring every MCP server to also function as an authorization server is unnecessary and inefficient.

From a product and operational perspective, this distinction is critical. Forcing every MCP server to manage authorization increases complexity, slows development, and creates scalability challenges. In an ecosystem with many clients and servers, manually registering each client on every server is not scalable.

The MCP specification strongly recommends that MCP Servers (authorization servers) support Dynamic Client Registration. This approach allows new MCP clients to register automatically, reducing friction and enabling a smoother user experience. By embracing this model, teams can focus on building core MCP functionality while ensuring secure, scalable authorization.

Best Practices for MCP Authorization

To make MCP servers production-ready, it is essential to implement authorization correctly. The following best practices help ensure secure and scalable MCP deployments:

1. Separate the Authorization Server

Keep your MCP server focused on its core functions by acting solely as an OAuth 2.0 / 2.1 Resource Server (see figure below). Delegate login and token issuance to a dedicated Authorization Server. In practice, this means leveraging an external OAuth provider—such as your enterprise Identity Provider (IDP) or services like Auth0 or Google—rather than building an authentication UI into the MCP server. For example, Atlassian’s MCP integration delegates authorization to their existing cloud identity system, offloading single sign-on (SSO), multi-factor authentication (MFA), and auditing to proven systems.

Abstract MCP Server Flow

2. Enable Dynamic Client Registration and Discovery

Make your OAuth setup flexible by supporting Dynamic Client Registration (RFC 7591), which allows new MCP clients to register automatically. Implement OAuth Authorization Server Metadata (RFC 8414) so clients can auto-discover authorization endpoints.

This is essential because:

  • MCP clients won’t know all potential authorization servers in advance.
  • Manual registration would reduce usability.
  • Dynamic registration ensures seamless onboarding with new servers.
  • Authorization servers can enforce their own policies during registration.

If Dynamic Registration isn’t supported, servers must offer alternative methods to obtain client credentials:

  • Clients may need to hardcode credentials, or
  • Provide a UI for users to manually input credentials after self-registration.

3. Scope Access at the Tool/Function Level

Define granular OAuth scopes for each tool or function your MCP server exposes, for example, files.read or files.write. AI agents should request only the scopes they need, and users should see a consent screen detailing these permissions. Your MCP server must enforce these scopes to ensure agents can only invoke allowed actions. This limits potential damage if a token is misused and provides clear boundaries for the AI’s capabilities.

MCP Server Example: AUTH Implementation (Client/Server/Auth) (Python)

Security Best Practices

  • To secure the Model Context Protocol (MCP), servers must enforce strict authorization and session management.
  • They must prevent security attacks by always reconfirming user consent for new clients, especially when acting as a proxy.
  • The practice of “token passthrough” is forbidden; servers must validate that any received security token is specifically intended for them.
  • To stop session hijacking, every request must be individually authenticated, and servers must use secure, unpredictable session IDs that are bound to specific user information rather than using the session itself for authentication.
  • A very good (recommended reading) resource for MCP security best practices is available here

Conclusion

Authorization is a crucial piece in making MCP servers production-ready. While the MCP specification mandates OAuth 2.0 / 2.1 for authorization, it leaves implementation details to developers, which can lead to inconsistent or insecure setups if not carefully addressed.

Separating the Authorization Server from the MCP Resource Server simplifies development and improves scalability. Leveraging external OAuth providers, such as enterprise identity systems or services like Auth0 and Google, offloads complex authentication tasks and enables robust features like SSO, MFA, and auditing.

Supporting Dynamic Client Registration and OAuth Authorization Server Metadata allows MCP clients to register and discover authorization endpoints automatically, eliminating manual client setup and enhancing user experience.

Finally, enforcing fine-grained scopes at the tool or function level ensures agentic AI and AI agents only access what they are explicitly permitted to, reducing security risks and maintaining clear boundaries. By following these best practices, developers can build secure, scalable MCP servers that integrate seamlessly with existing identity infrastructures, making AI integrations both powerful and safe.