home / mcp / bestpractices mcp server
Provides AI agents with access to 284+ coding standards across Drupal, OWASP, and related best practices via a plugin-based MCP server.
Configuration
View docs{
"mcpServers": {
"abderrahimghazali-bestpractices_mcp": {
"command": "python",
"args": [
"-m",
"src.server"
]
}
}
}BestPractices MCP Server provides AI agents with fast access to a comprehensive set of coding standards, security guidelines, and best practices across multiple languages and frameworks. It uses a plugin system to load standards data on the fly, supports in-memory querying for instant responses, and exposes tools that help you filter, search, and retrieve detailed standard information for integration with your development workflows.
Connect your MCP client to the BestPractices MCP Server to query coding standards and best practices. You can retrieve matching standards by category, subcategory, or severity; perform full-text searches across all standards; list all available categories; and fetch detailed information for a single standard. Use the tools to help your AI agents propose secure, accessible, and well-structured code recommendations during development.
Prerequisites you need before installing:
- Python 3.8+ and a working Python environment
- Git to clone the repository
- Permission to install Python dependencies (pip access)
- A terminal or shell with access to run commands# Step 1: Clone the repository
git clone https://github.com/abderrahimghazali/bestpractices_mcp.git
cd bestpractices_mcp
# Step 2: Create and activate a virtual environment
python -m venv venv
source venv/bin/activate # On Windows: venv\Scripts\activate
# Step 3: Install dependencies
pip install -r requirements.txt
# Step 4: Prepare environment configuration (optional but recommended)
cp .env.example .envTo run the server in standalone mode, execute the server binary from the repository root.
# Standalone executable
./bestpractices-server
```
To run the server as a Python module, activate the virtual environment and start the module directly.# Python module start
source venv/bin/activate
python -m src.serverThe server supports running in a local, stdio-based MCP client environment. If you are configuring clients, point them at the server executable or module start, depending on your deployment choice. Ensure your environment variables (if any) are set in the environment file or shell before starting the server to avoid missing configuration.
If you encounter issues when starting or querying standards, check the following: - Verify the executable path and that the file has execute permissions - Ensure the Python virtual environment is activated when using the Python module start - Confirm dependencies are installed without errors - Review logs from the MCP client for any protocol or connection errors and adjust client capabilities if needed.
The server dynamically loads all CSV files from plugin data directories, so you can organize standards into multiple files under data/{plugin_name}/*.csv. This enables you to extend the coverage without changing the core server.
Retrieve standards filtered by category, subcategory, and severity with optional limit to constrain results.
Perform a full-text search across all loaded standards and return matching results with optional filters.
List all available standard categories along with descriptions and counts.
Fetch detailed information for a specific standard by its unique identifier.