kmransom56/fortinet-mcp-server
If you are the rightful owner of fortinet-mcp-server and would like to certify it and/or have it hosted online, please leave a comment on the right or send an email to dayong@mcphub.com.
A Model Context Protocol (MCP) server implementation for Fortinet FortiGate devices, providing seamless integration with AI assistants and development tools.
Fortinet MCP Server
A Model Context Protocol (MCP) server implementation for Fortinet FortiGate devices, providing seamless integration with AI assistants and development tools.
Overview
This MCP server enables AI assistants and development tools to interact with Fortinet FortiGate devices through a standardized protocol. It provides tools for device management, configuration, monitoring, and security operations.
Features
- Device Management: Connect to and manage multiple FortiGate devices
- Configuration Tools: View and modify device configurations
- Security Operations: Manage firewall rules, VPNs, and security policies
- Monitoring: Real-time device status and performance monitoring
- API Integration: RESTful API interface for FortiGate management
- Secure Authentication: Support for API tokens and certificate-based authentication
Prerequisites
- Python 3.8 or higher
- Fortinet FortiGate device(s) with API access enabled
- Network connectivity to FortiGate devices
Installation
- Clone the repository:
git clone https://github.com/yourusername/fortinet-mcp.git
cd fortinet-mcp
- Install dependencies:
pip install -r requirements.txt
- Configure your FortiGate devices:
- Enable REST API access on your FortiGate devices
- Generate API tokens or certificates for authentication
- Update the configuration file with device details
Configuration
- Copy the example configuration:
cp config.py config.local.py
- Edit
config.local.pywith your FortiGate device details:
FORTIGATE_DEVICES = {
'device1': {
'host': '192.168.1.1',
'port': 443,
'username': 'admin',
'api_token': 'your_api_token_here',
'verify_ssl': True
}
}
Usage
Starting the MCP Server
python fortinet_server.py
Using with AI Assistants
The MCP server can be integrated with various AI assistants that support the Model Context Protocol:
- Claude Desktop: Add the server to your MCP configuration
- Cursor: Configure as an MCP server in settings
- Other MCP-compatible tools: Follow the MCP specification
API Endpoints
The server provides the following main tools:
list_devices: List all configured FortiGate devicesget_device_status: Get real-time status of a deviceget_firewall_rules: Retrieve firewall rule configurationscreate_firewall_rule: Create new firewall rulesget_vpn_status: Check VPN tunnel statusget_system_info: Retrieve system information
Security Considerations
- Store API tokens and credentials securely
- Use HTTPS connections when possible
- Regularly rotate API tokens
- Limit API access to necessary permissions only
- Monitor API usage and access logs
Development
Project Structure
fortinet_mcp/
├── fortinet_server.py # Main MCP server implementation
├── config.py # Configuration management
├── fortinet_api_parse.py # FortiGate API utilities
├── app/ # Application modules
├── secrets/ # Secure credential storage
└── requirements.txt # Python dependencies
Contributing
- Fork the repository
- Create a feature branch:
git checkout -b feature-name - Make your changes and add tests
- Commit your changes:
git commit -am 'Add feature' - Push to the branch:
git push origin feature-name - Submit a pull request
License
This project is licensed under the MIT License - see the file for details.
Support
For support and questions:
- Create an issue on GitHub
- Check the documentation in the
docs/directory - Review Fortinet's official API documentation
Acknowledgments
- Fortinet for providing the FortiGate API
- The MCP community for the protocol specification
- Contributors and maintainers of this project
Changelog
v1.0.0
- Initial release
- Basic MCP server implementation
- FortiGate API integration
- Device management tools