AA

automateyournetwork/aci_mcp

开发工具

本页由 AI 翻译,技术细节请以原文为准。 查看原文

19 stars 12 forks 质量 48 趋势 22Apache-2.0

A Model Context Protocol Server for Cisco Application Centric Infrastructure (ACI) Application Policy Infrastructure Controller (APIC)

概览

A Model Context Protocol (MCP) server that provides full to the Cisco ACI API via structured natural language tools. This server exposes all relevant ACI endpoints from a configurable urls.json file and dynamically builds tools for read (GET) and write (POST) operations. Built on the FastMCP framework and fully compatible with LangGraph, Claude, ChatGPT, and VS Code Copilot for AI-assisted infrastructure operations. - ✅ Token-based Cisco APIC authentication - ✅ Full support for GET and POST (CRUD-ready with optional PUT, DELETE) - ✅ Support for ACI endpoints - ✅ Validates and auto-wraps APIC-compliant payloads - ✅ STDIO-compatible for use in Claude, VS Code, or LangGraph - ✅ Uses .env and structured logging - 🧠 Auto-discovers tool schema from JSON `bash ACI_MCP/ ├── aci_mcp/ │ ├── main.py # MCP server │ └── urls.json # Endpoints grouped by category ├── .env # Your secrets (APIC_URL, USERNAME, PASSWORD) ├── README.md # This file 🧪 Environment Variables Create a .

README

以下为原文 README 节选,完整内容请查看原文。

🚀 ACI FastMCP Server

A Model Context Protocol (MCP) server that provides full CRUD access to the Cisco ACI API via structured natural language tools. This server exposes all relevant ACI endpoints from a configurable urls.json file and dynamically builds tools for read (GET) and write (POST) operations.

Built on the FastMCP framework and fully compatible with LangGraph, Claude, ChatGPT, and VS Code Copilot for AI-assisted infrastructure operations.


🔧 Features

  • ✅ Token-based Cisco APIC authentication
  • ✅ Full support for GET and POST (CRUD-ready with optional PUT, DELETE)
  • ✅ Support for grouped and ungrouped ACI endpoints
  • ✅ Validates and auto-wraps APIC-compliant payloads
  • ✅ STDIO-compatible for use in Claude, VS Code, or LangGraph
  • ✅ Uses .env and structured logging
  • 🧠 Auto-discovers tool schema from JSON

📁 Folder Structure

ACI_MCP/
├── aci_mcp/
│   ├── main.py           # MCP server
│   └── urls.json         # Endpoints grouped by category
├── .env                  # Your secrets (APIC_URL, USERNAME, PASSWORD)
├── README.md             # This file
🧪 Environment Variables
Create a .env file in the root of your project:

env
Copy
Edit
APIC_URL=https://sandboxapicdc.cisco.com
USERNAME=admin
PASSWORD=!v3G@!4@Y
URLS_PATH=aci_mcp/urls.json
🚀 How to Run
🧑‍💻 In VS Code (Copilot / LangGraph):
Use the following JSON entry in your MCP client config:

json
Copy
Edit
"aci": {
  "type": "stdio",
  "command": "wsl",
  "args": [
    "env",
    "APIC_URL=https://sandboxapicdc.cisco.com",
    "USERNAME=admin",
    "PASSWORD=!v3G@!4@Y",
    "URLS_PATH=/home/johncapobianco/ACI_MCP/aci_mcp/urls.json",
    "python3",
    "/home/johncapobianco/ACI_MCP/aci_mcp/main.py"
  ]
}
This launches the MCP server inside WSL, using stdin/stdout for tool discovery and calling.

🤖 In Claude or any A2A-compatible agent:
Claude-compatible assistants can auto-discover tools using this STDIO-based server via Model Context Protocol.

📦 Tools Exposed
Grouped tools (e.g. BGP, L3, L2): one tool per group, with dynamic endpoint selection

Ungrouped tools: each endpoint gets its own:

GET tool (e.g. tenants_get)

POST tool (e.g. tenants_post)

🧠 Example Prompts
How many tenants are in my fabric?
Create a tenant named MCP_Tenant
Get all IP addresses
Show me BGP peers and Route Reflectors
Get the health status of the fabric
Post to /api/node/mo/uni/tn-NewTenant.json with status "created"

📄 Example POST Payload
json
Copy
Edit
{
  "fvTenant": {
    "attributes": {
      "name": "MCP_Tenant",
      "rn": "tn-MCP_Tenant",
      "status": "created"
    }
  }
}
Make sure you include "status": "created" and correct rn (e.g., tn-) for APIC to accept the POST.

📘 Extending It
You can easily extend this server:

Add more groups to urls.json

[
  {
    "Group": "L3",
    "Endpoints": [
      {
        "URL": "/api/node/class/l3extOut.json",
        "Name": "Layer 3 Out"
      },
在 GitHub 查看完整 README

安装

This server does not publish a one-line install command.

Open the repository installation guide 新手?先看 mcpskill.org 教程 →