Tharga.Team.Mcp 3.8.1

dotnet add package Tharga.Team.Mcp --version 3.8.1
                    
NuGet\Install-Package Tharga.Team.Mcp -Version 3.8.1
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Tharga.Team.Mcp" Version="3.8.1" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Tharga.Team.Mcp" Version="3.8.1" />
                    
Directory.Packages.props
<PackageReference Include="Tharga.Team.Mcp" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add Tharga.Team.Mcp --version 3.8.1
                    
#r "nuget: Tharga.Team.Mcp, 3.8.1"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package Tharga.Team.Mcp@3.8.1
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=Tharga.Team.Mcp&version=3.8.1
                    
Install as a Cake Addin
#tool nuget:?package=Tharga.Team.Mcp&version=3.8.1
                    
Install as a Cake Tool

Tharga Team Mcp

NuGet Nuget License

Team bridge for Tharga.Mcp. Connects MCP tool and resource invocations to Tharga.Team's authentication, scope enforcement, and audit logging.

Renamed from Tharga.Platform.Mcp. NuGet package IDs cannot be renamed, so this is a new ID and the old one is deprecated. Migrating is a deliberate step with two breaking changes: mcp.AddPlatform() is now mcp.AddTeam(), and every resource URI moved from platform:// to team:// — update any MCP client that references them by string.

What it does

  • Populates IMcpContext from the authenticated HttpContext.User (works with both OIDC and API Key authentication)
  • Enforces provider scope class: McpScope.System requires Roles.Developer, McpScope.Team requires team membership
  • Emits audit log entries for every MCP tool invocation — success and failure
  • Registers built-in mcp:* scopes in both of Team's scope registries — see below
  • Requires authentication on the MCP endpoint — anonymous requests are rejected

Quick start

builder.Services.AddThargaMcp(mcp =>
{
    mcp.AddTeam();        // bridge to Team auth/scopes/audit
    // ... other provider packages (e.g. mcp.AddMongoDB())
});

app.UseThargaMcp();

Granting mcp:discover

AddTeam() registers the built-in mcp:* scopes in both the team and the system registry, because both routes to holding one are legitimate. mcp:discover can therefore be granted three ways:

Route How Where it authorizes
Access level Registered at AccessLevel.Viewer, so any member at Viewer or above holds it Inside the caller's selected team
App role o.ConfigureSystemRoles = r => r.Map("Developer", McpScopes.Discover); System-wide, no team needed
System API key Grant it when minting the key System-wide, no team needed

IMcpScopeChecker accepts either provenance. A system grant authorizes with no team selected; a team grant authorizes only alongside a TeamKey claim — a scope claim without a team context is not a grant, and is refused.

public sealed class MyTool(IMcpScopeChecker scopeChecker)
{
    public Task<string> ListAsync()
    {
        scopeChecker.Require(McpScopes.Discover);   // throws UnauthorizedAccessException if not held
        ...
    }
}

IMcpScopeChecker is an opt-in helper for tools that want to enforce a scope imperatively; nothing in this package or Tharga.MongoDB.Mcp calls it for you.

Behaviour change. mcp:discover was previously registered as a team scope but checked only against system claims, so an access-level grant could never satisfy it and a tool calling Require(McpScopes.Discover) rejected every caller — including a team Owner. If you wrote a test asserting that rejection, it now passes the caller instead.

User and team resources

Always-on resource providers that surface the authenticated caller's own data. Both providers self-gate on the principal's claims, so anonymous and system-only callers see no resources.

User scope (McpScope.User)

URI Contents
team://me The caller's IUser (key, identity, name, email) and a memberships array — for each team the caller is in, its teamKey, teamName, plus the caller's accessLevel and membership state.

Listed when the principal carries a NameIdentifier (or equivalent) claim. Read fails with UnauthorizedAccessException if IUserService.GetCurrentUserAsync returns null.

Team scope (McpScope.Team)

URI Contents
team://team Metadata for the caller's current team (from the TeamKey claim): key, name, icon, consentedRoles.
team://team/members Members of the current team: key, name, accessLevel, state, tenantRoles, scopeOverrides, and an invited flag.
team://team/apikeys API keys for the current team. Raw key values are redacted (the apiKey property is omitted entirely). Listed only when IApiKeyAdministrationService is registered.

Listed only when the principal carries a TeamKey claim. Read fails with UnauthorizedAccessException if no team is selected. Cross-tenant team listing (reading other teams) is intentionally not supported here — that's a future system-scope provider once ITeamService.GetAllTeamsAsync is added.

System-scope diagnostic resources (opt-in)

Expose read-only diagnostic data under team://system/* for callers with the Developer role. Non-developers see no resources and get UnauthorizedAccessException on read.

builder.Services.AddThargaMcp(mcp =>
{
    mcp.AddTeam(o =>
    {
        o.ExposeSystemResources = true;
    });
});

Available resources (listed only when the matching dependency is registered):

URI Contents
team://system/apikeys System API keys (not bound to a team). Raw key values are redacted.
team://system/roles Tenant roles registered via AddThargaTenantRoles
team://system/audit Most recent ~100 audit entries from the last 7 days

Per-team API-key listings now ship under team://team/apikeys (see "Team scope" above). Cross-tenant team listings remain deferred — they require a new ITeamService.GetAllTeamsAsync method.

Package Description
Tharga.Mcp MCP foundation (contracts, transport)
Tharga.Team.Service Team scope/audit primitives
Product Compatible and additional computed target framework versions.
.NET net10.0 is compatible.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
3.8.1 0 7/31/2026
3.8.0 24 7/31/2026
3.7.0 39 7/30/2026
3.6.1 46 7/27/2026
3.6.0 48 7/27/2026