Skip to content

feat: allow extra client metadata fields in DCR registration#110

Merged
simonx1 merged 2 commits intomainfrom
feature/client-metadata-fields
Mar 22, 2026
Merged

feat: allow extra client metadata fields in DCR registration#110
simonx1 merged 2 commits intomainfrom
feature/client-metadata-fields

Conversation

@simonx1
Copy link
Owner

@simonx1 simonx1 commented Mar 20, 2026

Summary

Closes #108

Allows passing additional OIDC client metadata fields when constructing an OAuthProvider. These fields are included in the Dynamic Client Registration request and are typically displayed to users on the authorization consent page.

Changes

OAuthProvider

  • Added client_metadata: keyword arg to initialize (default: {}). Accepted fields: client_name, client_uri, logo_uri, tos_uri, policy_uri, contacts.
  • register_client merges extra metadata into the registration request.

ClientMetadata

  • Added optional fields: client_name, client_uri, logo_uri, tos_uri, policy_uri, contacts.
  • to_h includes them when set (omits nils via .compact).
  • from_h parses them correctly.

Usage

provider = MCPClient::Auth::OAuthProvider.new(
  server_url: "https://mcp.example.com",
  redirect_uri: "https://myapp.com/callback",
  client_metadata: {
    client_name: "My App",
    client_uri: "https://myapp.com",
    logo_uri: "https://myapp.com/logo.png",
    tos_uri: "https://myapp.com/tos",
    policy_uri: "https://myapp.com/privacy"
  }
)

Tests

  • client_metadata kwarg is stored and accessible
  • Extra fields appear in the DCR registration POST body
  • ClientMetadata#to_h includes extra fields when set, omits them when nil
  • ClientMetadata.from_h parses extra fields correctly
  • All existing specs pass

Branch: feature/client-metadata-fields
URL: https://github.com/simonx1/ruby-mcp-client/pull/new/feature/client-metadata-fields

…108)

Add support for optional OIDC client metadata fields (client_name,
client_uri, logo_uri, tos_uri, policy_uri, contacts) in ClientMetadata
and OAuthProvider. These fields are sent during dynamic client
registration and parsed from the server response.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@chatgpt-codex-connector
Copy link

Codex usage limits have been reached for code reviews. Please check with the admins of this repo to increase the limits by adding credits.
Credits must be used to enable repository wide code reviews.

@simonx1 simonx1 merged commit f91b4fa into main Mar 22, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Allow more fields for client register

2 participants