dotMCP.Trace 0.1.0

dotnet tool install --global dotMCP.Trace --version 0.1.0
                    
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 dotMCP.Trace --version 0.1.0
                    
This package contains a .NET tool you can call from the shell/command line.
#tool dotnet:?package=dotMCP.Trace&version=0.1.0
                    
nuke :add-package dotMCP.Trace --version 0.1.0
                    

sharpmcp-trace

A standalone CLI — no MCP client or agent needed — built on the same Roslyn engine as dotMCP. It answers "can method A reach method B, through what, and are there cycles along the way?", then can rewrite every method on that path to log its own entry, exit, and thrown exceptions (parameters, fields, locals, return value) so you can watch a real run trace through unfamiliar code.

Repository: https://github.com/QsROg8320/SharpMCP

Install

dotnet tool install --global dotMCP.Trace

or run without installing:

dnx dotMCP.Trace --yes -- <command> ...

Requires the .NET 10 SDK/runtime on the machine running the tool.

find — look up a method id

sharpmcp-trace find "OrderService.Place" --solution ./MyApp.sln

Prints id | signature | project for every fuzzy match, so you can copy the exact id into --point below instead of guessing it.

paths — reachability corridor + cycles (read-only)

sharpmcp-trace paths --solution ./MyApp.sln \
  --point "M:MyApp.Api.OrdersController.Post(MyApp.Order)" \
  --point "M:MyApp.OrderService.Place(MyApp.Order,System.Int32)"
  • --point is repeatable (give 2 or more): an exact M: id, a file.cs:line location, or a fuzzy name (ambiguous matches print candidates instead of guessing). An interface method as a point expands to all of its implementations in the solution.
  • No --point at all → defaults to --scope solution (or pass --scope <projectId> for one project): seeds from the project's conventional entry points (Main, tests, controller actions), falling back to every declared method with --seed all-methods if there are none (typical for a pure library).
  • Reports, per ordered pair of points, whether it's reachable and how large the corridor is; only one pair needs to be reachable. Also reports any cycle found inside the corridor — informational only, it never changes what gets instrumented.
  • Nothing is written to disk by this command.

log — insert entry/exit/throw logging

sharpmcp-trace log --solution ./MyApp.sln \
  --point "M:MyApp.Api.OrdersController.Post(MyApp.Order)" \
  --point "M:MyApp.OrderService.Place(MyApp.Order,System.Int32)" \
  --log-file ./trace.log

Runs the same corridor analysis as paths, then rewrites every method in it to log ENTRY (parameters + fields), EXIT (+ locals declared before that point + return value), and THROW (+ the exception) — both to the console and to --log-file. Idempotent: a method that's already instrumented is skipped and reported as already-instrumented, so re-running log after adding a new point is safe.

unlog — remove the logging

sharpmcp-trace unlog --solution ./MyApp.sln

Finds every file carrying the instrumentation marker and reverts it with git checkout -- (requires the instrumented files to still be tracked/committed in git — this is a revert, not a structural undo).

Options reference

Option Commands Meaning
--solution <PATH> all Path to a .sln/.slnx/.csproj, or a directory containing one
--point <SPEC> paths, log Repeatable point spec: M: id, file.cs:line, or fuzzy name
--scope <SCOPE> paths, log, unlog solution (default) or a project id, used when no --point is given
--seed <entry-points\|all-methods> paths, log Candidate set for scope mode (default entry-points)
--max-depth <N> paths, log BFS closure depth cap (default 64)
--log-file <PATH> log Where injected logging writes (default ./sharpmcp-trace.log)
--limit <N>, --kind <KIND> find Result cap and symbol-kind filter
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.1.0 40 7/16/2026