DevStandards MCP Server
Provides AI agents with access to 284+ development best practices, security guidelines, and coding standards across multiple languages and frameworks including comprehensive Drupal standards and OWASP Top 10 vulnerabilities.
README
DevStandards MCP Server
A Model Context Protocol (MCP) server that provides AI agents with access to development best practices, security guidelines, and coding standards across multiple programming languages and frameworks.
Features
- Plugin Architecture: Extensible system for adding new languages and frameworks
- In-Memory Storage: Fast in-memory data store for instant querying
- Dynamic CSV Loading: Automatically loads all CSV files from plugin data directories
- 284+ Coding Standards: Comprehensive coverage of security, accessibility, performance, and best practices
- MCP Tools: Four tools for querying standards:
get_standards: Filter by category, subcategory, and severitysearch_standards: Full-text search across all standardsget_categories: List all available categoriesget_standard_by_id: Get details for a specific standard
Included Standards
The server currently includes 284+ coding standards across these categories:
Drupal Standards (263 standards)
- Coding Standards (130+ standards): PHP standards, PSR-4 compliance, naming conventions, code organization, documentation
- Security (70 standards): SQL injection, XSS, CSRF, access control, file uploads, authentication, input validation
- Best Practices (16 standards): Field API, dependency injection, configuration management, entity handling
- Frontend (11 standards): Theme development, responsive design, CSS/JS aggregation, Twig templates
- Accessibility (8 standards): WCAG compliance, ARIA attributes, semantic HTML, keyboard navigation
- Testing (7 standards): PHPUnit, Behat, functional testing, test coverage, mocking
- Documentation (7 standards): Code comments, README files, API documentation, DocBlocks
- API (6 standards): REST, JSON:API, GraphQL best practices, HTTP methods
- Build (6 standards): Build processes, optimization, asset management
- DevOps (6 standards): CI/CD, deployment, environment management, GitHub Actions
- Database (5 standards): Schema design, migrations, query optimization, Database API
- Integration (5 standards): Third-party integrations, external services, APIs
- Git (4 standards): Git workflows, commit messages, branching strategies
- JavaScript (3 standards): Drupal behaviors, modern JS patterns, optimization
- Configuration (1 standard): Configuration management
- Forms (1 standard): Form API and handling
- Hooks (1 standard): Hook implementations
- Twig (1 standard): Template best practices
OWASP Standards (20 standards)
- OWASP Top 10 2021: Critical security vulnerabilities including broken access control, cryptographic failures, injection attacks, insecure design, security misconfiguration, vulnerable components, identification failures, software integrity failures, logging failures, and server-side request forgery
Installation
- Clone the repository:
git clone https://github.com/yourusername/devstandards-mcp.git
cd devstandards-mcp
- Create and activate a virtual environment:
python -m venv venv
source venv/bin/activate # On Windows: venv\Scripts\activate
- Install dependencies:
pip install -r requirements.txt
- Copy the environment configuration:
cp .env.example .env
Running the Server
Standalone Executable
./devstandards-server
Via Python Module
source venv/bin/activate
python -m src.server
Testing
Run the test suite:
python -m pytest tests/ -v
Project Structure
devstandards-mcp/
├── src/
│ ├── server.py # MCP server implementation
│ ├── config.py # Configuration management
│ ├── plugins/ # Plugin system
│ │ ├── base.py # Base plugin class
│ │ ├── manager.py # Plugin manager
│ │ └── drupal.py # Drupal standards plugin
│ └── data/ # Data storage layer
│ ├── database.py # Compatibility wrapper
│ └── memory_store.py # In-memory data store
├── data/ # Standards data files
│ ├── drupal/
│ │ └── drupal_standards.csv
│ └── owasp/
│ ├── owasp_top10_2021.csv
│ └── OWASP_RESOURCES.md
├── tests/ # Test suite
├── requirements.txt # Python dependencies
└── README.md # This file
Adding New Standards
1. Add to Existing Plugin
Create or edit any CSV file in the plugin's data directory (data/{plugin_name}/*.csv). The plugin will automatically load all CSV files:
id,category,subcategory,title,description,severity,examples,references,tags,rationale,fix_guidance
NEW001,drupal_security,new_issue,New Security Issue,Description here,high,"{""good"": ""example"", ""bad"": ""example""}","[""https://example.com""]",security|new,Why this matters,How to fix it
Note: The Drupal plugin dynamically loads all CSV files from data/drupal/, so you can organize standards into multiple files (e.g., security_standards.csv, performance_standards.csv, etc.)
2. Create a New Plugin
- Create a new plugin file in
src/plugins/:
from .base import StandardsPlugin, Standard
class MyPlugin(StandardsPlugin):
@property
def name(self) -> str:
return "myplugin"
# ... implement required methods
- Create data directory and CSV file:
mkdir data/myplugin
# Add your CSV file with standards
MCP Client Configuration
Claude Desktop
Add this to your Claude Desktop configuration file (~/Library/Application Support/Claude/claude_desktop_config.json on macOS):
{
"mcpServers": {
"devstandards": {
"command": "/path/to/devstandards-mcp/devstandards-server"
}
}
}
After adding the configuration, restart Claude Desktop.
VSCode with Continue.dev
Continue.dev is an AI coding assistant for VSCode that supports MCP servers.
- Install the Continue extension in VSCode
- Open Continue's configuration (
~/.continue/config.json) - Add the MCP server configuration:
{
"models": [...],
"mcpServers": {
"devstandards": {
"command": "/path/to/devstandards-mcp/devstandards-server"
}
}
}
Cursor Editor
Cursor supports MCP servers through its AI configuration:
- Open Cursor Settings (Cmd+, on macOS)
- Navigate to "AI" → "Model Context Protocol"
- Add server configuration:
{
"devstandards": {
"command": "/path/to/devstandards-mcp/devstandards-server",
"description": "Drupal coding standards and best practices"
}
}
Zed Editor
For Zed editor with AI assistant features:
- Open Zed settings (
~/.config/zed/settings.json) - Add to the assistant configuration:
{
"assistant": {
"mcp_servers": {
"devstandards": {
"command": "/path/to/devstandards-mcp/devstandards-server"
}
}
}
}
Generic MCP Client Configuration
For any MCP-compatible client, use these settings:
- Command:
/path/to/devstandards-mcp/devstandards-server - Protocol: stdio (standard input/output)
- Transport: JSON-RPC over stdio
- Initialization: No special parameters required
Using with Python Scripts
You can also use the MCP server programmatically:
import subprocess
import json
# Start the server
proc = subprocess.Popen(
["/path/to/devstandards-mcp/devstandards-server"],
stdin=subprocess.PIPE,
stdout=subprocess.PIPE,
text=True
)
# Send a request
request = {
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"name": "get_standards",
"arguments": {
"category": "drupal_security",
"severity": "critical"
}
},
"id": 1
}
proc.stdin.write(json.dumps(request) + "\n")
proc.stdin.flush()
# Read response
response = json.loads(proc.stdout.readline())
print(response)
Troubleshooting
If you encounter issues:
- Check logs: Most MCP clients provide debug logs
- Test manually: Run
echo '{"jsonrpc":"2.0","method":"initialize","params":{"protocolVersion":"2024-11-05","capabilities":{},"clientInfo":{"name":"test","version":"1.0"}},"id":1}' | ./devstandards-server - Verify paths: Ensure the executable path is correct and the file is executable (
chmod +x devstandards-server) - Python environment: The server uses its own virtual environment, no need to activate it
Available MCP Tools
Once connected, the following tools are available to AI assistants:
1. get_standards
Query coding standards with filters:
- category: Filter by category (e.g., "drupal_security", "drupal_performance")
- subcategory: Filter by subcategory (e.g., "sql_injection", "xss")
- severity: Filter by severity level ("critical", "high", "medium", "low", "info")
- limit: Maximum number of results (default: 50)
Example query: "Show me all critical security standards for Drupal"
2. search_standards
Full-text search across all standards:
- query: Search text (required)
- categories: List of categories to search within (optional)
- tags: List of tags to filter by (optional)
- limit: Maximum number of results (default: 50)
Example query: "Search for standards about SQL injection"
3. get_categories
List all available categories with descriptions and counts.
Example query: "What categories of standards are available?"
4. get_standard_by_id
Get detailed information about a specific standard:
- standard_id: The unique identifier (e.g., "DS001", "SEC001")
Example query: "Show me details for standard DS001"
Example Prompts for AI Assistants
When using an MCP client with this server, you can ask:
- "What are the critical security standards I should follow for Drupal?"
- "Show me best practices for Drupal forms"
- "Search for standards about caching and performance"
- "How should I handle user input to prevent XSS attacks?"
- "What's the proper way to use Drupal's Database API?"
- "List all accessibility standards"
- "Show me examples of good vs bad code for SQL queries"
- "What are the OWASP Top 10 2021 vulnerabilities and how to prevent them?"
- "Show me critical security standards across all categories"
- "Search for standards about broken access control"
Contributing
- Fork the repository
- Create a feature branch
- Add your changes
- Write tests
- Submit a pull request
License
MIT License - see LICENSE file for details
推荐服务器
Baidu Map
百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。
Playwright MCP Server
一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。
Magic Component Platform (MCP)
一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。
Audiense Insights MCP Server
通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。
VeyraX
一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。
graphlit-mcp-server
模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。
Kagi MCP Server
一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。
e2b-mcp-server
使用 MCP 通过 e2b 运行代码。
Neon MCP Server
用于与 Neon 管理 API 和数据库交互的 MCP 服务器
Exa MCP Server
模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。