FR

f5-rahm/f5-mcp

Developer tools

Эта страница переведена автоматически. Технические детали смотрите в оригинале. Открыть оригинал

6 stars 3 forks Качество 68 Тренд 14Apache-2.0

AI Step-by-Step docker compose project for testing mcpo and mcp

Обзор

A Model Context Protocol (MCP) server for F5 BIG-IP devices, served through mcpo. This setup provides AI assistants with the ability to query F5 BIG-IP objects like pools, nodes, virtual servers, and other LTM components. This repository contains: - : A FastMCP-based server that provides tools for querying F5 BIG-IP devices - : Configuration to serve the MCP server through mcpo for easy integration with AI clients - : Complete containerized environment for both components - Docker and Docker Compose - F5 BIG-IP device with REST API access - Network connectivity between the containers and your F5 device 3. Create f5mcp/.env file with F5 credentials: Create .env file in the main directory with mcpo API key: 4. : The docker-compose.yml should be configured to use the main .env file for the mcpo service. If needed, add env_file: .env to the mcpo service definition.

README

Показан фрагмент оригинального README. Открыть оригинал.

F5 MCP Server with mcpo

A Model Context Protocol (MCP) server for F5 BIG-IP devices, served through mcpo. This setup provides AI assistants with the ability to query F5 BIG-IP objects like pools, nodes, virtual servers, and other LTM components.

Overview

This repository contains:

  • F5 MCP Server: A FastMCP-based server that provides tools for querying F5 BIG-IP devices
  • mcpo Integration: Configuration to serve the MCP server through mcpo for easy integration with AI clients
  • Docker Setup: Complete containerized environment for both components

Prerequisites

  • Docker and Docker Compose
  • F5 BIG-IP device with REST API access
  • Network connectivity between the containers and your F5 device

Quick Start

  1. Clone and prepare the environment:

    git clone https://github.com/f5-rahm/f5-mcp
    cd f5-mcp
    
  2. Create the external Docker network:

    docker network create labnet
    
  3. Configure environment variables:

    Create f5mcp/.env file with F5 credentials:

    F5_HOST=192.168.1.100
    F5_USER=admin
    F5_PASS=your-password
    

    Create .env file in the main directory with mcpo API key:

    MCPO_API_KEY=your-mcpo-api-key-here
    
  4. Start the services:

    docker-compose up -d
    

    Note: The docker-compose.yml should be configured to use the main .env file for the mcpo service. If needed, add env_file: .env to the mcpo service definition.

Project Structure

.
├── f5mcp/
│   ├── Dockerfile
│   ├── main.py                 # MCP server implementation
│   ├── requirements.txt
│   └── .env                   # F5 credentials (create this)
├── docker-compose.yml         # Service definitions
├── mcpo-config.json          # mcpo configuration
├── .env                      # mcpo API key (create this)
└── README.md

Testing the MCP Server

1. Direct HTTP Testing

Test the MCP server directly using curl or any HTTP client:

Initialize a session:

curl -X POST http://localhost:8081/mcp \
  -H "Content-Type: application/json" \
  -H "Accept: application/json, text/event-stream" \
  -d '{
    "jsonrpc": "2.0",
    "id": 1,
    "method": "initialize",
    "params": {
      "protocolVersion": "2024-11-05",
      "capabilities": {
        "tools": {}
      },
      "clientInfo": {
        "name": "test-client",
        "version": "1.0.0"
      }
    }
  }'

List available tools:

curl -X POST http://localhost:8081/mcp \
  -H "Content-Type: application/json" \
  -H "Accept: application/json, text/event-stream" \
  -d '{
    "jsonrpc": "2.0",
    "id": 2,
    "method": "tools/list",
    "params": {}
  }'

Test the obj_list tool:

# List all pools
curl -X POST http://localhost:8081/mcp \
  -H "Content-Type: application/json" \
  -H "Accept: application/json, text/event-stream" \
  -d '{
    "jsonrpc": "2.0",
    "id": 3,
    "method": "tools/call",
    "params": {
Открыть полный README на GitHub

Установка

docker run --rm --network labnet curlimages/curl:latest \
Новичок в MCP? Начните с руководства на mcpskill.org →

Конфигурация

{ "mcpServers": { "f5mcp": { "type": "streamable-http", "url": "http://f5mcp:8081/mcp", "headers": { "Content-Type": "application/json", "Accept": "application/json, text/event-stream" } } } }