modelcontextprotocol / modelcontextprotocol/python-sdk

Implement server-side support for Client ID Metadata Documents (CIMD)

Abierto
#1,801 3 comentarios 0 reacciones 0 asignados Ver en GitHub

Nadie ha tomado este issue todavía.

auth enhancement needs decision P2
Lenguaje dominante
Python
Estrellas
24.3k
Forks
4k
Merge medio
1 d 1 h
PR fusionados (30 d)
31

Descripción

Summary

PR #1652 implemented client-side support for Client ID Metadata Documents (CIMD) per SEP-991, but the server-side implementation is missing. Authorization servers built with the Python SDK cannot currently support CIMD.

Background

CIMD (draft-ietf-oauth-client-id-metadata-document-00) allows OAuth clients to use HTTPS URLs as client identifiers, where the URL points to a JSON document containing client metadata. This is the recommended registration approach per the MCP spec (ahead of DCR).

From the MCP Authorization spec:

Authorization servers and MCP clients SHOULD support OAuth Client ID Metadata Documents

Current State

Client-side (implemented in #1652)
  • is_valid_client_metadata_url() - validates HTTPS URLs with path component
  • should_use_client_metadata_url() - checks if server advertises CIMD support
  • create_client_info_from_metadata_url() - uses URL as client_id
  • ✅ OAuth flow integration with DCR fallback
Server-side (missing)
  • ❌ Never advertises client_id_metadata_document_supported=true in OAuth metadata
  • ❌ No detection of URL-formatted client_ids
  • ❌ No metadata document fetching
  • ❌ No validation (client_id matching, redirect_uri verification, document structure)
  • ❌ No caching infrastructure
  • ❌ No SSRF protection for fetching

Spec Requirements for Authorization Servers

From the MCP spec and CIMD RFC:

Requirement Level
Fetch metadata documents when encountering URL-formatted client_ids SHOULD
Validate that fetched document's client_id matches the URL exactly MUST
Validate redirect URIs against those in the metadata document MUST
Validate document structure is valid JSON with required fields MUST
Cache metadata respecting HTTP cache headers SHOULD
Protect against SSRF attacks SHOULD
Limit document size (~5KB recommended) SHOULD
Display client_id hostname during consent SHOULD
Never cache error responses MUST NOT

References

AI Disclaimer

Guía de contribución

Abrir la guía de contribución

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Línea de trabajo

Empieza revisando la compatibilidad con CIMD en el cliente en PR #1652, así como los metadatos de OAuth del SDK y el manejo de la autorización en el servidor. Relaciona la detección de URL client_id ausente, la obtención de documentos, la validación, el almacenamiento en caché y las protecciones contra SSRF con los puntos de entrada existentes. Se considera completado cuando los servidores de autorización anuncian compatibilidad con CIMD y cumplen los requisitos indicados de CIMD y MCP sin almacenar en caché los errores.

Escrito por el modelo de indexación a partir del texto del issue.

Evaluación

Stack tecnológico
python
Área
api, authentication, backend, security
Tipo de issue
Nueva funcionalidad
Dificultad
5/5
Tiempo estimado
Más de una semana
Estado de actividad
Estancado
Claridad
Bastante claro
Aptitud para principiantes
35/100

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.