ContextManager
概览
作者提供的说明(英文原文)
Roslyn-powered structural context and a dependency graph of C# solutions for AI coding agents.
PopNx MCP 的三大支柱
这三项永远不会合并成一个分数:意见、测量和人气是不同的东西。
- 用户评价i暂无评价评价功能将在后续阶段与账户功能一起开放
- 我们的基础检查i2 项中通过 2 项依据公开信息检查;尚未扫描代码
- 使用情况i非常新★ 1
它能帮你做什么
我们还没有为它写通俗的介绍。下面是我们从注册中心读取到的事实。
- 连接方式: 在你的电脑上运行
- 传输方式: stdio
- 分类: 开发者工具
安装
选择你使用的 AI 应用,然后复制设置。
安装之前
- 基础检查:2 项中通过 2 项
- 在你的电脑上运行,拥有你的用户账户的权限(文件、网络、应用)。
- 注册中心没有列出需要填写的密钥。
你用的是哪个应用?
在上方选择你的应用。我们会记住它,下次按钮会显示“安装到 …”。
打开 Claude Desktop → Settings → Developer → Edit Config,把下面的内容粘贴到 claude_desktop_config.json
{
"mcpServers": {
"context-manager": {
"command": "dnx",
"args": [
"ContextManager",
"--yes"
]
}
}
}在终端中运行这条命令
claude mcp add context-manager -- dnx ContextManager --yes或者自己复制设置
粘贴到项目中的 .cursor/mcp.json,或 ~/.cursor/mcp.json
{
"mcpServers": {
"context-manager": {
"command": "dnx",
"args": [
"ContextManager",
"--yes"
]
}
}
}浏览器会先询问是否打开应用,然后应用会显示设置并请你确认。密钥的值会留空,由你自己填写。
或者自己复制设置
粘贴到项目中的 .vscode/mcp.json
{
"servers": {
"context-manager": {
"type": "stdio",
"command": "dnx",
"args": [
"ContextManager",
"--yes"
]
}
}
}浏览器会先询问是否打开应用,然后应用会显示设置并请你确认。密钥的值会留空,由你自己填写。
这个服务器在你的电脑上运行,而 ChatGPT 只能连接互联网上的服务器。请选择其他应用。
你的选择通过 Cookie 保存在这台设备上,无需账户。
这些设置是根据作者在注册中心的条目生成的。如果 README 的写法不同,请以 README 为准。
哪些应用可以使用它
依据这个服务器的连接方式和各应用自己的文档,检查于 2026年11月10日。
在你的电脑上运行,适用于
ClaudeGooseLM StudioMsty StudioCherry StudioCursorVS Code + GitHub CopilotVisual StudioWindsurf (Devin Desktop)ZedKiroClineContinueJetBrains AI AssistantClaude CodeCodex CLIGemini CLIOpenCodenodecodeWarpLibreChatRaycast
它能做什么
它在你的电脑上运行;安装后,工具列表会显示在你的 AI 应用中。
基础检查i
我们检查的是任何人都能看到的信息;我们没有阅读代码。不适用的检查项不计入总数。 · 检查于 2026年11月11日
- ✓ 通过
作者与仓库一致
注册名称已通过 GitHub 账户 nushey 验证,该账户拥有此仓库
- ✓ 通过
仍在维护
代码最后更新于8天前
- … 尚未检查
有许可证
我们还没有从 GitHub 读取这个仓库
- – 不适用
端点有响应
它在你的电脑上运行,没有互联网端点
- – 不适用
使用 OAuth 登录
在你的电脑上运行,改用本地设置
- … 尚未检查
工具描述中没有隐藏指令
它在你的电脑上运行;我们只能读取互联网端点的工具列表
与“开发者工具”中的其他服务器比较i
- 星标数多于此分类中其他 5740 个服务器的 65%
- 发布到注册中心的时间比此分类中其他 5740 个服务器的 71% 更新
- 基础检查结果等于或优于此分类中其他 5740 个服务器的 100%
与注册中心里这个分类中所有活跃的服务器比较。只有当发布者拥有该仓库时,星标数才计入。
常见问题
ContextManager 安全吗?
它在 2 项适用的基础检查中通过了 2 项。我们没有阅读代码。在添加密钥或令牌之前,请先看看这个服务器要求哪些权限,并使用只具备所需权限的密钥。
它需要哪些密钥或代码?
注册中心没有列出必需的密钥,不过有些服务器会在首次使用时要求你登录。
它在我的电脑上运行还是在云端?
它在你的电脑上运行。你的 AI 应用会在需要时启动它,数据不会经过作者的服务器(除非它自己调用在线服务)。
它还在维护吗?
GitHub 仓库最后更新于8天前,最新版本(1.3.5)于8天前进入注册中心。
哪些应用可以使用它?
支持 MCP 的应用,例如 Claude Desktop、Claude Code、Cursor 和 VS Code。你的电脑上还需要有 .NET。
有什么可以替代它?
同一分类中有:REA, Netdata, Front-End Checklist
替代选择
同一分类中其他作者的服务器,按星标数排序。
如何看卡片:↓ 每周下载量i★ GitHub 星标i三大支柱:评价 · 检查 · 使用情况i更新 = 最新版本发布到注册中心的时间i
Netdata
Real-time infrastructure monitoring with metrics, logs, alerts, and ML-based anomaly detection.
Front-End Checklist
Review frontend code and live pages against 386 quality-gated web development rules.
作者的 README
打开 README
按原文从作者的仓库复制。PopNx MCP 没有审查或背书其内容。HTML、图片和脚本已被移除。链接会离开本站。
ContextManager
Structural C# context for AI coding agents, powered by Roslyn.
Navigate before you read.
Install • Tools • How to use it • FAQ • Full install guide
ContextManager is an MCP server that saves an agent from reading whole C# files. It does two things:
- Inspects files. It turns a
.csfile into a JSON contract with its types, public members, constructor dependencies, base types, interfaces, and events. Method bodies, private members, and XML docs are left out; each method carries its line range so the agent can read only the body it needs. - Maps the solution. It builds a knowledge graph of a
.slnso the agent can find which files matter, and how risky a change is, before opening any of them.
Install
You need the .NET 10 SDK or later.
macOS / Linux:
curl -fsSL https://raw.githubusercontent.com/nushey/ContextManager/main/scripts/install.sh | bash
Windows (PowerShell):
irm https://raw.githubusercontent.com/nushey/ContextManager/main/scripts/install.ps1 | iex
The installer installs or updates the ContextManager .NET global tool and runs context-manager setup, a wizard that adds the server to the MCP clients you pick (Claude Code, Claude Desktop, Codex, Antigravity, Kilo Code, Cursor, Devin, Opencode).
To install by hand instead:
dotnet tool install -g ContextManager
claude mcp add --scope user context-manager -- context-manager # Claude Code
For other clients, flags, config-file paths, and troubleshooting, see INSTALL.md.
project_scanon.NET Framework 4.8solutions only works on Windows and needs
Visual Studio Build Tools with the
.NET desktop build tools workload. Everything else works on any platform.
Tools
| Tool | What it returns |
|---|---|
inspect_file | The structural contract of one .cs file. |
inspect_context | A compact view of up to 15 .cs files plus the references between them; unresolved lists the user types missing from the set. |
project_scan | Builds or refreshes the solution's graph and reports its coverage. |
graph_search | Files and methods matching possible names, grouped by file with namespaces and method node IDs. |
graph_get_dependencies | The neighbors of a node, rolled up to their declaring type, with edge counts per kind. |
graph_impact_analysis | Every type that depends on a node, directly or transitively, with its file. |
graph_path_find | The shortest dependency path between two nodes. |
Graph tools take the path of the .sln and keep the graph up to date on their own: before answering, they re-extract only what changed since the last scan. The graph is saved in .context-manager/ .graph.json next to the .sln, so every session on that solution shares it.
How to use it
Start from a file
When the user mentions a file, start there:
inspect_file(path): read the type and build its node ID asNamespace.TypeName.graph_get_dependencies(solutionPath, nodeId): find the neighbors worth reading.inspect_fileon those neighbors only.graph_impact_analysis(solutionPath, nodeId): check the blast radius before changing anything.
A short impact list means the change is contained. A long one means the type's public contract is load-bearing and should be preserved; it does not mean the agent has to read every file in it.
Node IDs use Roslyn's fully qualified format, for example MyApp.Orders.OrderService or MyApp.Orders.OrderService.GetOrderAsync(System.Guid). Pass the IDs that the graph tools return as they are.
// graph_impact_analysis("/abs/path/MyApp.sln", "MyApp.Orders.IOrderRepository")
{ "affectedIds": ["MyApp.Orders.OrderService", "MyApp.Api.OrdersController"], "affectedFiles": { "MyApp.Orders.OrderService": "/abs/path/Orders/OrderService.cs", "MyApp.Api.OrdersController": "/abs/path/Api/OrdersController.cs" } }
Find code by name
When you know roughly what something is called but not which file it is in, and you have no node ID, call graph_search with several candidate names:
{"solutionPath":"/abs/path/MyApp.sln","queries":["Login","Authentication","SignIn"]}
What it searches. A term matches when it appears anywhere in a file name (without .cs) or a method name (without its signature). Matching is ordinal and ignores case, and any one term is enough. It searches every method already in the graph, private ones included, and finds constructors under their type name. It does not search directory paths, parameter types, method bodies, or namespaces.
Valid terms. Terms are trimmed and must have at least 3 characters. An empty list, or a single term that is too short, rejects the whole query before the graph is synchronized, with code invalid_query and message Provide at least one query term; each term must be at least 3 characters long after trimming whitespace.
Order and limit. Exact matches come first, then partial ones; within each group, results keep the order in which they appear in the graph. A name that matches several terms does not rank higher. The search keeps at most 50 matches, and the limit counts matches, not files: each matching file counts once and each matching method ID counts once, even when several terms match it. There is no pagination. When truncated is true, at least one match was left out; use more specific names to narrow the search.
{"results":[{"file":"/abs/path/Auth/Session.cs","namespaces":["MyApp.Auth"],"fileMatched":false,"methods":[{"name":"Login","nodeId":"MyApp.Auth.Session.Login()"}]}],"truncated":false}
Response. The response is one line of compact JSON, grouped by file. Every file entry has file, namespaces, fileMatched, and methods, and empty arrays stay as []. namespaces lists every namespace in the file. fileMatched is true when the file's own name is one of the matches kept within the limit. A file can also appear only because one of its methods was kept, even if its name matched too but fell outside the limit. With no matches, the response is {"results":[],"truncated":false}.
From there, call inspect_file on a returned file, or pass a method's nodeId unchanged to the other graph tools. A graph saved by an older version is re-extracted once to add names and namespaces; later queries reuse the updated graph while nothing changes.
To make your agent follow these workflows, copy docs/AGENTS-template.md into the AGENTS.md of your project.
FAQ
Is it a background service? No. It is an MCP stdio server: the client starts it when a session opens and stops it when the session ends.
What state does it keep? Only the graph files written next to each .sln. The inspection tools read the files you pass and keep nothing.
Does it read my whole solution? Only the graph tools do. inspect_file and inspect_context read just the files you give them.
Build and test
dotnet build
dotnet test
License
MIT © nushey