Add hosted MCP server#2320
Draft
ejsmith wants to merge 12 commits into
Draft
Conversation
Member
Author
|
/preview |
|
Preview deployed
|
|
|
||
| public IEnumerable<ValidationResult> Validate(ValidationContext validationContext) | ||
| { | ||
| foreach (string redirectUri in RedirectUris.Where(String.IsNullOrWhiteSpace)) |
| yield return new ValidationResult($"'{redirectUri}' is not a valid absolute redirect URI without a fragment.", [nameof(RedirectUris)]); | ||
| } | ||
|
|
||
| foreach (string scope in Scopes.Where(String.IsNullOrWhiteSpace)) |
Comment on lines
+252
to
+257
| var refreshResponse = await client.PostAsync("oauth/token", new FormUrlEncodedContent(new Dictionary<string, string?> | ||
| { | ||
| ["grant_type"] = OAuthGrantTypes.RefreshToken, | ||
| ["client_id"] = ClientId, | ||
| ["refresh_token"] = token.RefreshToken | ||
| }), TestContext.Current.CancellationToken); |
Comment on lines
+265
to
+270
| var reusedRefreshResponse = await client.PostAsync("oauth/token", new FormUrlEncodedContent(new Dictionary<string, string?> | ||
| { | ||
| ["grant_type"] = OAuthGrantTypes.RefreshToken, | ||
| ["client_id"] = ClientId, | ||
| ["refresh_token"] = token.RefreshToken | ||
| }), TestContext.Current.CancellationToken); |
Comment on lines
+281
to
+284
| var response = await client.PostAsync("oauth/revoke", new FormUrlEncodedContent(new Dictionary<string, string?> | ||
| { | ||
| ["token"] = token.AccessToken | ||
| }), TestContext.Current.CancellationToken); |
Comment on lines
+50
to
+54
| foreach (string redirectUri in RedirectUris.Where(uri => !String.IsNullOrWhiteSpace(uri))) | ||
| { | ||
| if (!Uri.TryCreate(redirectUri, UriKind.Absolute, out var uri) || !String.IsNullOrEmpty(uri.Fragment)) | ||
| yield return new ValidationResult($"'{redirectUri}' is not a valid absolute redirect URI without a fragment.", [nameof(RedirectUris)]); | ||
| } |
Comment on lines
+59
to
+63
| foreach (string scope in Scopes.Where(s => !String.IsNullOrWhiteSpace(s))) | ||
| { | ||
| if (!AllScopes.Contains(scope, StringComparer.Ordinal)) | ||
| yield return new ValidationResult($"'{scope}' is not a supported OAuth scope.", [nameof(Scopes)]); | ||
| } |
Comment on lines
+62
to
+66
| catch (Exception ex) | ||
| { | ||
| logger.LogWarning(ex, "Unable to fetch OAuth client metadata document for {ClientId}.", clientId); | ||
| return null; | ||
| } |
Comment on lines
+65
to
+68
| catch (Exception) | ||
| { | ||
| return McpListResult<McpProjectResult>.Failed("Unable to list projects. Check the filter, sort, and limit values."); | ||
| } |
Comment on lines
+119
to
+122
| catch (Exception) | ||
| { | ||
| return McpListResult<McpStackResult>.Failed("Unable to search stacks. Check the project id, filter, sort, and limit values."); | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
/mcpinside the existing Exceptionless app so AI tools can query a user's Exceptionless projects directly/mcpfrom falling through to the web app shell by returning the correct OAuth challenge or method response for MCP clientsTesting
dotnet build tests\Exceptionless.Tests\Exceptionless.Tests.csproj -v:minimal -m:1dotnet test tests\Exceptionless.Tests\Exceptionless.Tests.csproj -- --filter-class Exceptionless.Tests.Controllers.ControllerManifestTestsdotnet test tests\Exceptionless.Tests\Exceptionless.Tests.csproj -- --filter-class Exceptionless.Tests.Controllers.OAuthApplicationControllerTests --filter-class Exceptionless.Tests.Controllers.OAuthControllerTests --filter-class Exceptionless.Tests.Controllers.OpenApiControllerTestsdotnet test tests\Exceptionless.Tests\Exceptionless.Tests.csproj --no-restore -- --filter-class Exceptionless.Tests.Controllers.OAuthControllerTestsnpm run lintinsrc/Exceptionless.Web/ClientAppnpm run checkinsrc/Exceptionless.Web/ClientAppnpm run buildinsrc/Exceptionless.Web/ClientAppnpm run openspec:validate -- add-oauth-api-accessinsrc/Exceptionless.Web/ClientApp/mcpGET /mcpbehavior/mcpOAuth protected-resource discovery metadatagit diff --checkrg "<<<<<<<|=======|>>>>>>>"Notes