fortinet-mcp-server

kmransom56/fortinet-mcp-server

3.1

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.

Tools
6
Resources
0
Prompts
0

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

  1. Clone the repository:
git clone https://github.com/yourusername/fortinet-mcp.git
cd fortinet-mcp
  1. Install dependencies:
pip install -r requirements.txt
  1. 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

  1. Copy the example configuration:
cp config.py config.local.py
  1. Edit config.local.py with 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 devices
  • get_device_status: Get real-time status of a device
  • get_firewall_rules: Retrieve firewall rule configurations
  • create_firewall_rule: Create new firewall rules
  • get_vpn_status: Check VPN tunnel status
  • get_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

  1. Fork the repository
  2. Create a feature branch: git checkout -b feature-name
  3. Make your changes and add tests
  4. Commit your changes: git commit -am 'Add feature'
  5. Push to the branch: git push origin feature-name
  6. 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

fortinet-mcp-server