Standalone repository for McpServer.Support.Mcp, the MCP context server used for todo management, session logs, context search, repository operations, and GitHub issue sync.
- HTTP API with Swagger UI
- MCP over STDIO transport (
--transport stdio) - Single-port multi-tenant workspace hosting via
X-Workspace-Pathheader - Per-workspace todo storage backend (
yamlfile-backed orsqlitetable-backed) - Three-tier workspace resolution: header → API key reverse lookup → default
- Optional interaction logging and Parseable sink support
src/McpServer.Support.Mcp- server applicationtests/McpServer.Support.Mcp.Tests- unit/integration testsdocs/MCP-SERVER.md- detailed operational and configuration guidescripts- run, validate, test, migration, extension, and packaging scripts.github/workflows/mcp-server-ci.yml- CI pipeline (build/test/artifacts/MSIX/docs quality)
- .NET SDK from
global.json - PowerShell 7+
- Windows SDK tools (
makeappx.exe) for MSIX packaging - Optional: GitHub CLI (
gh) for GitHub issue endpoints
- Restore and build:
dotnet restore McpServer.sln
dotnet build McpServer.sln -c Staging- Run the default instance:
.\scripts\Start-McpServer.ps1 -Configuration Staging -Instance default- Open Swagger:
http://localhost:7147/swagger
dotnet run --project src\McpServer.Support.Mcp\McpServer.Support.Mcp.csproj -c Staging -- --instance defaultdotnet run --project src\McpServer.Support.Mcp\McpServer.Support.Mcp.csproj -c Staging -- --transport stdio --instance defaultPrimary config section: Mcp.
Important keys:
Mcp:PortMcp:RepoRootMcp:DataSourceMcp:TodoFilePathMcp:TodoStorage:Provider(yamlorsqlite)Mcp:TodoStorage:SqliteDataSourceMcp:GraphRag:*(GraphRAG enablement, query defaults, backend command, concurrency)Mcp:Instances:{name}:*(per-instance overrides)
Environment overrides:
PORT- highest-priority runtime port overrideMCP_INSTANCE- instance selection when--instanceis not passed
{
"Mcp": {
"Instances": {
"default": {
"Port": 7147,
"RepoRoot": ".",
"DataSource": "mcp.db",
"TodoFilePath": "docs/Project/TODO.yaml",
"TodoStorage": {
"Provider": "yaml",
"SqliteDataSource": "mcp.db"
}
},
"alt-local": {
"Port": 7157,
"RepoRoot": "temp_test",
"DataSource": "mcp-alt.db",
"TodoFilePath": "docs/Project/TODO.yaml",
"TodoStorage": {
"Provider": "sqlite",
"SqliteDataSource": "mcp-alt.db"
}
}
}
}
}Run two configured instances:
.\scripts\Start-McpServer.ps1 -Configuration Staging -Instance default
.\scripts\Start-McpServer.ps1 -Configuration Staging -Instance alt-localSmoke test both instances:
.\scripts\Test-McpMultiInstance.ps1 -Configuration Staging -FirstInstance default -SecondInstance alt-localMigrate todo data between backends:
.\scripts\Migrate-McpTodoStorage.ps1 -SourceBaseUrl http://localhost:7147 -TargetBaseUrl http://localhost:7157scripts/Start-McpServer.ps1- build/run server with optional-Instancescripts/Run-McpServer.ps1- direct local run helperscripts/Update-McpService.ps1- stop, publish Debug build, restore config/data, restart, health-check Windows servicescripts/Validate-McpConfig.ps1- config validationscripts/Test-McpMultiInstance.ps1- two-instance smoke testscripts/Test-GraphRagSmoke.ps1- GraphRAG status/index/query smoke validationscripts/Migrate-McpTodoStorage.ps1- todo backend migrationscripts/Package-McpServerMsix.ps1- publish and package MSIX
GraphRAG is workspace-scoped and disabled by default. When enabled, it can enhance /mcpserver/context/search and is also exposed directly through:
GET /mcpserver/graphrag/statusPOST /mcpserver/graphrag/indexPOST /mcpserver/graphrag/query
Key behavior:
- Per-workspace GraphRAG state under
Mcp:GraphRag:RootPath - Index locking per workspace (single active index job by default)
- Explicit status lifecycle fields (
state,activeJobId, failure metadata, artifact version) - Fallback to context search when GraphRAG is disabled, uninitialized, not indexed, or backend execution fails
- Do not store backend secrets in repo config; inject runtime secrets via environment or secure host configuration
Example config:
{
"Mcp": {
"GraphRag": {
"Enabled": true,
"EnhanceContextSearch": true,
"RootPath": "mcp-data/graphrag",
"DefaultQueryMode": "local",
"DefaultMaxChunks": 20,
"IndexTimeoutSeconds": 600,
"QueryTimeoutSeconds": 120,
"BackendCommand": "",
"BackendArgs": "{operation} --graphRoot {graphRoot} --workspace {workspacePath}",
"MaxConcurrentIndexJobsPerWorkspace": 1,
"ArtifactVersion": "v1"
}
}
}Track these operational indicators during rollout:
- Index duration (
lastIndexDurationMs) and active job contention (index_conflict) - Fallback rate (
fallbackUsedandfallbackReason) per query mode - Failure categories (
failureCode) and backend stderr patterns - Indexed corpus drift (
lastIndexedDocumentCountvs expected input volume)
- Keep
Mcp:GraphRag:Enabled=falsein shared defaults. - Enable GraphRAG in one pilot workspace and run
scripts/Test-GraphRagSmoke.ps1. - Verify fallback rate and failure codes remain acceptable under real workload.
- Expand enablement workspace-by-workspace.
- Keep external backend optional; if unavailable, ensure fallback path remains healthy.
dotnet build McpServer.sln -c Staging
dotnet test tests\McpServer.Support.Mcp.Tests\McpServer.Support.Mcp.Tests.csproj -c DebugMain endpoints:
/mcpserver/todo/mcpserver/sessionlog/mcpserver/context/mcpserver/repo/mcpserver/gh/mcpserver/sync/health/swagger
Workflow: .github/workflows/mcp-server-ci.yml
Pipeline jobs include:
- restore/build/test
- config validation
- OpenAPI artifact generation
- publish artifact upload
- Windows MSIX packaging
- markdown lint and link checking for docs
Extension sources and packaging scripts live in:
extensions/fwh-mcp-todo(legacy name)extensions/McpServer-mcp-todoscripts/Package-Vsix.ps1scripts/Build-AndInstall-Vsix.ps1
A typed REST client is available as a NuGet package for consuming the MCP Server API:
dotnet add package SharpNinja.McpServer.Client// With DI
builder.Services.AddMcpServerClient(options =>
{
options.BaseUrl = new Uri("http://localhost:7147");
options.ApiKey = "your-api-key"; // optional
});
// Without DI
var client = McpServerClientFactory.Create(new McpServerClientOptions
{
BaseUrl = new Uri("http://localhost:7147"),
});Covers all API endpoints: Todo, Context, SessionLog, GitHub, Repo, Sync, Workspace, and Tools.
Source: src/McpServer.Client/ — see the package README for full usage.
- Full server guide:
docs/MCP-SERVER.md - User documentation:
docs/USER-GUIDE.md - Documentation index:
docs/README.md