McpProbe.Cli 0.6.1-preview

This is a prerelease version of McpProbe.Cli.
dotnet tool install --global McpProbe.Cli --version 0.6.1-preview
                    
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 McpProbe.Cli --version 0.6.1-preview
                    
This package contains a .NET tool you can call from the shell/command line.
#tool dotnet:?package=McpProbe.Cli&version=0.6.1-preview&prerelease
                    
nuke :add-package McpProbe.Cli --version 0.6.1-preview
                    

McpProbe

CI NuGet License: MIT

A .NET test kit for C# MCP server testing, for servers built with the MCP C# SDK.

  • In-memory host. Start your server in the test process and get a connected McpClient. No ports, no child processes.
  • Assertions for tools, tool results (text, images, structured output, errors), prompts and resources.
  • Tool surface snapshots. Commit mcp-tools.json, and the test fails when a change would break existing clients.
  • Lint rules for tool names, descriptions and parameters.
  • mcpprobe CLI that runs the snapshot and lint checks against any MCP server over stdio or HTTP, for CI.
  • GitHub Action. The McpProbe tool surface check Action installs McpProbe.Cli and runs diff and lint in CI. See GitHub Actions.

Works with any test framework: failures are plain McpProbeAssertionExceptions. Targets .NET 8 and .NET 10, on ModelContextProtocol 2.4.0.

Status: 0.6.1-preview on NuGet. The API may change before 1.0.

mcpprobe CLI: snapshot a server, lint it, then catch a breaking tool-surface change

Quickstart

dotnet add package McpProbe --prerelease
using McpProbe;
using McpProbe.Assertions;
using Microsoft.Extensions.DependencyInjection; // WithTools<T>()
using ModelContextProtocol.Server;
using System.ComponentModel;

[McpServerToolType]
public sealed class WeatherTools
{
    [McpServerTool(Name = "get_forecast", UseStructuredContent = true)]
    [Description("Gets a daily weather forecast for a city.")]
    public static Forecast GetForecast(
        [Description("City name, for example 'Paris'.")] string city)
        => new Forecast(city, "Sunny");
}

public sealed record Forecast(string City, string Summary);

public class WeatherServerTests
{
    [Fact]
    public async Task Forecast_works()
    {
        await using var probe = await McpProbeHost.StartAsync(mcp => mcp.WithTools<WeatherTools>());

        var tools = await probe.Client.ListToolsAsync();
        McpAssert.That(tools).ContainsTool("get_forecast").HasParameter("city", type: "string", required: true);

        var result = await probe.Client.CallToolAsync("get_forecast", new Dictionary<string, object?> { ["city"] = "Paris" });
        McpAssert.That(result).Succeeded().HasStructuredValue("city", "Paris");
    }
}

StartAsync takes the same IMcpServerBuilder you configure in Program.cs, so put your WithTools/WithPrompts/WithResources calls in one extension method and share it (see samples/WeatherServer). Register your own services with McpProbeHostOptions.ConfigureServices.

Assertions

Every assertion returns the same object, so you can chain them. Failures throw McpProbeAssertionException with a message that says what was expected and what was there.

McpAssert.That(tools).ContainsTool("delete_file").HasDestructiveHint().DoesNotHaveParameter("force");
McpAssert.That(result).Failed("Unknown city");
McpAssert.That(result).HasTextContent("sunny", StringComparison.OrdinalIgnoreCase);
McpAssert.That(result).HasImageContent("image/png");
McpAssert.That(result).HasStructuredValue("days[0].high", 26);
McpAssert.That(prompts).ContainsPrompt("plan_trip").HasArgument("city", required: true);
McpAssert.That(resources).ContainsResource("weather://cities").HasMimeType("text/plain");

If a tool throws an exception that is not an McpException, the SDK hides it behind a generic message, An error occurred invoking 'tool'. In the in-memory host McpProbe shows the real exception instead, so a failing Succeeded() tells you what went wrong:

Expected the tool call to succeed, but it returned an error: "An error occurred invoking 'update_todo_item': FormatException: The input string 'abc' was not in a correct format.".

The same applies to prompts and resources, which throw on the client. Set McpProbeHostOptions.IncludeServerExceptions = false to get the generic text a remote client would see.

