# Overview

Give MCP clients and agents access to internal services, hosted MCP providers and databases through the Teleport MCP Gateway.

You can run the MCP Gateway in two modes:

- **For beam runtimes.** Your agents run in beams. `tsh` in each beam is already signed in with the roles you delegate to it, so an agent can call only the MCP tools and databases those roles allow.
- **As a standalone service.** MCP clients run wherever you sign in with `tsh`, such as your dev computer, and reach MCP servers and databases enrolled in your own infrastructure. No beam is involved.

<!-- illustration
id: mcp-gateway-modes
style: docs-isometric
type: animated
title: Two ways to run the MCP Gateway
description: Switch between agents in beam runtimes and MCP clients on your own computer. Both reach the same destinations through the same gateway.
sequence: Beam runtimes ↔ Standalone service

Show one scene with two labelled states that the reader switches with the shared state controls: "Beam runtimes" and "Standalone service". Do not draw two separate diagrams.

Keep the centre and right side identical and stationary in both states. In the centre, draw one Teleport MCP Gateway block with three small tags: role check, tool filter, audit log. On the right, draw three destination objects, each with a solid route from the gateway: "Internal MCP server" served by the Teleport Application Service, "Hosted MCP" with a small OAuth tag (for example Notion or Linear), and "PostgreSQL" served by the Teleport Database Service. Group the internal MCP server and PostgreSQL in a frame labelled "your infrastructure"; keep Hosted MCP outside it.

Beam runtimes state: on the left, a person labelled "you" hands a role badge labelled "delegated roles" to an "agent beam" compute block. The beam holds an agent and a tsh box labelled "beam identity". A solid route runs from the beam to the gateway.

Standalone service state: the beam and role badge are gone. On the left, a "dev computer" holds an MCP client (Claude Code, Cursor or VS Code) and a tsh box labelled "tsh login (SSO)". A solid route runs from the dev computer to the gateway.

Swap only the left-hand client between states; keep the gateway, destinations and their routes in place. Do not imply that a beam is published, that the beam or dev computer holds database passwords or provider tokens, or that either client connects to a destination directly without passing through the gateway.
-->

In both modes, Teleport checks your roles on every request and records it in the audit log. For MCP servers, it also hides the tools your roles don't allow.

The following guides work in both modes. Each one shows how to connect from your dev computer and from inside a beam. The MCP server and database guides run their demo servers in beams, so you don't need servers of your own. The Kubernetes guide uses a cluster you enroll yourself.

- [Internal services](/docs/mcp/internal-services/): Run an internal MCP server in a beam built from a phase, and call its tools through Teleport from your dev computer or from inside a beam.
- [OAuth for external services](/docs/mcp/oauth/): Connect to hosted MCP services through Teleport from your workstation or from inside a beam.
- [Databases](/docs/mcp/databases/): Run PostgreSQL in a beam built from a phase and query it from an MCP client through Teleport, with read-only access enforced by Teleport and PostgreSQL.
- [Kubernetes clusters](/docs/mcp/k8s-clusters/): Give an MCP client read-only access to a Kubernetes cluster through Teleport, from your dev computer or from inside a beam.
