Development Setup Guide¶
This guide helps you set up your development environment for contributing to MCP Standards Server.
Prerequisites¶
- Python 3.11 or higher
- Git
- Redis (for caching features)
- Node.js 18+ (for web UI development)
Environment Setup¶
1. Clone the Repository¶
2. Create Virtual Environment¶
# Create virtual environment
python -m venv venv
# Activate it
# On Linux/Mac:
source venv/bin/activate
# On Windows:
venv\Scripts\activate
3. Install Dependencies¶
# Install in development mode with all extras
pip install -e ".[dev,test,performance,visualization,full]"
# Install pre-commit hooks
pre-commit install
4. Set Up Redis¶
# Ubuntu/Debian
sudo apt-get install redis-server
# macOS
brew install redis
# Start Redis
redis-server
5. Environment Variables¶
Create a .env
file in the project root:
Development Workflow¶
1. Create Feature Branch¶
2. Make Changes¶
Follow the coding standards: - Use type hints - Write docstrings - Add unit tests - Update documentation
3. Run Tests¶
# Run all tests
pytest
# Run specific test file
pytest tests/unit/test_your_feature.py
# Run with coverage
pytest --cov=src --cov-report=html
4. Run Linters¶
# Format code
black src/ tests/
# Type checking
mypy src/
# Linting
flake8 src/ tests/
# Or run all checks
make lint
5. Test Locally¶
# Start the MCP server
python -m src
# In another terminal, test with CLI
mcp-standards validate examples/
# Test the web UI
cd web && npm start
IDE Setup¶
VS Code¶
Recommended extensions: - Python - Pylance - Black Formatter - GitLens
Settings (.vscode/settings.json
):
{
"python.linting.enabled": true,
"python.linting.flake8Enabled": true,
"python.formatting.provider": "black",
"editor.formatOnSave": true,
"python.testing.pytestEnabled": true
}
PyCharm¶
- Set Python interpreter to virtual environment
- Enable Django support if working on web components
- Configure code style to use Black
- Set up pytest as test runner
Debugging¶
Debug MCP Server¶
# Add breakpoints in code
import pdb; pdb.set_trace()
# Or use VS Code/PyCharm debugger with launch configurations
Debug Configuration (VS Code)¶
{
"version": "0.2.0",
"configurations": [
{
"name": "Debug MCP Server",
"type": "python",
"request": "launch",
"module": "src",
"env": {
"PYTHONPATH": "${workspaceFolder}",
"MCP_ENV": "development"
}
}
]
}
Common Issues¶
Import Errors¶
Redis Connection¶
Test Failures¶
Next Steps¶
- Read Contributing Standards
- Learn about Writing Validators
- Understand Testing Guidelines
Getting Help¶
- Check existing issues on GitHub
- Join our Discord community
- Ask questions in discussions
Happy coding! 🚀