Documentation
DotNetCodeReviewer performs deep static code review of C#/.NET source using the Roslyn compiler platform. Use it two ways: a hosted REST API, or a local MCP server that plugs into your AI coding tools.
The analysis is identical across both: it checks for security issues, performance problems, async-correctness mistakes, maintainability smells, and architectural violations. All results are advisory you stay in control of your code.
Quickstart
Send a C# source payload to the review endpoint with your API key in the X-Api-Key header. A key is required for every request, including on the Free plan see Authentication for how to get one.
curl -X POST https://dotnetcodereviewer-api.azurewebsites.net/api/v1/review/file \
-H "X-Api-Key: your-api-key" \
-H "Content-Type: application/json" \
-d '{
"content": "public class C { public void M() { try { Work(); } catch (Exception ex) { } } }",
"fileName": "C.cs"
}'
You get back a structured list of issues with a rule id, severity, location, and a suggested fix. See Response format.
Authentication
Every request to /api/v1/* requires an API key including requests on the Free plan. "Free" refers to the price of the plan, not to skipping authentication: a Free key is still required, you just don't pay for it. Your key is tied to your plan (Free, Pro, or Team), which determines the available capabilities and your daily quota.
Send your key in the X-Api-Key request header:
X-Api-Key: your-api-key
A missing or invalid key returns 401 Unauthorized. A key whose plan does not include the requested capability returns 403 Forbidden. See Errors.
Review a file Free plan
Reviews a single C# source payload and returns all findings. Available on every plan, including Free. (An API key is still required see Authentication.)
Request body
| Field | Type | Required | Notes |
|---|---|---|---|
content | string | Yes | The C# source to review. 1–500,000 characters. |
fileName | string | No | A label for the file (e.g. Calculator.cs). Used in the response only; never read from disk. Defaults to input.cs. |
{
"content": "public class C { /* your C# source */ }",
"fileName": "C.cs"
}
Suggest tests Pro / Team
Suggests concrete unit-test scenarios for the public methods in a source payload (happy path, null/empty arguments, boundaries, exception paths, branch coverage). Requires a Pro or Team plan.
Request body
Same shape as Review a file: content (required) and fileName (optional).
Response format
A successful review returns 200 OK with a summary and an issues array. Each issue identifies the rule, severity, category, location, and a suggested fix.
{
"filePath": "C.cs",
"totalIssues": 1,
"criticalCount": 0,
"warningCount": 1,
"suggestionCount": 0,
"infoCount": 0,
"issues": [
{
"ruleId": "DNCR0001",
"severity": "Warning",
"category": "ErrorHandling",
"line": 1,
"column": 52,
"title": "Empty catch block swallows exceptions",
"description": "An exception is caught but neither handled, logged, nor rethrown.",
"suggestion": "Log the exception, handle it meaningfully, or rethrow with `throw;`."
}
]
}
200 with an empty issues array means the analysis ran and found nothing matching its rules. It does not assert that the code compiles the reviewer analyzes code, it is not a compiler.Severities
| Severity | Meaning |
|---|---|
| Critical | Fix immediately likely a real bug or security hole. |
| Warning | Should be fixed a meaningful problem. |
| Suggestion | An improvement worth considering. |
| Info | A minor note. |
Findings are grouped into categories: Security, Performance, AsyncAwait, ErrorHandling, Reliability, Maintainability, Architecture, Naming, Style, and Testing.
Errors
Errors are returned with a standard HTTP status code and a JSON body of the form { "error": "..." }.
| Status | Meaning | What to do |
|---|---|---|
400 | Bad request malformed JSON or content outside the 1–500,000 character range. | Check the request body. |
401 | Missing or invalid API key. | Send a valid key in X-Api-Key. |
403 | Your plan does not include this capability. | Upgrade to Pro or Team. |
429 | Daily quota or burst rate limit exceeded. | Wait for the reset, or upgrade. See below. |
Rate limits & quotas
Two limits apply. A per-minute burst limit protects the service from spikes, and a daily quota reflects your plan. Every response carries rate-limit headers:
| Header | Meaning |
|---|---|
X-RateLimit-Limit | Your daily request allowance. |
X-RateLimit-Remaining | Requests remaining today. |
X-RateLimit-Reset | When the daily count resets (Unix time, next UTC midnight). |
When the daily quota is exhausted, requests return 429 Too Many Requests with a Retry-After header until the reset.
| Plan | Daily quota |
|---|---|
| Free | 100 reviews / day |
| Pro | 5,000 reviews / day |
| Team | 50,000 reviews / day |
MCP server: install the tool
The MCP server runs locally on your machine and exposes the full analysis (including whole-directory tools) to AI coding assistants. It installs as a .NET global tool and requires the .NET 10 SDK or runtime.
dotnet tool install -g DotNetCodeReviewer.McpServer
This installs a command named dncr-mcp. Update later with:
dotnet tool update -g DotNetCodeReviewer.McpServer
dncr-mcp directly in a terminal will appear to "hang" that is correct. It is a stdio (JSON-RPC) server waiting for a client to connect. Press Ctrl+C to stop. All analysis runs locally; your source is not sent anywhere.MCP server: configure your client
Point your MCP client at the dncr-mcp command over stdio.
Claude Desktop
Add to claude_desktop_config.json:
{
"mcpServers": {
"dotnet-code-reviewer": { "command": "dncr-mcp" }
}
}
Cursor
Add to .cursor/mcp.json:
{
"mcpServers": {
"dotnet-code-reviewer": { "command": "dncr-mcp" }
}
}
Restart your client. The assistant can now call the review tools.
MCP server: available tools
| Tool | What it does |
|---|---|
review_file | Review a single C# file. |
review_project | Review every C# file under a directory. |
check_clean_architecture | Validate Clean Architecture layer boundaries. |
audit_nuget | Check NuGet package-reference hygiene. |
scan_security | Security-focused scan (SQL injection, secrets, weak crypto). |
audit_ef_core | Entity Framework / data-access scan. |
check_async_patterns | Async-correctness scan. |
suggest_tests | Suggest unit-test scenarios for a file. |
review_project, check_clean_architecture, audit_nuget, and the focused scans) are available through the local MCP server, where the directory is your own machine. The hosted REST API is content-only for security.Plans
| Plan | Price | Includes |
|---|---|---|
| Free | $0 | Single-file review, NuGet audit, 100 reviews/day. |
| Pro | $12/mo | All tools, unlimited files, 5,000 reviews/day, priority support. |
| Team | $39/mo | Everything in Pro, 5 seats, team analytics, 50,000 reviews/day. |
Support
Questions, bug reports, or billing help: email dotnetcodereviewer.support@gmail.com. We aim to respond within two business days.