Snapshot workflow

using McpProbe.Snapshots;

[Fact]
public Task Tool_surface_matches_snapshot() =>
    probe.VerifyToolSnapshotAsync(new SnapshotOptions { Log = output.WriteLine });

output.WriteLine is xUnit's ITestOutputHelper. To use the default file name with no options, call VerifyToolSnapshotAsync().

  1. The first run writes mcp-tools.json next to the test file and fails, so you look at it. Commit it.
  2. Later runs compare the live tool surface with the file:
    • Breaking changes fail the test: removed tool, removed parameter, newly required parameter, narrowed type or enum, tighter input constraints (minimum, maxLength, minItems, multipleOf, a new or changed pattern or format, a new const, uniqueItems: true or additionalProperties: false, ...), and removed or narrowed output fields. A removed parameter that looks renamed gets a hint.
    • Non-breaking changes pass: added tools, optional parameters, descriptions, annotations, widened types, looser input constraints. They are in the returned ToolSurfaceDiff, and SnapshotOptions.Log gets a report (for example Log = output.WriteLine with xUnit's ITestOutputHelper).
    • Local $refs (#/$defs/..., #/definitions/..., and the #/properties/... refs the C# SDK emits for recursive types) are followed, so a change inside a referenced schema is classified like an inline one.
    • Schema-valued additionalProperties (and unevaluatedProperties, additionalItems, unevaluatedItems) are compared like nested schemas, at paths such as input.meta[additionalProperties].
    • Schema keywords McpProbe doesn't classify yet (such as allOf, anyOf or oneOf) are reported as non-breaking, marked "review by hand".
  3. On a failure, the current surface is written to mcp-tools.received.json. Add *.received.json to your .gitignore so those files aren't committed. To accept the change, run with MCPPROBE_UPDATE_SNAPSHOTS=1 (or set SnapshotOptions.Update), review the diff in git, and commit.

On CI (CI or TF_BUILD set), a missing snapshot is not created: the test fails. Set SnapshotOptions.FailOnNonBreakingChanges to fail on every change.

Example failure:

Tool surface changed: 1 breaking, 2 non-breaking.

Breaking:
  - get_forecast: Parameter 'days' type changed from string to integer. [input.days]

Non-breaking:
  ~ get_alerts: Tool was added.
  ~ get_forecast: Parameter 'days' became optional. [input.days]

Lint rules

using McpProbe.Linting;

var report = await probe.LintToolsAsync();
report.ThrowIfFailed(); // fails on warnings and errors by default

var strict = await probe.LintToolsAsync(new LintOptions { Strict = true });
strict.ThrowIfFailed();
Id Default Checks
MCPP001 error The tool has a description.
MCPP002 warning The description is at least MinToolDescriptionLength (20) characters, or at least MinToolDescriptionWords (4) words.
MCPP003 warning Every parameter has a description.
MCPP004 warning The tool name is 1-128 characters of A-Z a-z 0-9 _ - ..
MCPP005 warning All tool names use the same style (snake_case, camelCase, ...).
MCPP006 warning All parameter names use the same style.
MCPP007 info Parameter names aren't vague (data, value, input, ...). A top-level value or data is fine on a tool named create_*, set_*, publish_* and similar (PayloadContextTokens).
MCPP009 error No bare true/false where a schema object is expected (--strict).
MCPP010 warning type is not a union array (--strict). [T, "null"], the nullable spelling the C# and Go SDKs emit, is not reported.
MCPP011 warning Every schema has a constraining keyword (--strict).
MCPP012 warning $ref does not point outside the document (--strict).
MCPP013 warning Hints don't contradict: not read-only and destructive at once, and a delete_*-style name isn't marked destructiveHint: false or readOnlyHint: true.
MCPP014 warning A description that promises structured results ("returns JSON", "structured content", ...) comes with an outputSchema.
MCPP015 warning The description says more than the tool name or title.
MCPP016 warning No empty enum, and an enum declares its type.
MCPP017 warning The prompt has a description.
MCPP018 warning The prompt description is at least MinToolDescriptionLength (20) characters, or at least MinToolDescriptionWords (4) words.
MCPP019 warning Every prompt argument has a description.
MCPP020 warning The prompt name is 1-128 characters of A-Z a-z 0-9 _ - ..
MCPP021 warning All prompt names use the same style.
MCPP022 warning All prompt argument names use the same style.
MCPP023 info Prompt argument names aren't vague (data, value, input, ...).
MCPP024 warning The prompt description says more than the prompt name or title.
MCPP025 warning A resource template has a description. Listed resources are checked only with --resources.
MCPP026 error A resource uri is a non-empty absolute URI with a scheme, a resource template uriTemplate is non-empty and has a scheme before its first {, and prompt names, resource URIs and uriTemplates aren't listed twice.
MCPP027 warning A resource template has a name. Listed resources are checked only with --resources.
MCPP028 warning Icons use an http:, https: or data: src, mimeType looks like type/subtype, each size is WxH or any, and theme is light or dark. Checked on tools, prompts and resource templates from a live server. Nothing is fetched.

Change severities with LintOptions.Severities["MCPP007"] = LintSeverity.None, and the threshold with LintOptions.FailOn. By default MCPP003, MCPP006 and MCPP007 check top-level parameters. Set LintOptions.CheckNestedParameters = true (CLI: mcpprobe lint --nested) to also check nested object properties and array items (reported as home.zip or stops[].city), following local $refs; a schema used in several places is checked once.

Set LintOptions.Strict = true (CLI: mcpprobe lint --strict) to also run MCPP009-MCPP012, the schema-portability checks from MCP Inspector, on inputSchema and outputSchema. Those findings are reported with paths such as inputSchema.properties.city (the existing parameter rules still use city). MCPP010 does not report [T, "null"] (for example ["integer","null"]): the C# and Go SDKs write that for every nullable parameter and an author can't change it, so this differs from Inspector's type-union check; use Inspector if you need its exact report. Unions of two or more non-null types, and longer unions with null, are still reported. Portability findings fail the report only when their effective severity is error, so a type-union warning does not trip the default FailOn = Warning gate; use --rule MCPP010=error if you want that warning to fail. A single portability rule can be turned on without --strict by setting its severity, or turned off with --rule MCPP011=none. MCPP008 is reserved for a community issue and is not implemented here.

lint and LintToolsAsync also check prompts when the server declares the prompts capability. They skip prompts/list when it does not, so a tool-only server is unchanged. A snapshot passed with --from-file has tools only. Prompt findings are labeled prompt in the text and HTML reports. Ignore entries and lint baselines can set kind to prompt; if kind is omitted, the entry matches any kind. To get the previous tool-only lint result, turn the prompt rules off with --rule MCPP017=none through --rule MCPP024=none.

They also check resource templates (MCPP025-MCPP027) when the server declares the resources capability. Resources from resources/list are checked only with --resources (config lint.resources), because file-style servers can list hundreds of them. Note that the C# SDK lists a resource declared with a fixed URI (no {...}) in resources/list, not in resources/templates/list, so it is only linted with --resources. MCPP028 checks icons on tools, prompts and resource templates listed from a live server. --from-file does not check them, because that path lints the snapshot's tools only. Icons are never fetched.

MCPP013-MCPP016 run by default and use FailOn like MCPP001-MCPP007. They are kept narrow on purpose: MCPP013 only reads explicit hints (an unset destructiveHint is fine) and matches whole name segments from LintOptions.DestructiveNameTokens; MCPP014 only fires on the phrases in LintOptions.StructuredOutputCues; MCPP016 walks inputSchema and outputSchema with the same paths as the --strict rules, and does not ask for a type on mixed-type enums (including ones with null) or on anyOf/oneOf/allOf branches, which usually take their type from the parent.

Config file and ignore rules

A server with legacy debt can keep its lint settings, and the findings it has decided to accept, in a committed mcpprobe.json. mcpprobe lint reads the nearest one, starting in the current directory and going up to the repository root (the first folder with a .git). When it uses a file it prints Using config <path>. on stderr. Use --config <file> to pick a file (it must exist) or --no-config to skip the search.

{
  "$schema": "https://raw.githubusercontent.com/ShmueLior/mcpprobe/main/docs/mcpprobe.schema.json",
  "lint": {
    "failOn": "warning",
    "strict": false,
    "nested": false,
    "resources": false,
    "minDescriptionLength": 20,
    "minDescriptionWords": 4,
    "rules": { "MCPP007": "none", "MCPP003": "error" },
    "ignore": [
      { "rule": "MCPP005", "tool": "sql_*", "reason": "Server convention: namespace_resource_verb-noun" },
      { "rule": "MCPP003", "tool": "legacy_export", "parameter": "opts" },
      { "rule": "MCPP017", "kind": "prompt", "reason": "Prompt descriptions come from the template" }
    ],
    "baseline": "mcpprobe-lint-baseline.json"
  }
}
  • failOn, strict, nested, minDescriptionLength and rules are the same as --fail-on, --strict, --nested, --min-description-length and --rule. minDescriptionWords has no flag. Defaults come first, then the file, then the flags you type: --fail-on error beats failOn in the file, --nested false turns off "nested": true, and --rule MCPP007=info changes only MCPP007.
  • Each ignore entry hides the findings that match every field it sets: rule (an id), tool and parameter (patterns where * matches any run of characters and ? matches one; case-sensitive), plus a free-text reason. kind limits the entry to tool, prompt, resource or resourceTemplate; omitted, it matches any kind. Set at least a rule or a tool. parameter is the path the finding prints: city, address.zip, stops[].city, or inputSchema.properties.city for the --strict rules.
  • Hidden findings never fail the run. The report says how many were hidden (Hidden: 3 ignored.), and lists entries that matched nothing so you can delete them (this never fails the run either). An entry for a rule that did not run, such as MCPP010 without --strict, is not listed as unused.
  • The file is strict: JSON with comments and trailing commas, but an unknown key, a wrong type or an unknown rule id is an error (exit 2) rather than being ignored. A CLI older than the file may not know a newer key.
  • It holds lint settings only. It can't name a server to start or connect to, so a checked-out repository can't make mcpprobe run a command. snapshot and diff don't read it.

In code, the same thing is LintOptions.Suppressions.Add(new LintSuppression(RuleId: "MCPP005", ToolPattern: "sql_*")). The library does not read mcpprobe.json; hidden findings are in LintReport.SuppressedFindings and unused entries in LintReport.UnusedSuppressions.

Lint baseline

To adopt lint on a server that already has findings, accept the current ones and fail only on new ones. Write a baseline once, commit it, and check against it in CI:

mcpprobe lint --stdio "dotnet run --project src/MyServer" --write-baseline mcpprobe-lint-baseline.json
mcpprobe lint --stdio "dotnet run --project src/MyServer" --baseline mcpprobe-lint-baseline.json
  • --write-baseline <file> writes every finding of the run (after ignore) and exits 0. It is sorted and has no timestamps, so a refresh is an easy diff to review. Run it with the same flags and config as CI (--strict, --nested).
  • --baseline <file>, or "baseline" in mcpprobe.json (relative to that file; the flag wins), hides the findings it lists. The report says Hidden: 20 baselined., and new findings fail as usual. A missing or unreadable file is exit 2. Use either --baseline or --write-baseline, not both; --write-baseline ignores "baseline" from the config, so the first write works before the file exists.
  • An entry is a rule, a tool and an optional parameter. The message is not part of it, so a baseline survives wording changes in a new McpProbe, but a finding that changes meaning on the same tool and parameter stays hidden.
  • Entries that no longer match (the tool was fixed, renamed or removed) are listed under Baseline: N entries no longer match. They never fail the run; write the baseline again to drop them. Entries for a rule that did not run, such as MCPP010 without --strict, are not listed. A baseline written without --strict does not hide the --strict findings.

In code: new LintOptions { Baseline = LintBaseline.Load("mcpprobe-lint-baseline.json") }, and LintBaseline.FromReport(report).ToJson() to write one. Hidden findings are in LintReport.BaselinedFindings and entries that matched nothing in LintReport.StaleBaselineEntries.

CLI in CI

Write a snapshot once and commit it, then check it in CI:

dotnet tool install --global McpProbe.Cli --version 0.6.1-preview

mcpprobe snapshot --stdio "dotnet run --project src/MyServer" --out mcp-tools.json
mcpprobe diff     --stdio "dotnet run --project src/MyServer" --baseline mcp-tools.json
mcpprobe lint     --http https://localhost:5001/mcp --bearer-env MCP_TOKEN
mcpprobe lint     --http http://localhost:5000/sse --transport sse --bearer-env MCP_TOKEN

For authenticated HTTP servers, --bearer-env <VAR> sends Authorization: Bearer <value> with the value read from the environment variable VAR, and --header-env 'Name: VAR' does the same for any header. Unlike --header "Authorization: Bearer $TOKEN", the token is not on the command line, so it doesn't end up in shell history or in a log that prints the command. If the same header comes from more than one of these, the order is --header, then --header-env, then --bearer-env, and the last one wins. A missing or empty variable is a usage error (exit 2) that names the variable, never its value. The variable name is matched the way the operating system does (case-insensitive on Windows).

The mcpprobe tool is packed for net8.0 and net10.0 (RollForward=Major), so a .NET 8 or .NET 10 runtime must be installed. An SDK is also needed if the --stdio command is dotnet run. If the apphost errors with "You must install .NET to run this application" even though dotnet works, set DOTNET_ROOT to that install's root (the directory that contains dotnet and the shared folder).

--http already tries Streamable HTTP and falls back to legacy SSE. Use --transport streamable-http or --transport sse to pin a mode (auto is the default). Legacy SSE servers usually listen at /sse (and /message), not at the Streamable HTTP path. If the server maps MCP at a prefix such as /mcp and enables legacy SSE, the C# SDK places those endpoints under the prefix (/mcp/sse and /mcp/message). There is no WebSocket transport.

Exit codes: 0 passed, 1 check failed (breaking change or lint findings), 2 usage or connection error. The server's stderr is printed when it fails to start. diff and lint also take --from-file <snapshot> to check a file without starting a server. To compare two snapshots, use mcpprobe diff --baseline old.json --from-file new.json. Run mcpprobe <command> --help for every option.

JSON and SARIF output

lint and diff take --format text|json|sarif to choose what goes to stdout. The default is text, so nothing changes unless you pass the flag. --format json writes the McpProbe report format (format 1): a summary with counts, then the findings or changes. For title and description changes, a diff change also has before and after. --format sarif writes a SARIF 2.1.0 log.

--sarif <file> is the SARIF version of --report: it writes the SARIF file and leaves stdout and the exit code alone. You can combine it with --format and --report. Like --report, nothing is written on a usage or connection error (exit 2).

mcpprobe lint --stdio "dotnet run --project src/MyServer" --format json
mcpprobe diff --stdio "dotnet run --project src/MyServer" --baseline mcp-tools.json --sarif mcp-diff.sarif

With --format json or --format sarif, stdout holds exactly one document. The diff hint ("If the change is intended, ...") and the lint --write-baseline line ("Wrote N finding(s) to ...") go to stderr instead. Exit codes don't change. The JSON result is fail when the command exits 1 and pass when it exits 0, so --fail-on-non-breaking and --write-baseline are reflected there.

SARIF levels: lint errors are error, warnings are warning, info is note. Diff breaking changes are error, non-breaking changes are note. Lint rules keep their MCPP0xx ids; diff change kinds use kebab-case ids such as tool-removed or description-changed. Every result has a partialFingerprints.primaryLocationLineHash computed from the rule id, tool and path. Lint findings about a prompt, resource or resource template also include the finding kind (ruleId|kind|tool|path). Tool findings stay ruleId|tool|path, the same as format 1 on main, so existing code scanning alerts keep matching. When several results share the same identity (for example allowed values removed and added on one parameter), they get :1, :2 and so on in the order they appear, like GitHub's own fingerprints. JSON lint findings include an optional kind (prompt, resource or resourceTemplate); it is omitted for tools.

Each SARIF result points at a file in the repository, because GitHub doesn't display results without one. diff uses --baseline and lint uses --from-file, relative to the working directory with forward slashes. If that path is outside the working directory, only the file name is used. When lint reads a live server, the default is mcp-tools.json, so in CI run lint from the repo root or pass a real --from-file snapshot. Run diff from the repo root too, so the --baseline artifact path is relative to the repository root and GitHub can resolve it.

To send the file to GitHub code scanning, upload it in your own workflow (the McpProbe Action doesn't upload SARIF yet):

      - run: mcpprobe lint --stdio "dotnet run --project src/MyServer" --sarif mcp-lint.sarif
      - uses: github/codeql-action/upload-sarif@v3
        if: always()
        with:
          sarif_file: mcp-lint.sarif

One limitation: GitHub shows PR annotations only for alerts whose file lines changed in that PR. A finding on a live server, or a tool-surface change whose mcp-tools.json line didn't move, still shows up in the repository's code scanning alerts, but it may not annotate the PR diff. The text output in the job summary and the HTML report stay the best view of a PR.

In code, use LintReport.ToJson(), LintReport.ToSarif(artifactUri), ToolSurfaceDiff.ToJson(failOnNonBreakingChanges) and ToolSurfaceDiff.ToSarif(artifactUri).

HTML report

lint and diff take --report <file> to also write a self-contained HTML page (inline CSS, no scripts): a banner, a one-line summary and, when there are findings or changes, a table. The text report on stdout and the exit code do not change, the file is written whether the check passed or failed (exit 0 or 1), and nothing is written on a usage or connection error (exit 2). In code, use LintReport.ToHtml() and ToolSurfaceDiff.ToHtml().

mcpprobe lint --stdio "dotnet run --project src/MyServer" --report mcp-lint.html
mcpprobe diff --stdio "dotnet run --project src/MyServer" --baseline mcp-tools.json --report mcp-diff.html

To keep the files from a CI run, upload them as an artifact. if: always() keeps the upload when the check fails:

      - uses: actions/upload-artifact@v4
        if: always()
        with:
          name: mcpprobe-reports
          path: |
            mcp-lint.html
            mcp-diff.html

GitHub Actions

This is the .NET / NuGet McpProbe Action from ShmueLior/mcpprobe. It is not the similarly named MCP security or health-check Actions on the GitHub Marketplace.

The McpProbe tool surface check Action installs the same McpProbe.Cli version as the tag you pin, then runs diff and lint. It needs actions/checkout, actions/setup-dotnet (a .NET 8 or .NET 10 SDK), and your server already built. Reports go to the job summary.

Pin an exact release tag that includes the Action (0.3.0-preview or later), for example ShmueLior/mcpprobe@v0.6.1-preview. Do not pin @main. There is no supported floating @v0 or @v1 tag until 1.0.

name: CI

on:
  push:
    branches: [main]
  pull_request:

permissions:
  contents: read

jobs:
  mcp:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v5
      - uses: actions/setup-dotnet@v5
        with:
          dotnet-version: |
            8.0.x
            10.0.x
      - run: dotnet build -c Release
      - name: Check MCP tool surface
        uses: ShmueLior/mcpprobe@v0.6.1-preview
        with:
          stdio: dotnet run --no-build --project src/MyServer -c Release
          baseline: mcp-tools.json

Pass exactly one of stdio, http, or from-file. Both diff and lint are on by default. The Action fails the step on a breaking change or a lint finding at or above --fail-on (default warning, or failOn from mcpprobe.json when fail-on is empty).

header and env often carry tokens. Do not log these values. To authenticate an HTTP server, pass the name of an environment variable in bearer-env or header-env, and set that variable from a secret. The token never appears in the Action's inputs or in the mcpprobe command line:

      - name: Check MCP tool surface
        uses: ShmueLior/mcpprobe@v0.6.1-preview
        with:
          http: https://example.test/mcp
          bearer-env: MCP_TOKEN
        env:
          MCP_TOKEN: ${{ secrets.MCP_TOKEN }}
Inputs
Input Default Description
stdio empty Start the server with this command line and talk to it over stdio, for example "dotnet run --project src/MyServer -c Release". Pass exactly one of stdio, http, or from-file.
http empty Connect to a server over HTTP (Streamable HTTP, falling back to SSE), for example http://localhost:5000/mcp.
from-file empty Read the current tool surface from a snapshot file instead of a server.
baseline mcp-tools.json The committed snapshot to compare against (diff only).
header empty HTTP headers as 'Name: value', one per line. Only used with http. Do not log these values; they often carry tokens.
bearer-env empty Name of an environment variable that holds a bearer token for the http server. Sends 'Authorization: Bearer <value>'. The input is the variable name, not the token, so the token never appears in the command line. Requires a CLI that has --bearer-env.
header-env empty HTTP headers whose values are read from environment variables, as 'Name: VAR', one per line. Only used with http. Requires a CLI that has --header-env.
env empty Environment variables for the stdio server as NAME=value, one per line.
cwd empty Working directory for the stdio server.
timeout 60 Seconds to wait for the server to start and list its tools.
diff true Run mcpprobe diff against the baseline.
lint true Run mcpprobe lint.
fail-on-non-breaking false Also fail (exit 1) on non-breaking changes, so the snapshot stays up to date.
fail-on empty Lowest lint severity that fails the job: error, warning, info, or none. Leave empty to use failOn from mcpprobe.json, or warning if the file does not set it.
nested false Also lint nested object properties and array items, not just top-level parameters.
rule empty Lint rule severity overrides, one RULE=severity per line, for example MCPP007=none.
min-description-length empty Minimum tool description length for MCPP002. Leave empty to use the CLI default (20).
strict false Also run schema-portability lint rules MCPP009-MCPP012 (lint only). Off by default.
config empty Path to a mcpprobe.json for lint. Leave empty to let lint find one, starting in the working directory and going up to the repository root. Requires a CLI that has --config.
lint-baseline empty Path to a lint baseline written by 'mcpprobe lint --write-baseline'. Findings in it don't fail lint. Not the snapshot (that is baseline). Overrides baseline in mcpprobe.json. Requires a CLI that has lint --baseline.
transport empty Pin the HTTP transport: auto, streamable-http, or sse. Only used with http. Leave empty to use the CLI default (auto).
report empty Directory where HTML reports are written (lint.html and/or diff.html). This input is a directory, not a file; the CLI --report flag takes a file. Leave empty to skip writing HTML files. Requires a CLI that has --report.
version 0.6.1-preview Exact McpProbe.Cli version to install. Defaults to the same version as this repository's package. Do not set this to latest.
source empty If set, the only NuGet source used to install McpProbe.Cli (a folder of nupkgs, or a feed URL). Use this to install a just-packed build in CI.

None of the inputs is marked required in action.yml. The wrapper still needs exactly one of stdio, http, or from-file.

Outputs
Output Description
conclusion Outcome of the checks: passed, failed, or error.
diff-exit Exit code of mcpprobe diff. Empty if diff was skipped.
lint-exit Exit code of mcpprobe lint. Empty if lint was skipped.
lint-report Path to lint.html if that file was written. Empty otherwise.
diff-report Path to diff.html if that file was written. Empty otherwise.

bearer-env and header-env need a CLI that has --bearer-env / --header-env, which is 0.6.0-preview or later. If you set them and the installed tool lacks the flags, the Action fails fast with a message instead of a generic "unrecognized option".

strict, transport, and report are off by default, so an unchanged workflow runs the same commands as before. strict is lint-only. transport is only used with http. report is a directory, not a file: the Action writes lint.html and/or diff.html there (both checks run by default, so a single file path would overwrite one report with the other). The job summary stays the plain-text report. Upload is left to your workflow.

config is the path of a mcpprobe.json for lint. Leave it empty and lint finds one on its own, starting in the step's working directory (the repository root after actions/checkout), so a committed mcpprobe.json is used without any input. config needs a CLI that has --config, which is 0.5.0-preview or later; the Action fails fast with a message if the installed tool lacks it.

lint-baseline is passed to lint as --baseline (the baseline input is the snapshot for diff). It overrides "baseline" in mcpprobe.json and has the same CLI requirement as config. There is no input to write a baseline; do that locally and commit the file. config and lint-baseline need ShmueLior/mcpprobe@v0.5.0-preview or later; the v0.4.0-preview wrapper does not have them.

strict and transport also work against the 0.3.0-preview CLI. report needs a CLI that has --report, which is 0.4.0-preview or later. If you set report and the installed tool lacks the flag, the Action fails fast with a message instead of a generic "unrecognized option". Do not add these inputs to a workflow that pins ShmueLior/mcpprobe@v0.3.0-preview; that tag's wrapper does not have them.

      - name: Check MCP tool surface
        id: mcpprobe
        uses: ShmueLior/mcpprobe@v0.6.1-preview
        with:
          stdio: dotnet run --no-build --project src/MyServer -c Release
          baseline: mcp-tools.json
          strict: true
          report: mcpprobe-reports
      - uses: actions/upload-artifact@v7
        if: always()
        with:
          name: mcpprobe-reports
          path: mcpprobe-reports/

Azure Pipelines

If your organization can add a GitHub service connection, use the step template in this repository (check out your own repo first; the template checks out McpProbe to run the same script as the Action):

resources:
  repositories:
    - repository: mcpprobe
      type: github
      name: ShmueLior/mcpprobe
      endpoint: GitHub
      ref: refs/tags/v0.6.1-preview

steps:
  - checkout: self
  - task: UseDotNet@2
    inputs:
      version: '10.x'
  - script: dotnet build -c Release
  - template: templates/azure-pipelines/mcpprobe.yml@mcpprobe
    parameters:
      stdio: 'dotnet run --no-build --project src/MyServer -c Release'
      baseline: mcp-tools.json

The template needs bash (Git Bash on Windows). It also accepts strict, transport, report (a directory, as in the Action), config, lintBaseline, bearerEnv and headerEnv. Do not add those parameters to a pipeline that pins refs/tags/v0.3.0-preview; that tag's template does not have them. config and lintBaseline need refs/tags/v0.5.0-preview or later. bearerEnv and headerEnv need refs/tags/v0.6.0-preview or later. Upload is a separate step; the template does not publish an artifact:

  - task: PublishPipelineArtifact@1
    condition: always()
    inputs:
      targetPath: mcpprobe-reports
      artifact: mcpprobe-reports

If you cannot reference the GitHub repo, install the tool and run the same commands yourself:

- task: UseDotNet@2
  inputs:
    version: '10.x'
- script: |
    set -euo pipefail
    tool_path="$(Agent.TempDirectory)/mcpprobe-cli"
    dotnet tool install McpProbe.Cli --tool-path "$tool_path" --version 0.6.1-preview
    export PATH="$tool_path:$PATH"
    mcpprobe diff --stdio "dotnet run --no-build --project src/MyServer -c Release" --baseline mcp-tools.json
    mcpprobe lint --stdio "dotnet run --no-build --project src/MyServer -c Release"
  displayName: Check MCP tool surface

Snapshot file format

{
  "formatVersion": 1,
  "tools": [
    { "name": "get_forecast", "description": "...", "inputSchema": { }, "outputSchema": { }, "annotations": { } }
  ]
}

Tools are sorted by name and JSON keys are sorted, so diffs stay small. Comparison is semantic: formatting and line endings don't matter.

A tool's icons are stored when the server declares them, and omitted when there are none, so an existing snapshot without icons stays the same. Icon changes are non-breaking. A data: icon is stored as declared, so a large embedded icon makes the snapshot large.

Limitations

  • Only local $refs are followed. Remote refs, $anchor/$id refs and $dynamicRef are compared as plain keywords, and so is $defs when such a ref is present.
  • allOf, anyOf and oneOf aren't walked; changes inside them are reported as unclassified keyword changes.
  • Two different patterns or formats can't be compared, so any change to one counts as breaking.
  • Snapshots cover the tool surface, including icons. They do not include prompts, resources, resource templates, _meta, or the Tasks execution field, so a change there is not reported by diff.
  • The test suite in this repo uses xUnit v3. The quickstart was also run once by hand with NUnit 4, MSTest 4 and TUnit 1.87 against the packed library; those checks aren't part of CI yet.

Contributing

See CONTRIBUTING.md. License: MIT.

Product Compatible and additional computed target framework versions.
.NET net8.0 is compatible.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed.  net9.0 was computed.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed.  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.6.1-preview 10 12/4/2026
0.6.0-preview 11 12/4/2026
0.5.0-preview 66 11/29/2026
0.4.0-preview 68 11/28/2026
0.3.0-preview 77 11/28/2026
0.2.0-preview 66 11/27/2026
0.1.0-preview 64 11/27/2026