docker / docker/mcp-gateway

Feature request: Support custom OAuth2 providers in local catalog servers

Open
#449 1 comment 2 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Go
Stars
1.6k
Forks
278
Avg merge
7h 6m
Merged PRs (30d)
3

Description

Problem
The Docker MCP toolkit currently supports OAuth authentication only for a fixed set of pre-registered providers (GitHub, Asana, Atlassian, etc.). There is no way to define a custom OAuth2 provider in a local catalog server entry.

This creates a problem for APIs that use rotating OAuth2 tokens (i.e., both the access token and refresh token are replaced on each refresh). With rotating tokens:

Secrets don't work — secrets are static; once the access token expires and the server gets a new access + refresh token pair, the old refresh token is invalidated. On the next container restart, the stale refresh token is loaded and authentication fails permanently.
The only workaround is to volume-mount a credentials file into the container so the server can write refreshed tokens back to the host filesystem.
Proposed Solution
Allow custom OAuth2 provider definitions in the local catalog server schema, e.g.:

registry:
my-server:
image: my-server:latest
oauth:
providers:
- provider: custom
tokenUrl: https://api.example.com/oauth/token
clientId: example_public
clientSecret: example_public
grantType: refresh_token
secretMapping:
accessToken:
secret: my-server.access_token
env: ACCESS_TOKEN
refreshToken:
secret: my-server.refresh_token
env: REFRESH_TOKEN

The toolkit would handle the token refresh cycle and update its secret store with the new token pair, eliminating the need for volume-mounted credential files.

Current Workaround
volumes:

  • /host/path/credentials.env:/app/.env

The container reads and writes credentials from the mounted file. This works but ties the server to a specific host path and exposes credentials as a plain file.

Related Issues
#172 — OAuth 2.1 for remote servers

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by locating the local catalog server schema and the existing handling for pre-registered OAuth providers. Trace how secrets and refreshed tokens are stored, then define the changes needed for custom provider configuration and rotating token pairs. Done means a local catalog entry can refresh both tokens and persist the replacement pair without a mounted credentials file.

Written by the indexing model from the issue text.

Assessment

Tech stack
docker, go
Domain
authentication, cli, security
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.