Hacktoberfest 2026: los issues que los mantenedores marcaron para octubre, abiertos y aptos para principiantes. Explorar issues de Hacktoberfest

Scopes not forwarded to DCR endpoint and duplication of RedirectUris

Abierto
#887 0 comentarios 0 reacciones 0 asignados Ver en GitHub

Nadie ha tomado este issue todavía.

Evaluación

Dificultad
4/5
Tiempo estimado
3-5 días
Aptitud para principiantes
45/100
Tipo de issue
Error
Claridad
Bastante claro
Estado de actividad
Estancado
Stack tecnológico
csharp

Línea de trabajo

Comienza con HttpClientTransport y el manejo de OAuth y DynamicClientRegistrationOptions, y luego sigue cómo ResourceMetadata.ScopesSupported llega a la solicitud DCR. Verifica que los scopes solicitados se reenvíen y determina cómo deberían conciliarse los valores de RedirectUri de OAuth y DCR; el trabajo está completo cuando ambos comportamientos están cubiertos sin requerir una configuración duplicada.

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

Descripción

area-auth bug needs confirmation P2

I have implemented an MCP server and added DCR support to my Duende Identity Server, and it all kind of works with the MCP Server and MCP Client in the SDK. However, one issue seems to be with scopes. The server declares it's supported scopes:

.AddMcp(options =>
{
    options.ResourceMetadata = new()
    {
        Resource = new Uri(serverUrl),
        AuthorizationServers = { new Uri(chronosIdp) },       
        ScopesSupported = ["mcp:tools"]
    };
});

However, in the request that my DCR endpoint receives, Scopes is null. Shouldn't the HttpClientTransport take the scopes from the MCP Server and add these to the DCR request?

Right now I can add them manually here, but a normal MCP tool user wouldn't know what scopes to request - that's why the MCP server declares them:

var transport = new HttpClientTransport(new()
{
    Endpoint = new Uri(serverUrl),
    Name = "Secure Chronos Client",
    OAuth = new()
    {
        Scopes = [ "mcp:tools", "chronosapi"], // shouldn't need to do this!
        RedirectUri = new Uri("http://localhost:1179/callback"),
        AuthorizationRedirectDelegate = HandleAuthorizationUrlAsync,
        DynamicClientRegistration = new DynamicClientRegistrationOptions
        {
            ClientName = "Chronos MCP Client",
            ClientUri = new Uri("http://localhost:1179/callback")            
        },
    }
}, httpClient, consoleLoggerFactory);

var client = await McpClient.CreateAsync(transport, loggerFactory: consoleLoggerFactory);

Also it seems a bit redundant to specify the same RedirectUri in the OAuth object AND the DCR object - they are necessarily the same so maybe if the DCR property is present the OAuth object can use the info there - or vice versa. Just to make it easier to set up correctly.

Lenguaje dominante
C#
Estrellas
4.5k
Forks
814
Merge medio
9 d 19 h
PR fusionados (30 d)
4

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.

Más de modelcontextprotocol/csharp-sdk

Todos los issues de modelcontextprotocol/csharp-sdk

Issues similares

Más issues de C#

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.