Provides tools for interacting with Cisco Catalyst Center APIs, enabling management and monitoring of Cisco network infrastructure through automatically parsed API endpoints from Swagger/OpenAPI definitions.
Provides containerized deployment of the MCP server through Docker, with configuration files and scripts for building and running the server.
Uses .env files for configuration management, storing API credentials and server settings for the MCP implementation.
Uses FastAPI to create the server endpoints that expose the MCP protocol interfaces for tool discovery and execution.
Enables LangChain agents to use Cisco Catalyst Center APIs as tools through the MCP protocol, with example client code demonstrating integration.
Integrates with OpenAI API for AI agent functionality, requiring an API key for authentication and operation with the MCP server.
Automatically parses Swagger/OpenAPI JSON files to extract API endpoints as tools, providing a standardized way to expose these endpoints to AI agents.
MCP Server for Cisco Catalyst Center APIs
This project implements a Model Context Protocol (MCP) server that wraps the Cisco Catalyst Center APIs defined in a Swagger JSON file. The MCP server allows you to use these APIs as tools within AI agents built with LangChain or any other framework supporting the Model Context Protocol.
Features
- Automatically parses Swagger/OpenAPI JSON to extract API endpoints as tools
- Implements the Model Context Protocol for tool discovery and execution
- Provides a FastAPI server to expose the tools via MCP
- Includes authentication with the Cisco Catalyst Center API
- Example client to demonstrate using the MCP server with LangChain
Prerequisites
- Python 3.9 or higher
- Cisco Catalyst Center with API access
- OpenAI API key
Setup
- Clone the repository and navigate to the project directory:
- Install the required dependencies:
- Configure the environment variables:
Edit the .env
file with your configuration details:
Running the MCP Server
Option 1: Running Directly
Start the MCP server directly with:
Option 2: Running with Docker (Recommended)
The server can also be run as a Docker container, which ensures consistent environments and easier deployment.
- Make sure Docker and Docker Compose are installed on your system.
- Run the Docker container:
This script will build the Docker image and start a container. The server will be available at http://localhost:8000.
API Endpoints
GET /
: Health check endpointPOST /mcp/tools
: Get available tools in MCP formatPOST /mcp/execute_tool/{tool_name}
: Execute a specific tool with parameters
Using with LangChain
The project includes an example client (example_client.py
) that demonstrates how to use the MCP server with LangChain.
Run the example client with:
The client will fetch the available tools from the MCP server and create a LangChain agent that can use these tools.
Project Structure
server.py
: Main FastAPI server implementing the MCPswagger_parser.py
: Parser for Swagger/OpenAPI JSON filesapi_client.py
: Client for making requests to Cisco APIstool_handler.py
: Handler for MCP tools that wrap API endpointscustom_tools.py
: Implementation of custom tools that combine multiple API callsconfig.py
: Configuration moduleexample_client.py
: Example client using LangChainDockerfile
: Configuration for building the Docker imagedocker-compose.yml
: Docker Compose configuration for servicesrun_docker.sh
: Script to build and run the Docker container
MCP Integration
This server implements the Model Context Protocol (MCP) for AI agents. The MCP defines a standardized way for AI models to discover and use tools.
The key components of MCP integration are:
- Tool Discovery: The
/mcp/tools
endpoint returns tool schemas in the MCP format. - Tool Execution: The
/mcp/execute_tool/{tool_name}
endpoint executes tools and returns results.
Customization
You can customize the MCP server by:
- Modifying the
SwaggerParser
to handle different Swagger/OpenAPI formats - Extending the
ApiClient
to add authentication methods or error handling - Adding new endpoints to the FastAPI server
- Creating custom tools in the
custom_tools.py
file that combine multiple API calls for advanced functionality
Custom Tools
The server includes a custom_tools.py
module that demonstrates how to create custom tools that combine multiple API calls. These tools can provide higher-level functionality that is not directly exposed by the API.
Currently implemented custom tools:
network_health_report
: Generates a comprehensive network health report by combining data from multiple API endpoints
Troubleshooting
- If authentication fails, check your Cisco API credentials in the
.env
file - If tool execution fails, check the logs for more detailed error messages
- If parsing fails, ensure your Swagger JSON is valid and follows the OpenAPI 3.0.x format
Docker-specific troubleshooting
- If the Docker container fails to start, check Docker logs:
docker-compose logs -f
- If the container can't access the Swagger file, ensure the context path in docker-compose.yml is correct
- To rebuild the Docker image completely:
docker-compose down && docker-compose build --no-cache && docker-compose up -d
- To enter the running container for debugging:
docker exec -it mcp-server bash
License
MIT
This server cannot be installed
remote-capable server
The server can be hosted and run remotely because it primarily relies on remote services or has no dependency on the local environment.
A server that wraps Cisco Catalyst Center APIs into tools accessible via the Model Context Protocol, allowing AI agents to discover and execute network management operations.
Related MCP Servers
- AsecurityAlicenseAqualityA Model Context Protocol server that enables AI agents to interact with 30+ Ethereum-compatible blockchain networks, providing services like token transfers, contract interactions, and ENS resolution through a unified interface.Last updated -2894146TypeScriptMIT License
- -securityFlicense-qualityA Model Context Protocol server that provides a comprehensive interface for interacting with the ConnectWise Manage API, simplifying API discovery, execution, and management for both developers and AI assistants.Last updated -462Python
- -securityAlicense-qualityA Model Context Protocol server that allows AI tools to connect to and interact with your Directus API, enabling automated access to collections, items, and user data.Last updated -6915TypeScriptMIT License
Plane MCP Serverofficial
AsecurityAlicenseAqualityA Model Context Protocol server that enables AI interfaces to seamlessly interact with Plane's project management system, allowing management of projects, issues, states, and other work items through a standardized API.Last updated -464323TypeScriptMIT License