McpLense.Cli 0.21.1

dotnet tool install --global McpLense.Cli --version 0.21.1
                    
This package contains a .NET tool you can call from the shell/command line.
dotnet new tool-manifest
                    
if you are setting up this repo
dotnet tool install --local McpLense.Cli --version 0.21.1
                    
This package contains a .NET tool you can call from the shell/command line.
#tool dotnet:?package=McpLense.Cli&version=0.21.1
                    
nuke :add-package McpLense.Cli --version 0.21.1
                    

McpLense

A .NET CLI and library for exploring, debugging, and security-scanning Model Context Protocol (MCP) servers. Inspect what a server exposes, classify its auth, audit its TLS/OAuth posture, turn the facts into severity-rated security findings (with a CI gate and SARIF output), generate example calls, triage "why won't it connect?", trace the JSON-RPC wire, and even run McpLense itself as an MCP server so an agent can audit other MCPs.

The scan pipeline is deliberately fact-only (it extracts data, never labels it); the opt-in analyze layer is a separate consumer that classifies those facts into findings.

Quick start

McpLense ships as the McpLense.Cli .NET tool (command: mcplense). On .NET 10 you can run it without installing anything using dnx:

dnx McpLense.Cli inspect https://mcp.context7.com/mcp          # list tools / resources / prompts
dnx McpLense.Cli analyze https://your-server/mcp --fail-on high # security findings (CI gate)
dnx McpLense.Cli explain https://your-server/mcp               # plain-language "what is this MCP"
dnx McpLense.Cli doctor  https://your-server/mcp               # "why won't it connect?" triage

Prefer a persistent install? Install once and use the mcplense command:

dotnet tool install -g McpLense.Cli
mcplense inspect https://mcp.context7.com/mcp

For a stdio MCP server, pass the command after --:

dnx McpLense.Cli inspect -- npx -y @modelcontextprotocol/server-everything

What it does

  • Exploreinspect / tools / resources / prompts; call / read / prompt to invoke; call <tool> --example generates a ready-to-edit --args template; explain narrates a server in plain language; mcplense tui is an interactive explorer.
  • Securescan runs the fact-only check pipeline; analyze turns it into severity-rated findings (prompt-injection signals, anonymous destructive tools, weak CORS, TLS posture, rug-pull detection, …). --fail-on <severity> is a CI gate; --format sarif uploads to GitHub code scanning; --approve/--since snapshot and detect tool changes.
  • Debugdoctor walks DNS → TCP → TLS → MCP initialize → auth with fix-it hints; --trace logs the JSON-RPC wire traffic; --watch <seconds> re-runs on an interval and flags changes.
  • Embed — reference the McpLense library to run scans in your own tooling or add custom IScanCheck / finding rules.
  • Servemcplense serve runs McpLense as a stdio MCP server, exposing mcplense_inspect / mcplense_scan / mcplense_analyze / mcplense_explain as tools.
// Library: run the scan pipeline in-process
using McpLense.Scanning;
using McpLense.Analysis;

var report   = await ScanCommandDispatcher.RunAsync(target, timeout, null, null, ct);
var findings = new FindingsAnalyzer().Analyze(report);

Documentation

  • Agent Skillskills/mcplense/ is a portable Agent Skill; its references/ cover every command, auth, config, checks, and classification recipes.
  • Findings & CIdocs/analysis-rules.md (built-in rules, analysis config block, SARIF, rug-pull).
  • Scan checksdocs/scan-checks.md (every IScanCheck and its output).
  • Roadmapnext.md.

License

Unlicense — public domain.

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.

This package has no dependencies.

Version Downloads Last Updated
0.21.1 115 7/2/2026
0.21.0 112 7/1/2026
0.20.0 102 7/1/2026
0.19.0 112 7/1/2026
0.18.0 119 7/1/2026
0.17.2 116 6/30/2026
0.17.1 112 6/18/2026
0.17.0 106 6/18/2026
0.16.0 112 6/18/2026
0.15.0 120 6/18/2026
0.14.0 114 6/17/2026
0.13.0 114 6/17/2026
0.12.0 130 6/17/2026
0.11.0 188 6/17/2026
0.10.0 121 6/17/2026
0.9.0 118 6/14/2026
0.8.0 116 6/14/2026
0.7.0 119 6/13/2026
0.6.0 118 5/20/2026
0.5.0 110 5/20/2026
Loading failed