Skip to content

Add MCP Server Quickstart - #1179

Open
ProgrammerAL wants to merge 10 commits into
mainfrom
alrodri/mcp-docs
Open

Add MCP Server Quickstart#1179
ProgrammerAL wants to merge 10 commits into
mainfrom
alrodri/mcp-docs

Conversation

@ProgrammerAL

Copy link
Copy Markdown
Contributor
  • Added a quickstart page for an MCP Server demo using DCR
  • Added a Samples page for MCP Server with a link to the GitHub Samples repo

This is the documentation update for https://github.com/DuendeSoftware/customer-success/issues/864

@ProgrammerAL
ProgrammerAL requested review from khalidabuhakmeh and maartenba and a lite review from Copilot August 10, 2026 20:23
@ProgrammerAL ProgrammerAL self-assigned this Aug 10, 2026
@ProgrammerAL ProgrammerAL added documentation Improvements or additions to documentation enhancement New feature or request labels Aug 10, 2026

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Adds new Duende IdentityServer documentation covering an MCP Server demo that uses Dynamic Client Registration (DCR), plus a Samples landing page entry that links to the corresponding GitHub sample.

Changes:

  • Added a new quickstart: “Connecting an MCP Server and Client with DCR”
  • Added a new Samples page: “MCP Server and Client” with a LinkCard to the demo repo
  • Cross-linked the quickstart and the sample page

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.

File Description
astro/src/content/docs/identityserver/samples/mcp-server.mdx New samples page for the MCP demo, with links to DCR docs and the GitHub sample.
astro/src/content/docs/identityserver/quickstarts/8-mcp.mdx New end-to-end quickstart describing IdentityServer + MCP Server + console client setup using DCR.
Suppressed comments (4)

astro/src/content/docs/identityserver/quickstarts/8-mcp.mdx:29

  • Grammar: "The below steps … adds" should be "The steps below … add".
The IdentityServer project needs to be configured to use DCR to allow clients at runtime. The below steps disable the static clients and adds DCR. Add a new Duende IdentityServer InMemory project to its own directory inside the `mcp-quickstart` directory you created above.

astro/src/content/docs/identityserver/quickstarts/8-mcp.mdx:101

  • Typo in the code comment: "metadatada" should be "metadata".
        // this will add the default dynamic client registration endpoint to the discovery/metadatada documents

astro/src/content/docs/identityserver/quickstarts/8-mcp.mdx:170

  • Minor typo/formatting in the snippet comment: add a space after // for readability/consistency.
    //Add this line

astro/src/content/docs/identityserver/quickstarts/8-mcp.mdx:492

  • The XML doc comment block is malformed (it closes </summary> without opening <summary>) and the <param> names don’t match the method signature (authContext, not authorizationUrl/redirectUri). Since this is a copy/paste snippet, it’s worth keeping it correct.
/// Handles the OAuth authorization URL by starting a local HTTP server and opening a browser.
/// This implementation demonstrates how SDK consumers can provide their own authorization flow.
/// </summary>
/// <param name="authorizationUrl">The authorization URL to open in the browser.</param>
/// <param name="redirectUri">The redirect URI where the authorization code will be sent.</param>

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread astro/src/content/docs/identityserver/samples/mcp-server.mdx Outdated
Comment thread astro/src/content/docs/identityserver/samples/mcp-server.mdx Outdated
Comment thread astro/src/content/docs/identityserver/quickstarts/8-mcp.mdx Outdated

@maartenba maartenba left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Left a bunch of comments, roughly two groups:

  1. The reader arrives wanting to secure AI tools, not learn about DCR per se (it's a means to an end). Flipping to "here's how to secure your MCP server with IdentityServer (using DCR under the hood)"
  2. Elaboration on some concepts. It's not the easiest topic and I think we may be glossing over a couple of things currently.
  3. (OK three groups) Some formatting/Astro suggestions.

@@ -0,0 +1,596 @@
---
title: "Connecting an MCP Server and Client with DCR"

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Quickstarts is a good location, we can move it elsewhere when needed.

Comment thread astro/src/content/docs/identityserver/quickstarts/8-mcp.mdx Outdated
Comment thread astro/src/content/docs/identityserver/quickstarts/8-mcp.mdx Outdated
Comment thread astro/src/content/docs/identityserver/quickstarts/8-mcp.mdx Outdated
Comment thread astro/src/content/docs/identityserver/quickstarts/8-mcp.mdx Outdated
The console client will need to:

1. Use the `ModelContextProtocol` NuGet package to create an `HttpClientTransport` object to communicate with the MCP Server.
1. Include a `RedirectUri` back to itself after the user signs in.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Why is this redirect needed? Probably elaborate a little bit.

Comment thread astro/src/content/docs/identityserver/quickstarts/8-mcp.mdx
Comment on lines +456 to +461
AuthorizationCallbackHandler = HandleAuthorizationUrlAsync,
DynamicClientRegistration = new DynamicClientRegistrationOptions
{
ClientName = "ProtectedMcpClient"
},
Scopes = ["mcp:tools"],

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Do these need elaboration?

/// <param name="cancellationToken">The cancellation token.</param>
/// <returns>The authorization code extracted from the callback, or null if the operation failed.</returns>
// static async Task<string?> HandleAuthorizationUrlAsync(Uri authorizationUrl, Uri redirectUri, CancellationToken cancellationToken)
static async Task<AuthorizationResult?> HandleAuthorizationUrlAsync(AuthorizationCallbackContext authContext, CancellationToken cancellationToken)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Does this need elaboration in text?

### Run the Samples

Start the IdentityServer and MCP Server applications, then run the console client. When prompted to sign in for the console client, use username `bob` with password `bob` to sign in. The console will output the response from the MCP Server after it self-registers.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Maybe repeat with a list what happened behind the scenes? (client requested server, server said need auth via IdP URL, client sees it can self register with DCR, self registers client, then does interactive auth in the browser with new client ID, then makes request to server, ...)

@@ -0,0 +1,596 @@
---
title: "Connecting an MCP Server and Client with DCR"

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Make the title of the page "Dynamic Client Registration" while you can use a label in the sidebar to have it be DCR

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Frame it from AI/MCP perspective, DCR is secondary

_ = app.MapRazorPages()
.RequireAuthorization();

//Add this line

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Astro code blocks can highlight lines without comments like this. I think it is fine right now, but just a thought.

}
```

#### Hard Code Application Url

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

The use of "Hard Code" here is odd. "Setting the Application Url for Demo Purposes"


#### Configure MCP Tools

Create a new directory called `McpTools` and add a `WeatherTools.cs` C# file. This will be the API called by our clients. The code for the file is below.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

"Create a new directory within the project..."

}
```

### Run the Samples

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

It would be nice to see some of the console output from the MCP tool and the console client.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants