API docs for .NET that AI agents can read
mdnet turns C# libraries and NuGet packages into signature-first Markdown, renders it as a static site, and syncs published docs for your dependencies, so your agent reads real APIs instead of guessing them.
dnx mdnet --yes -- generate MySolution.slnx -o docs
Generate, render, sync
One tool covers the whole loop: write docs for your own libraries, publish them anywhere, and pull docs for the packages you depend on.
Markdown from source or packages
Roslyn reads your solution, or the NuGet packages it references, and writes one page per type: C# signatures followed by their XML doc comments.
mdnet generate MySolution.slnx -o docs mdnet generate . --packages "Acme.*"
A static HTML site
Markdoc, React and Shiki turn the Markdown into a fast, searchable site. Each page keeps its .md source, and the site serves llms.txt.
mdnet render docs/md -o docs/html
Docs for your dependencies
Point mdnet.sources.json at HTTP, git or local folders. Every referenced package that matches gets its docs, checked against SHA-256 hashes.
mdnet sync MySolution.slnx --prune
Signatures up front, docs right below
Each member is shown the way it appears in C#, followed by its docs. Agents open index.md, then only the type pages they need.
index.md # start here Sample.Lib/ index.md # README, namespaces, types mdnet.json # id, version, hashes Core.Data/ DbContext.md Money.md Core.Data.Repositories/ IRepository-1.md EntityFrameworkRepository-1.md …
One folder per package, one per namespace, one file per type. Repository<T> becomes Repository-1.md.
{% member id="addasync" %} ```csharp public async Task<TEntity> AddAsync( TEntity entity, CancellationToken cancellationToken = default) ``` Asynchronously adds a new entity to the underlying database context. * **entity**: The entity instance to be inserted. * **cancellationToken**: A token to observe for cancellation requests. **Returns**: The inserted entity with any database-generated values applied. > **Remarks**: It does not automatically call > [`SaveChangesAsync`](../Core.Data/DbContext.md#savechangesasync). {% /member %}
Built for how .NET libraries are really written
Accurate C# signatures
Generics, constraints, records, attributes, default values and modifiers, straight from Roslyn. Choose public, protected or internal visibility.
Full XML doc support
summary, remarks, param, example, see and more, including inheritdoc with cref and automatic inheritance for overrides.
Source or NuGet packages
Document the projects in a solution, or any restored package reference, transitive ones included, using the shipped assemblies and XML files.
READMEs and metadata
Project and namespace READMEs are embedded, and package metadata such as version, description, license and target frameworks comes from MSBuild.
Verified downloads
Every published folder has an mdnet.json manifest. Downloads fetch only changed files and check each one against its hash.
Nothing extra to install
Run it with dnx on .NET 10. The HTML renderer ships inside the tool as one bundled file and runs on bun or node.
Install or just run it
mdnet is a regular .NET tool. With the .NET 10 SDK, dnx runs it without installing anything first.
Recommended for CI and AI agents. --yes skips the download prompt, and everything after -- goes to mdnet.
dnx mdnet --yes -- generate MySolution.slnx -o docs
Install once and use mdnet anywhere.
dotnet tool install -g mdnet mdnet generate MySolution.slnx -o docs
Pin the version in your repository. After a fresh clone, run dotnet tool restore.
dotnet new tool-manifest dotnet tool install mdnet dotnet mdnet generate MySolution.slnx -o docs
Commands
Every command accepts --verbose, --quiet and --help. See the full reference for all options.
| Command | What it does |
|---|---|
generate |
Markdown and HTML docs from a solution, project or directory. Add --packages to document referenced NuGet packages instead.
mdnet generate . -f md --visibility public |
render |
A static HTML site from any Markdown docs folder, generated or downloaded. mdnet render .mdnet/docs -o .mdnet/site |
download |
Published docs from an HTTP URL, a git repository or a local folder, once. mdnet download https://github.com/org/acme-docs --ref v1.2.0 |
sync |
Docs for every referenced package, as configured in mdnet.sources.json. Safe to run repeatedly.
mdnet sync MySolution.slnx --prune |
Give your agent the real API
Add a few lines to AGENTS.md, CLAUDE.md or copilot-instructions.md.
- Small entry point.
index.mdlists packages, namespaces and types, one line each. - Read only what's needed. Type pages are short and self-contained, so they cost few tokens.
- Stays current. Run
syncin CI or a setup script to match the versions you reference.
## API documentation - Our libraries: `docs/md/index.md` - Dependencies: `.mdnet/docs/index.md` (refresh with `dnx mdnet --yes -- sync`) Read `index.md` first, then open only the type pages you need. Each type page lists C# signatures with their docs.
Try it on your solution
No install needed. Markdown only takes seconds and doesn't need a JavaScript runtime.
dnx mdnet --yes -- generate . -f md -o docs