A Model Context Protocol (MCP) server that provides Python coding best practices and guidelines to AI assistants.
This MCP server exposes interactive tools, resources, and prompts for searching and retrieving curated Python coding standards from a knowledge base covering general Python coding and FastAPI development.
search_practices- Search for best practices by keywordget_topic- Retrieve detailed information about a specific topiclist_categories- List all available categoriesget_category- Get all topics within a categorylist_all_topics- Get a complete overview of all topics
bestpractices://catalog- Complete best practices catalogbestpractices://category/{category_name}- Category-specific practicesbestpractices://topic/{category}/{topic_name}- Specific topic content
review_code- Review code against best practicessuggest_improvements- Suggest specific improvements for codeexplain_practice- Get detailed explanation of a best practice
Install via uvx:
uvx bestpractices-mcp-serverOr install from source:
pip install -e .Add to .kiro/settings/mcp.json:
{
"mcpServers": {
"python-best-practices": {
"command": "uvx",
"args": ["bestpractices-mcp-server"],
"env": {
"BEST_PRACTICES_JSON_PATH": "data/python_best_practices.json",
"LOG_LEVEL": "INFO"
}
}
}
}Add to ~/Library/Application Support/Claude/claude_desktop_config.json:
{
"mcpServers": {
"python-best-practices": {
"command": "uvx",
"args": ["bestpractices-mcp-server"],
"env": {
"BEST_PRACTICES_JSON_PATH": "/absolute/path/to/data/python_best_practices.json",
"LOG_LEVEL": "INFO"
}
}
}
}Note: Claude Desktop requires absolute paths for file references.
BEST_PRACTICES_JSON_PATH- Path to JSON file (default:data/python_best_practices.json)MAX_SEARCH_RESULTS- Maximum number of search results (default:50)LOG_LEVEL- Logging level (default:INFO)ENABLE_CACHING- Enable/disable caching (default:true)
Install development dependencies:
pip install -e ".[dev]"Run tests:
pytestRun property-based tests:
pytest tests/test_properties.pybestpractices_mcp_server/
├── src/
│ └── bestpractices_mcp_server/
│ ├── __init__.py
│ ├── server.py # Main MCP server
│ ├── data_layer.py # Data loading and caching
│ ├── business_logic.py # Search, retrieval, formatting
│ └── models.py # Data models
├── tests/
│ ├── test_data_layer.py
│ ├── test_business_logic.py
│ ├── test_server.py
│ └── test_properties.py # Property-based tests
├── data/
│ └── python_best_practices.json
├── config/
│ ├── kiro_mcp.json # Example Kiro configuration
│ └── claude_desktop_config.json # Example Claude Desktop configuration
├── pyproject.toml
├── README.md
└── .env.example
- Ensure the MCP server is listed in
.kiro/settings/mcp.json - Check the Kiro logs for connection errors
- Verify the JSON file path is correct
- Ensure you're using absolute paths in the configuration
- Restart Claude Desktop after configuration changes
- Check
~/Library/Logs/Claude/mcp*.logfor errors
MIT