MCP Server implementing Model Context Protocol over JSON-RPC stdio. Exposes design guideline documents (ADRs, recommendations, structures) as tools for AI assistants like GitHub Copilot. Install as a .NET tool for seamless integration.
$ dotnet add package HexMaster.DesignGuidelines.ServerDesign, architecture, style and structure guidelines for modern .NET (C#) projects, organized as ADRs, designs, recommendations and structures under docs/. An MCP Server in src/ exposes these documents for tools/agents.
An MCP (Model Context Protocol) server implementing the official Microsoft MCP SDK. Exposes design guideline documents as tools that AI assistants can call.
The server implements the Model Context Protocol using the official ModelContextProtocol NuGet package. It exposes two tools:
Documents are served from the local repository first, with automatic fallback to GitHub raw content if not found locally.
From the repository root:
dotnet run --project .\src\Hexmaster.DesignGuidelines.Server\Hexmaster.DesignGuidelines.Server.csproj
The server uses stdio transport for MCP communication. Logs are written to stderr, JSON-RPC messages to stdout.
You can override the repository root with HEXMASTER_REPO_ROOT environment variable if needed.
The MCP Server can be integrated with GitHub Copilot to provide AI agents with access to design guidelines during code generation.
There are two usage scenarios:
This is the recommended approach for general use. Documents are automatically fetched from the GitHub repository, so no local clone is needed.
VS Code Setup
Install the package:
dotnet tool install --global HexMaster.DesignGuidelines.Server
Configure VS Code MCP settings:
Create or edit .vscode/mcp.json in your user profile or workspace:
{
"inputs": [],
"servers": {
"hexmaster-design-guidelines": {
"type": "stdio",
"command": "HexMaster.DesignGuidelines.Server",
"args": []
}
}
}
Location options:
%USERPROFILE%\.vscode\mcp.json (Windows) or ~/.vscode/mcp.json (Mac/Linux).vscode/mcp.json in your project rootRestart VS Code to apply changes
Verify the connection:
Visual Studio Setup
Install the package:
dotnet tool install --global HexMaster.DesignGuidelines.Server
Configure Copilot MCP settings:
Tools → OptionsGitHub → Copilot → MCP Servershexmaster-design-guidelinesHexMaster.DesignGuidelines.ServerRestart Visual Studio to apply changes
Verify the connection:
How it works: When installed as a global tool, the server automatically fetches documents from the GitHub repository (https://github.com/nikneem/hexmaster-design-guidelines). No local clone is required, and you'll always get the latest published content from the main branch.
Uninstall:
dotnet tool uninstall --global HexMaster.DesignGuidelines.Server
For contributors testing local changes before publishing to NuGet. This allows you to work with unpublished ADRs, recommendations, or structural changes.
VS Code Setup
Clone the repository:
git clone https://github.com/nikneem/hexmaster-design-guidelines.git
cd hexmaster-design-guidelines
Create .vscode/mcp.json in the repository root:
cp .vscode/mcp.json.template .vscode/mcp.json
Edit .vscode/mcp.json and replace <ABSOLUTE_PATH_TO_REPO> with your actual path:
{
"inputs": [],
"servers": {
"hexmaster-design-guidelines": {
"type": "stdio",
"command": "dotnet",
"args": [
"run",
"--project",
"D:/projects/github.com/nikneem/hexmaster-design-guidelines/src/Hexmaster.DesignGuidelines.Server/Hexmaster.DesignGuidelines.Server.csproj"
],
"env": {
"HEXMASTER_REPO_ROOT": "D:/projects/github.com/nikneem/hexmaster-design-guidelines"
}
}
}
}
Restart VS Code - The MCP server will run directly from your local source code
How it works: When running from source with dotnet run, the HEXMASTER_REPO_ROOT environment variable tells the server to read documents from your local docs/ folder instead of fetching from GitHub. This allows you to test changes immediately without publishing.
Testing Local NuGet Packages (Advanced)
If you want to test the packaged tool locally before publishing to NuGet.org:
# Pack the project
dotnet pack src/Hexmaster.DesignGuidelines.Server/Hexmaster.DesignGuidelines.Server.csproj -o ./local-packages
# Install from local package
dotnet tool install --global --add-source ./local-packages HexMaster.DesignGuidelines.Server
# Configure VS Code to use the installed tool (NO HEXMASTER_REPO_ROOT - fetches from GitHub)
# Edit .vscode/mcp.json or %USERPROFILE%\.vscode\mcp.json:
{
"inputs": [],
"servers": {
"hexmaster-design-guidelines": {
"type": "stdio",
"command": "HexMaster.DesignGuidelines.Server",
"args": []
}
}
}
# ONLY if you want to test with LOCAL documents (not typical):
{
"inputs": [],
"servers": {
"hexmaster-design-guidelines": {
"type": "stdio",
"command": "HexMaster.DesignGuidelines.Server",
"args": [],
"env": {
"HEXMASTER_REPO_ROOT": "D:/projects/github.com/nikneem/hexmaster-design-guidelines"
}
}
}
}
When to use HEXMASTER_REPO_ROOT:
dotnet run (always required)Server doesn't appear in Copilot
dotnet --versionDocuments not loading
HEXMASTER_REPO_ROOT points to repository rootGlobal tool not found
dotnet tool list --global%USERPROFILE%\.dotnet\tools~/.dotnet/toolsThis repository intentionally keeps an explicit registry. When you add a file anywhere under docs/, register it in:
src/Hexmaster.DesignGuidelines.Core/Services/DocumentRegistry.cs
Add a new entry with an Id, Title, RelativePath (from repo root) and the correct category type. This ensures the MCP Server “knows” about the document and it will appear in /docs and be retrievable via /docs/{id}.
docs/
adrs/
designs/
recommendations/
structures/
src/
Hexmaster.DesignGuidelines.Core/
Hexmaster.DesignGuidelines.Server/
hexmaster-design-guidelines.sln
.github/
copilot-instructions.md
docs/recommendations/unit-testing-xunit-moq-bogus.md)docs/structures/minimal-api-endpoint-organization.md)Workflow: .github/workflows/pr-validation.yml
Triggers on pull requests to main or develop branches when files in src/ or tests/ change.
Steps:
Coverage Requirements:
Workflow: .github/workflows/ci-cd.yml
Triggers on push to main branch.
Steps:
Semantic Versioning Strategy:
feature/*): 1.1.0-alpha.1, 1.1.0-alpha.2... (minor with pre-release)release/*): 1.0.0-beta.1, 1.0.0-beta.2... (patch with pre-release)hotfix/*): Patch incrementConfiguration: GitVersion.yml at repository root.
Both projects are published to NuGet.org:
Package features:
.snupkg) for debuggingTo enable automated publishing, add the following GitHub secret:
NUGET_API_KEY – NuGet.org API key with push permissionsNavigate to: Repository Settings → Secrets and variables → Actions → New repository secret
To check what version GitVersion would generate locally:
# Install GitVersion tool
dotnet tool install --global GitVersion.Tool
# Run in repository root
dotnet-gitversion
.NET 9.