MCP server to ensure code best practices for various programming languages and use cases
A Model Context Protocol (MCP) server that provides access to coding guides and best practices for AI assistants like Claude and GitHub Copilot.
This MCP server exposes coding guidelines and style guides as resources that can be accessed by MCP clients. It's designed to extend or replace AGENTS.md files by providing a structured way to serve coding practices and guidelines to AI assistants during development.
guides://list - Lists all available coding guidesguides://{guide_name} - Retrieves the content of a specific guide (e.g., guides://python.md)# Clone the repository
git clone https://github.com/delian/codeguide-mcp.git
cd codeguide-mcp
# Install with uv (recommended)
uv install
# Or with pip
pip install -e .docker build -t codeguide-mcp .
docker run -i codeguide-mcpConfigure the server by creating a config.toml file or setting environment variables:
To load guides from a GitHub repository:
github_repo = "owner/repository" # e.g., "delian/codeguide-mcp"
github_path = "guides" # Path to guides directory in repo
github_branch = "main" # Branch to fetch from
cache_dir = ".guides-cache" # Local cache directory
log_level = "INFO"To use local guides only:
guides_dir = "guides"
log_level = "INFO"GUIDES_GITHUB_REPO - GitHub repository (format: owner/repo)GUIDES_GITHUB_PATH - Path to guides directory in repository (default: guides)GUIDES_GITHUB_BRANCH - Branch to fetch from (default: main)GUIDES_CACHE_DIR - Local cache directory (default: .guides-cache)GUIDES_DIR - Local directory containing guide files (default: guides)GUIDES_LOG_LEVEL - Logging level (default: INFO)guides_dir if configuredIf you've configured github_repo, simply add Markdown files to the specified directory in your GitHub repository. The server will automatically fetch and cache them.
Add Markdown files to the guides/ directory. Each file will be automatically available as a resource.
Example:
echo "# Python Style Guide\n\nUse PEP 8..." > guides/python.mdAdd to your mcp.json:
{
"mcpServers": {
"coding-guides": {
"command": "python",
"args": ["-m", "main"]
}
}
}or
{
"mcpServers": {
"coding-guides": {
"command": "docker",
"args": ["run", "--rm", "-i", "docker.io/delian/codeguide-mcp"]
}
}
}Run the server and connect via stdio:
python main.py# Install development dependencies
uv pip install -e ".[dev]"
# Run pre-commit hooks
pre-commit install
pre-commit run --all-files
# Run the server
python main.pyMIT
Contributions welcome! Please open an issue or pull request.
delian/codeguide-mcp
November 22, 2025
April 13, 2026
Python