damens_mcps
Copilot instructions2 starsChanged 13 months agoMITView on GitHub
This file provides instructions for GitHub Copilot coding agent when working with this repository. This is a collection of Model Context Protocol (MCP) servers for managing infrastructure components. Each MCP server provides AI assistants with direct API access to different platforms through standardized MCP interfaces. ALWAYS use virtual environments for Python development. Never install packages globally. Each project uses different configuration methods: TrueNAS & pfSense: iDRAC & Proxmox: The repository uses two distinct MCP implementation patterns: Each project follows this…
- Reads credentials
- Installs packages
In this repositoryOne other file it gives its agents.
- CLAUDE.mdCLAUDE.md
The file
Show its rules and text
We split this copilot-instructions.md into the rules it gives an agent
28 rules. About 0 are common, 20 are distinctive, and 8 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈20
Distinctive · estimate
This author's own choices. Worth a look.
8
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 67
Code Style: Follow PEP 8 standards
- Distinctive: line 68
Type Hints: Use type annotations for function parameters and returns
- Distinctive: line 69
Async/Await: Use async functions for I/O operations
- Distinctive: line 130
All projects have test infrastructure with CI/CD automation
- Distinctive: line 137
Use the canonical implementation for each project:
- Very specific: line 168
Use .gitignore: - All sensitive files must be in .gitignore
- Distinctive: line 170
API keys preferred: - Use API keys over passwords when possible
- Very specific: line 171
SSL verification: - Use SSL_VERIFY=true in production
- Distinctive: line 183
All tool inputs MUST be validated before execution
- Very specific: line 203
Run pytest tests/ -v and ensure all tests pass
- Distinctive: line 204
Add tests for new functionality
- Distinctive: line 205
Update existing tests if behavior changes
- Distinctive: line 210
Security: Check for credential leaks or security issues
- Distinctive: line 211
Error Handling: Verify comprehensive exception handling
- Distinctive: line 212
Input Validation: Ensure all inputs are validated
- Distinctive: line 213
Documentation: Verify README/docstrings are updated
- Very specific: line 265
Verify network connectivity: ping <host>
- Very specific: line 266
Check port access: telnet <host> <port>
- Very specific: line 267
Test API directly: curl -k https://<host>/api/endpoint
- Distinctive: line 268
Verify credentials in config
- Distinctive: line 270
Check SSL verification settings
- Distinctive: line 311
Delete VMs/containers (Proxmox)
- Distinctive: line 312
Remove firewall rules (pfSense)
- Distinctive: line 315
Always validate parameters and consider user confirmation for destructive operations.
- Distinctive: line 322
Use health checks before heavy operations
- Very specific: line 328
Use Python logging module for structured logging
- Very specific: line 339
TEST_COVERAGE_SUMMARY.md: - Test coverage details
- Distinctive: line 388
When making changes, always review:
≈ “Common” is an estimate: at least 1 in 5 of the 1,644 Copilot instructions files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
GitHub Copilot Instructions
This file provides instructions for GitHub Copilot coding agent when working with this repository.
Project Overview
This is a collection of Model Context Protocol (MCP) servers for managing infrastructure components. Each MCP server provides AI assistants with direct API access to different platforms through standardized MCP interfaces.
Repository Structure
damens_mcps/
├── pfsense-mcp/ # Firewall and network management for pfSense
├── truenas-mcp/ # Storage and NAS management for TrueNAS
├── idrac-mcp/ # Dell server management via iDRAC
└── proxmox-mcp/ # Virtualization platform management for Proxmox VEProject Status
- pfSense MCP: ✅ Production-ready - Comprehensive firewall management with 25 tools
- TrueNAS MCP: ✅ Production-ready - Storage and NAS management with HTTP/CLI interface
- iDRAC MCP: ✅ Stable - Dell server power management with 8 tools for multi-server fleets
- Proxmox MCP: ✅ Stable - Virtualization management with 21 tools for VMs and containers
Development Environment Setup
Python Virtual Environment (REQUIRED)
ALWAYS use virtual environments for Python development. Never install packages globally.
# Navigate to project directory
cd <project-name>
# Create virtual environment
python3 -m venv .venv
# Activate virtual environment
source .venv/bin/activate # On Windows: .venv\Scripts\activate
# Install dependencies
pip install -r requirements.txtConfiguration
Each project uses different configuration methods:
TrueNAS & pfSense:
cp env.example .env
# Edit .env with actual credentialsiDRAC & Proxmox:
cp config.example.json config.json
# Edit config.json with actual credentialsCoding Conventions
General Standards
- Python Version: Python 3.8+ required
- Code Style: Follow PEP 8 standards
- Type Hints: Use type annotations for function parameters and returns
- Async/Await: Use async functions for I/O operations
- Error Handling: Comprehensive exception handling with meaningful messages
Project Architecture Patterns
The repository uses two distinct MCP implementation patterns:
1. MCP Library-Based (TrueNAS, pfSense)
- Uses official
mcpPython library - Implements
Serverclass with stdio or HTTP transport - Uses structured types from
mcp.types
2. Pure JSON-RPC (iDRAC, Proxmox)
- Direct JSON-RPC implementation without MCP library
- Reads from stdin, writes to stdout
- Manual protocol implementation for maximum compatibility
File Organization
Each project follows this structure:
project-name/
├── src/
│ ├── auth.py # Authentication logic
│ ├── client.py # API client implementation
│ ├── server.py # MCP server (or working_*_server.py)
│ ├── resources/ # Resource handlers by functionality
│ │ ├── system.py
│ │ ├── storage.py
│ │ ├── network.py
│ │ └── ...
│ └── utils/
│ ├── validation.py # Input validation
│ └── logging.py # Logging configuration
├── tests/ # Test files
├── examples/ # Usage examples
├── requirements.txt # Dependencies
└── README.md # Project documentationBuild & Test Instructions
Running Tests
# Install test dependencies
pip install pytest pytest-cov pytest-asyncio pytest-mock
# Run all tests for a project
cd <project-name>
pytest tests/ -v
# Run with coverage
pytest tests/ --cov=src --cov-report=html
# Run specific test file
pytest tests/test_validation.py -vTest Coverage Requirements
- All projects have test infrastructure with CI/CD automation
- Input validation tests are critical (high coverage)
- Integration tests require actual system configuration
- Mock tests for unit testing without dependencies
Starting Servers
Use the canonical implementation for each project:
# TrueNAS MCP
python -m src.http_cli serve
# pfSense MCP
python -m src.http_pfsense_server
# iDRAC MCP (ONLY use this implementation)
python working_mcp_server.py
# Proxmox MCP (ONLY use this implementation)
python working_proxmox_server.pyHealth Checks
# TrueNAS
python -m src.http_cli health
# Check server endpoints (if HTTP-based)
curl http://localhost:8000/healthSecurity Requirements
Critical Security Rules
- NEVER commit credentials - No
.env,config.json, or files with passwords - Use .gitignore - All sensitive files must be in
.gitignore - File permissions - Set
chmod 600on config files with credentials - API keys preferred - Use API keys over passwords when possible
- SSL verification - Use
SSL_VERIFY=truein production
Project-Specific Security
Each project has a SECURITY.md file with detailed guidance:
- pfSense: API key management, firewall rules
- TrueNAS: API key management, storage access controls
- iDRAC: Credential encryption options, fleet management
- Proxmox: VM management security, ticket-based auth
Input Validation
- All tool inputs MUST be validated before execution
- Type checking and sanitization in resource handlers
- Parameter validation in client methods
- Dangerous operations (power off, delete) require special handling
Pull Request Validation
Pre-Commit Checklist
- Code follows PEP 8 standards
- All functions have type hints
- Input validation added for new parameters
- Error handling implemented
- Tests added/updated for changes
- Documentation updated if needed
- No credentials or sensitive data in commits
- Virtual environment used (not global packages)
Testing Requirements
- Run
pytest tests/ -vand ensure all tests pass - Add tests for new functionality
- Update existing tests if behavior changes
- Integration tests are optional (require system access)
Code Review Points
- Security: Check for credential leaks or security issues
- Error Handling: Verify comprehensive exception handling
- Input Validation: Ensure all inputs are validated
- Documentation: Verify README/docstrings are updated
- Testing: Confirm appropriate test coverage
Common Development Tasks
Adding a New Tool
- Define the tool in server's tool list:
Tool(
name="platform_resource_action",
description="Clear description of what the tool does",
inputSchema={
"type": "object",
"properties": {
"param1": {"type": "string", "description": "..."},
},
"required": ["param1"]
}
)- Implement the handler in appropriate resource class:
async def new_action(self, param1: str) -> Dict[str, Any]:
# Validate input
# Perform action
# Return result
return {"status": "success", "data": result}- Add routing in server's
_call_tool()method - Add tests in
tests/directory - Update documentation in README.md
Debugging MCP Servers
For JSON-RPC servers (iDRAC, Proxmox):
def debug_print(message: str):
"""Print to stderr to avoid interfering with stdin/stdout protocol"""
print(f"DEBUG: {message}", file=sys.stderr)For library-based servers:
import logging
logging.basicConfig(level=logging.DEBUG)Testing Connection Issues
- Verify network connectivity:
ping <host> - Check port access:
telnet <host> <port> - Test API directly:
curl -k https://<host>/api/endpoint - Verify credentials in config
- Confirm API is enabled on target platform
- Check SSL verification settings
Dependencies
Core Dependencies (Common to All Projects)
requests- HTTP client for API callsurllib3- HTTP library with SSL supportpython-dotenv- Environment variable loading (TrueNAS/pfSense)
MCP Library Stack (TrueNAS, pfSense)
mcp>=1.0.0- Official MCP protocol implementationfastapi- HTTP server frameworkuvicorn- ASGI serverpydantic- Data validationpython-jose- JWT token handling
Testing & Development
pytest- Testing frameworkpytest-cov- Coverage reportingpytest-asyncio- Async test supportpytest-mock- Mocking utilities
Important Notes
Canonical Implementations
Each project has a canonical server implementation - the definitive version to use:
- TrueNAS:
src/http_cli.pywith HTTP server - pfSense:
src/http_pfsense_server.py - iDRAC:
working_mcp_server.py(NOT other server files) - Proxmox:
working_proxmox_server.py(NOT other server files)
Other server files may exist for historical reasons but should NOT be used or modified.
Dangerous Operations
Some tools perform destructive actions. Handle with care:
- Power off/restart servers (iDRAC)
- Delete VMs/containers (Proxmox)
- Remove firewall rules (pfSense)
- Delete datasets (TrueNAS)
Always validate parameters and consider user confirmation for destructive operations.
API Rate Limiting
Be mindful of API call frequency:
- Cache results when appropriate
- Batch operations when possible
- Use health checks before heavy operations
Logging Best Practices
- JSON-RPC servers: Log to stderr (stdout is for protocol)
- HTTP servers: Standard logging to stdout
- Use Python
loggingmodule for structured logging - Debug mode available via environment variables
Documentation Files
Repository Documentation
- CLAUDE.md - Comprehensive guide for Claude Code (claude.ai/code) when working with this repository
- README.md - Main repository overview and quick start
- SETUP_GUIDE.md - Detailed setup instructions
- TESTING.md - Testing guide and best practices
- TEST_COVERAGE_SUMMARY.md - Test coverage details
- SECURITY_SUMMARY.md - Security overview across projects
Project-Specific Documentation
Each project directory contains:
- README.md - Project-specific documentation
- SECURITY.md - Security best practices
- CONTRIBUTING.md - Contribution guidelines
- examples/ - Usage examples
- tests/ - Test files
MCP Protocol Implementation
Tool Response Format
# Success response
{
"content": [{"type": "text", "text": "Result data"}],
"isError": False
}
# Error response
{
"content": [{"type": "text", "text": "Error message"}],
"isError": True
}Common MCP Methods
tools/list- List all available toolstools/call- Execute a specific toolinitialize- Initialize MCP connectionping- Health check
Additional Resources
Platform Documentation
- Model Context Protocol
- pfSense Documentation
- TrueNAS Documentation
- Dell iDRAC Documentation
- Proxmox VE Documentation
Internal References
When making changes, always review:
- The project-specific README.md
- The SECURITY.md for security considerations
- Existing tests for patterns and examples
- Example scripts for usage patterns
Remember: This is infrastructure management software. Security and reliability are paramount. Always test thoroughly and follow security best practices.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

