Slnmap
A semantic map of your .NET solution for AI coding agents. Analyzes a solution with Roslyn into a queryable code graph exposing 11 read-only tools (find_symbol, impact_analysis, find_implementations, etc.) over MCP. 100% local, no telemetry, MIT licensed.
README
Slnmap
Slnmap (sln-map) — a semantic map of your .sln for AI coding agents.
Open source under the MIT license.
Your AI agent can't refactor .NET code it can't see. Ask an agent "what breaks if I change this interface?" and it guesses from the files in its context — missing callers in other projects and files it never opened. Slnmap gives the agent a precise, compiler-accurate map of your whole solution, so it answers correctly: every caller, every implementation, across every project. Fewer broken changes, no hallucinated dependencies. It runs locally and serves the map to your agent or editor over MCP.
Quickstart (3 steps)
1. Install the global tool (requires the .NET SDK 9.0+):
dotnet tool install --global Slnmap
2. Analyze your solution (or a single .csproj) — this builds slnmap.db in the current folder:
slnmap analyze path/to/YourSolution.sln
3. Connect your MCP client. For Claude Code, add this to .mcp.json in your project. Use an
absolute path to the slnmap.db you just built — an MCP client's working directory is usually not
your project folder, so a relative path can silently resolve to the wrong (or a missing) file:
{
"mcpServers": {
"slnmap": {
"command": "slnmap",
"args": ["serve", "--db", "C:/path/to/your/project/slnmap.db"]
}
}
}
On macOS/Linux, use a POSIX absolute path instead, e.g. /home/you/project/slnmap.db.
That's it. Ask your agent an architecture question and it will call Slnmap.
(Run slnmap doctor first if anything looks off — see Troubleshooting.)
What you can ask
The server exposes eleven read-only tools. Give them fully qualified names; results are capped and counts-first. (A note the tools also carry: an FQN does not reveal whether a member is an explicit interface implementation.)
| Tool | Example question |
|---|---|
find_symbol |
"Find the IBasketService interface." |
get_dependencies |
"What does CartController.Index depend on?" |
impact_analysis |
"What breaks if I change IBasketService?" |
get_architecture_overview |
"Show me the projects and how they depend on each other." |
find_usages |
"Where is BasketService.GetBasket used?" |
find_implementations |
"Who implements IBasketService / overrides this virtual member?" |
get_type_hierarchy |
"Show the base and derived type tree for BaseEntity." |
find_tests_for_symbol |
"Which tests exercise BasketService.AddItemToBasket?" |
get_project_dependencies |
"How do the projects reference each other, and where is the coupling worst?" |
find_circular_dependencies |
"Are there dependency cycles between projects or namespaces?" |
get_symbol_source |
"Show me the actual source of IBasketService." |
For an interface (or interface member), impact_analysis follows both the interface's callers and
its concrete implementations/overrides — so the answer includes code that only touches the interface,
across projects, in files nobody has open.
CLI
slnmap analyze <solution> # build or update the code graph (incremental on re-run)
slnmap serve # serve the graph to MCP clients over stdio
slnmap status # show node/edge counts and when it was last analyzed
slnmap viz # export the graph as a self-contained interactive HTML file
slnmap doctor # check the environment can run Slnmap
--db <path> selects the database file (default slnmap.db).
Visualizing the graph
slnmap viz --output graph.html # export the whole graph
slnmap viz --project YourProject # export one project's subtree; others render as collapsed stubs
Opens as a single HTML file — double-click it, no server or internet connection required. It starts collapsed to one node per project; click a project, namespace, or class to drill into it. Like the rest of Slnmap, the export is self-contained: the graph library is embedded in the file, so nothing is fetched from a CDN and it works fully offline.
Updating
.NET tools do not update themselves, and Slnmap makes no network calls — so it will never nag you about (or check for) new versions. To update:
dotnet tool update -g Slnmap
To hear about releases, watch the GitHub repo (Watch → Custom → Releases); each release ships
with notes in the changelog. After a major-version update, re-run
slnmap analyze if the tool asks for it — release notes call out when a graph rebuild is needed.
Build from source
Slnmap is a standard .NET solution — clone, build, and test it with the SDK:
git clone https://github.com/EMahmoudNabil/slnmap.git
cd slnmap
dotnet build -c Release
dotnet test -c Release
To run the CLI without installing the global tool:
dotnet run --project src/Slnmap.Cli -- analyze path/to/YourSolution.sln
Compatibility
Analyzes C# solutions targeting .NET 8 and .NET 9 (earlier targets are untested — feedback welcome); runs on Windows, macOS, and Linux; works with any MCP client (tested with Claude Code).
Privacy
100% local — and now you can verify it. Slnmap runs on your machine, reads your source with Roslyn, and writes a single local SQLite file. The MCP server reads only that local file. There is no telemetry, no network calls, and no cloud service — analysis works fully offline. Now that the CLI and MCP server are open source, that claim is auditable: read the code, or watch the process — nothing leaves your machine.
Performance
Measured on eShopOnWeb (10 projects, net8.0),
.NET 9 SDK, on a 2-core laptop. Each timing is the median of 3 runs; full methodology, machine spec,
and pinned commit are in BENCHMARKS.md.
| Metric | Result |
|---|---|
| Graph size | 1,111 nodes / 2,175 edges |
| Cold analyze (10 projects) | ~25.6 s (median of 3) |
| Re-analyze after a one-file change | ~27.1 s (median of 3 — see note) |
impact_analysis on IBasketService (18 dependents) |
~270 ms (end-to-end MCP round-trip) |
Graph counts are for v0.3.0: the entry-point fix (see the changelog) makes each
project's top-level Program distinct, so counts grew slightly versus v0.2.x (1,107 / 2,168).
Timings were measured on v0.2.1; the analyzer work per document is unchanged in v0.3.0.
Incremental re-analysis. Re-analysis re-walks only the changed file and its dependents, but each
run still pays a full workspace load of the solution — because the CLI is run-and-exit and does not
keep a warm workspace. In practice that means re-analysis is currently about as fast as a cold run,
not faster. A resident watch mode that keeps the workspace warm (targeting sub-second
re-analysis) is the top item on the roadmap.
Troubleshooting
Run slnmap doctor first — it checks the three things that actually block analysis and prints a
fix for each:
$ slnmap doctor
[ok] .NET SDK: 1 SDK(s) installed; newest: 9.0.314 …
[ok] MSBuild workspace: Roslyn MSBuild workspace initialized …
[ok] Graph directory: Writable: /path/to/cwd
- "No .NET SDKs are installed" / MSBuild fails to load projects. Slnmap analyzes via
MSBuildWorkspace, which runs design-time builds using your installed .NET SDK. Install the SDK (not just the runtime) from https://dotnet.microsoft.com/download. On Windows, if projects still fail to load, install the Visual Studio Build Tools (or Visual Studio) so MSBuild and the targeting packs resolve. - Analysis reports warnings but finishes. That is expected and safe: a project that can't be loaded
(e.g. a missing SDK or targeting pack) is reported as a warning and skipped — Slnmap indexes everything
that did load rather than failing the whole run (a partial load). By default these are condensed
into a single
Warnings: N (M unique)summary line; runslnmap analyze --verbosefor the full, grouped detail. - The first analysis of a large solution takes a while. Cold analysis compiles every project once.
Re-runs are faster on graph work but still reload the workspace — see the performance note above.
This is normal; the graph is cached in
slnmap.dbbetween runs. slnmap: command not foundafter install. Ensure the .NET global tools directory (~/.dotnet/tools) is on yourPATH, then open a new shell.
How it works
Slnmap uses the Roslyn compiler platform to build a precise semantic graph of your solution — every type and member, and the relationships between them (calls, implementations, inheritance, references). The graph is stored locally and served to your AI agent or editor over MCP. Updates are incremental and crash-safe: an interrupted run never corrupts your existing graph.
License & support
Slnmap is open source under the MIT license.
The CLI and MCP server are MIT-licensed and will stay that way. Future hosted or team-oriented features may be commercial.
For questions or to report an issue, open a GitHub issue or contact hello@slnmap.dev. Contributions are welcome — see CONTRIBUTING.md.
推荐服务器
Baidu Map
百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。
Playwright MCP Server
一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。
Magic Component Platform (MCP)
一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。
Audiense Insights MCP Server
通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。
VeyraX
一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。
graphlit-mcp-server
模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。
Kagi MCP Server
一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。
e2b-mcp-server
使用 MCP 通过 e2b 运行代码。
Neon MCP Server
用于与 Neon 管理 API 和数据库交互的 MCP 服务器
Exa MCP Server
模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。