Skip to main content
Mcp.InjectionGuard package icon

Mcp.InjectionGuard

Roslyn-based prompt-injection defence gate for the MCP fleet: statically scans every [McpServerTool] method in the consumer repo and asserts that user-generated content (HTTP bodies, JSON from external APIs, tool output) is wrapped through UntrustedContent.Wrap / UntrustedContent.WrapJson before being returned. Methods can opt in via [ExternalContent] or out via [NotExternalContent]; in their absence a conservative name + return-type + invocation heuristic classifies tools. Per-method exemptions and heuristic overrides via injectionguard.json. Companion to the parallel Mcp.Auth.ResourceServer UntrustedContent helper.

Total Downloads
1.1K
1,128
Published
May 30, 2026
Latest stable version

Install

.NET CLI
dotnet add package Mcp.InjectionGuard --version 0.1.0
Package Manager Console
Install-Package Mcp.InjectionGuard -Version 0.1.0
PackageReference
<PackageReference Include="Mcp.InjectionGuard" Version="0.1.0" />

Frameworks

No framework metadata available.

Dependencies

No declared dependencies.

Adoption guide

Assess this package against its supported frameworks, license, maintenance signals and dependency graph before making it a project standard.

No target framework metadata is available. Confirm compatibility in a representative project before standardising on this package.

How to read this guidance

Sources: published NuGet v3 registry metadata and explicit NuBrowse editorial guides. Refresh: package metadata is refreshed from NuGet when the page loads. Limit: this is not a security, legal or compatibility guarantee; validate the selected version in your project.

Useful next steps

Move from package metadata to a concrete selection or review workflow.