We’ve been building some open-source tools to make it easier to run remote MCP servers securely using Zero Trust principles — especially when those servers need to access upstream OAuth-based services like GitHub or Notion.
Pomerium acts as an identity-aware proxy to:
- Terminate TLS and enforce Zero Trust at the edge
- Handle the full OAuth 2.1 flow for your MCP server
- Keep upstream tokens (e.g., GitHub, Notion) out of reach from clients
routes:
- from: https://github.your-domain
to: http://github-mcp.int:8080/mcp
name: GitHub
mcp:
upstream_oauth2:
client_id: xxxxxxxxxxxx
client_secret: yyyyyyyyy
scopes: ['read:user', 'user:email']
endpoint:
auth_url: 'https://github.com/login/oauth/authorize'
token_url: 'https://github.com/login/oauth/access_token'
sequenceDiagram
actor U as User
participant C as MCP Client
participant O as Upstream OAuth
participant P as Pomerium
participant S as MCP Server
U ->> C: Adds a server URL
C ->> P: Registers client, initiates auth
P ->> C: Sign-in URL
C ->> U: Redirect to sign-in URL
U ->> P: Sign-in
P ->> U: Redirect to upstream OAuth
U ->> O: Authenticate with upstream OAuth
O ->> P: Return Internal Token (TI)
P ->> C: Redirect to client
C ->> P: Obtain External Token (TE)
C ->> P: GET https://mcp-server Authorization: Bearer (TE)
P ->> O: Refresh (TI) if necessary
P ->> S: Proxy request to MCP Server, Bearer (TI)
If no upstream service, like GitHub, you still get Zero Trust
routes:
- from: https://my-mcp-server.your-domain.com
to: http://my-mcp-server.int:8080/mcp
name: My MCP Server
mcp: {}
sequenceDiagram
actor U as User
participant C as MCP Client
participant P as Pomerium
participant S as MCP Server
U ->> C: Adds a server URL
C ->> P: Registers client, initiates auth
P ->> C: Sign-in URL
C ->> U: Redirect to sign-in URL
U ->> P: Sign-in
P ->> C: Redirect to client
C ->> P: Obtain Token
C ->> P: GET https://mcp-server Authorization: Bearer Token
P ->> S: Proxy request to MCP Server
Our demo app (MCP App Demo) uses the OpenAI Responses API to show how LLM clients (like ChatGPT’s Connectors) can securely call MCP servers — without embedding tokens or managing OAuth themselves.
The companion project, MCP Servers, includes reference implementations (e.g., Notion) already integrated with Pomerium.