Skip to content

fix: advertise refresh_token grant in OAuth DCR + add Miro MCP example#3192

Open
aheritier wants to merge 2 commits into
mainfrom
miro-mcp-example
Open

fix: advertise refresh_token grant in OAuth DCR + add Miro MCP example#3192
aheritier wants to merge 2 commits into
mainfrom
miro-mcp-example

Conversation

@aheritier

Copy link
Copy Markdown
Contributor

What

Two related changes:

  1. Fix OAuth Dynamic Client Registration (RFC 7591) to advertise both authorization_code and refresh_token grant types. Previously only authorization_code was declared, which strict authorization servers reject during registration:

    client registration failed with status 400: {"error":"invalid_client_metadata","error_description":"grant_types must be authorization_code and refresh_token"}
    

    docker-agent already uses the refresh-token grant (RefreshAccessToken), so declaring it at registration is correct and backwards-compatible with lenient servers (Notion, Atlassian). Adds a regression test asserting both grants are sent.

  2. Add a Miro hosted MCP example (examples/miro-expert.yaml) demonstrating Miro's hosted MCP server (https://mcp.miro.com/) over streamable HTTP with OAuth 2.1 DCR. Includes four inline board skills (browse / diagram / doc / table) adapted from Miro's own skill set, a link to the official docs, and notes on the Enterprise-plan requirement. Registered in examples/README.md.

Why

The Miro MCP server (and any strict OAuth MCP server) is currently unusable via docker-agent's remote MCP support. The fix unblocks it; the example documents the working configuration end to end.

Testing

  • task build, task test, task lint all pass
  • New test TestRegisterClient_GrantTypesIncludeRefreshToken covers the fix
  • examples/miro-expert.yaml validated with docker-agent run ... --dry-run
  • Manually verified: the OAuth flow against mcp.miro.com now completes successfully

Closes #3191

docker-agent's RFC 7591 dynamic client registration only advertised the
authorization_code grant. Strict authorization servers that require clients
to declare every grant they use (e.g. Miro's hosted MCP server at
mcp.miro.com) reject the registration with:

  invalid_client_metadata: grant_types must be authorization_code and refresh_token

docker-agent already uses the refresh_token grant via RefreshAccessToken, so
declaring it at registration time is correct and backwards-compatible with
lenient servers (Notion, Atlassian).

Fixes #3191
Add examples/miro-expert.yaml demonstrating Miro's hosted MCP server
(https://mcp.miro.com/) over streamable HTTP with OAuth 2.1 Dynamic Client
Registration. Includes four inline board skills (browse, diagram, doc, table)
adapted from Miro's own skill set, plus a link to the official docs and notes
on the Enterprise-plan requirement. Registers the example in examples/README.md.
@aheritier aheritier requested a review from a team as a code owner June 20, 2026 17:16

@docker-agent docker-agent left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Assessment: 🟢 APPROVE

The changes in this PR are correct and well-structured:

pkg/tools/mcp/oauth_helpers.go — The fix to advertise refresh_token alongside authorization_code in the DCR grant_types array is the right call per RFC 7591. Docker-agent already uses the refresh-token grant (RefreshAccessToken), so declaring it at registration is required for strict servers and harmless for lenient ones. No logic errors or correctness issues found.

pkg/tools/mcp/oauth_test.go — The new TestRegisterClient_GrantTypesIncludeRefreshToken test is well-structured, uses require/assert per project conventions, and correctly exercises the registration body content.

examples/miro-expert.yaml / examples/README.md — Documentation-only additions following the existing config schema and examples pattern. No issues.

@aheritier aheritier self-assigned this Jun 20, 2026
@aheritier aheritier added area/mcp MCP protocol, MCP tool servers, integration kind/fix PR fixes a bug (maps to fix: commit prefix) labels Jun 20, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/mcp MCP protocol, MCP tool servers, integration kind/fix PR fixes a bug (maps to fix: commit prefix)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

OAuth dynamic client registration omits refresh_token grant, breaking strict servers (e.g. Miro MCP)

3 participants