feat: PlatformSystemResourceProvider (system-scope MCP resources)#51
Merged
Conversation
Phase 5 (system slice). Opt-in via ExposeSystemResources on McpPlatformOptions. Read-only resources for Developer callers: - platform://system/apikeys — system API keys (raw values redacted) - platform://system/roles — registered tenant roles - platform://system/audit — recent audit entries (last 7 days, top 100) Non-developer callers get empty ListResourcesAsync and UnauthorizedAccessException from ReadResourceAsync. Each resource is listed only when its underlying dependency is registered. Cross-tenant team/member listings deferred — require a new ITeamService surface. 11 new tests, 235 total passing.
Codecov Report❌ Patch coverage is
📢 Thoughts on this report? Let us know! |
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
Phase 5 MCP work, system-scope slice. Exposes read-only diagnostic data under
platform://system/*for Developer callers.What's new
PlatformSystemResourceProviderinTharga.Platform.Mcp— opt-in viaMcpPlatformOptions.ExposeSystemResources(default false).Resources (listed only when the matching dependency is registered):
platform://system/apikeysIApiKeyAdministrationService.GetSystemKeysAsync()— raw values / hashes redactedplatform://system/rolesITenantRoleRegistry.Allplatform://system/auditCompositeAuditLogger.QueryAsync— last 7 days, top 100Non-Developer callers get an empty
ListResourcesAsyncandUnauthorizedAccessExceptionfromReadResourceAsync.Sample wiring
Tharga.Platform.Samplenow registers the MCP bridge:Deferred
Cross-tenant team listing (
platform://system/teams) and per-team API-key listing require a newITeamService.GetAllTeamsAsync()method and matching base-class / repository implementation. Tracked as a follow-up.A related cross-project request was filed under
Tharga.Mcpto haveUseThargaMcp()auto-apply.RequireAuthorization()whenThargaMcpOptions.RequireAuth == true. Once that lands,MapMcpPlatform()in this package becomes redundant.Tests
11 new (9 provider + 2 registration). Full suite: 235 passing.
Test plan
/mcprespondsExposeSystemResources = true, Developer sees the three resources; non-Developer sees none