Apic MCP Server 7eeb4d35

MCP运维云端

提供方 beletea

运维云端 stdio · 本地进程 Token 社区 / 第三方 Claude DesktopClaudeVS Code
查看接入方式

APIC-MCP-Server是一个基于Python的MCP服务器,用于管理和分析Cisco ACI(应用中心基础设施)结构,提供网络管理员和开发人员与Cisco APIC控制器交互、执行分析和生成详细报告的强大接口。

一句话选型结论

按资料字段整理

Apic MCP Server 7eeb4d35 属于运维云端类 MCP 服务器,stdio · 本地进程,Token,可直接接入 Claude Desktop、Claude、VS Code,有可直接执行的安装命令。接入前先确认权限范围;涉及写入、删除或付款的操作,建议先在测试环境验证。

分类运维云端 传输方式stdio · 本地进程 鉴权Token 部署方式本地部署
GitHub 星标 2 仓库热度,无公开仓库时显示未标注
工具数 23 暴露给模型的工具数量
资源 / 提示词 0 / 0 资源与提示词模板数量
维护方 社区 / 第三方 核验等级 仅资料核对

工具与能力

运维云端
数量来自来源目录的标注,具体工具清单以官方文档为准
工具数量23暴露给模型可调用的工具个数
资源数量0可读取的资源条目
提示词数量0内置提示词模板数量

能力标签

支持客户端

适用场景

网络管理Python本地部署CiscoACIAPIC控制器安全分析自动化报告

安装与配置

stdio · 本地进程 Token
客户端在本机拉起子进程,数据不出本机
pip install -r requirements.txt

这条命令只是入口,具体启动参数请按官方文档补齐,不要直接照搬到别的服务器。

  1. 1
    准备运行环境

    stdio 服务在本地起进程,需要先装好 Node.js 等运行时,再按安装命令拉取依赖。

  2. 2
    安装服务

    复制上面的安装命令执行;命令里带占位符的位置,换成自己的密钥或路径。

  3. 3
    写入客户端配置

    在客户端的 MCP 配置里填好启动命令和参数,保存后完全退出客户端再打开,让新配置生效。

  4. 4
    验证是否可用

    连接成功后客户端会列出约 23 个工具,随便调一个只读工具确认能返回结果。

典型使用场景

3 类
按分类与标签整理的常见用法,具体以官方文档为准
云资源查询

查实例、存储、账单等云上资源状态。

部署与发布

把部署、重启、回滚这类操作接进对话。

监控与告警

拉取监控指标,异常时让模型帮你判断。

选择建议

选之前先看这几条
按条目字段给出的判断,不替你决定用不用

值得选的地方

  • 资料标注 23 个工具,覆盖面较广,能满足多种调用。
  • 有现成的安装命令,不用自己找入口,照着跑就能起服务。
  • 已适配 Claude Desktop、Claude、VS Code,换客户端不用重新研究配置。

先想清楚的地方

  • stdio 方式要求本地装好运行时(如 Node.js),换机器要重新装一遍。
  • 使用前要准备好Token对应的凭据,并按最小权限配置。
  • 版本更新与行为细节以官方仓库为准。

更适合

  • 需要在运维云端场景里让模型直接调用外部能力的人。
  • 已经在用 Claude Desktop、Claude 的用户,接入路径最短。
  • 想先快速试一下、能接受在本地或自有环境跑服务的人。

不太适合

  • 完全不想在本地装环境的人。
  • 不方便管理密钥或第三方授权的人。
  • 需要厂商级 SLA 和技术支持的生产环境。

同类对比

6 个同类
同分类里挑最接近的几条,字段以各自详情页为准
MCP 服务器工具数传输方式部署方式安装命令最后核验
Apic MCP Server 7eeb4d35当前 23 stdio · 本地进程 本地部署 有 2026-05-17
lobehub 未标注 stdio · 本地进程 本地部署 有 2026-04-11
TrendRadar 未标注 stdio · 本地进程 本地部署 有 2026-04-13
Ui Tars Desktop 8a825770 未标注 stdio · 本地进程 本地部署 有 2026-05-17
ruflo 未标注 stdio · 本地进程 本地部署 有 2026-04-13
FastGPT 未标注 stdio · 本地进程 本地部署 有 2026-04-11

服务器档案

运维云端
字段来自项目仓库与公开索引,中文说明由本站标注
提供方beletea上游标注的维护方 beletea
分类运维云端本站按上游分类展示
连接方式stdio · 本地进程客户端在本机拉起子进程,数据不出本机
鉴权方式Token远程服务建议用最小权限凭据
维护方社区 / 第三方核验等级 仅资料核对
包名 / 运行时未标注 · 未标注本地安装时用到的包标识与运行时
部署类型本地部署上游给出的部署形态
最近核验2026-05-17上游最后核验时间

详细介绍

18.9 KB
来自项目仓库与上游目录的原文,未做删改

Authentication

Authentication to the APIC is always performed using credentials from the .env file. The authenticate_apic MCP tool ignores any arguments passed to it and will only use the following environment variables:```
APIC_URL=https://apic.example.com
APIC_USERNAME=admin
APIC_PASSWORD=mypassword
APIC_VERIFY_SSL=false

Make sure your `.env` file is present in the project root and contains the correct values. use `.env.template` as a reference. Arguments to the `authenticate_apic` function are ignored.

Example usage:```python
authenticate_apic()

This will always use the credentials from .env.

APIC-MCP-Server

A comprehensive Model Context Protocol (MCP) server for managing and analyzing Cisco ACI (Application Centric Infrastructure) fabrics. This tool provides a powerful interface for network administrators and developers to interact with Cisco APIC controllers, perform analysis, and generate detailed reports.

🚀 What is APIC-MCP-Server?

The APIC-MCP-Server is a Python-based MCP server and it provides:

  • 🔌 Direct APIC Integration: Seamless authentication and communication with Cisco APIC controllers
  • 📊 Comprehensive Analysis: Detailed tenant, EPG, BD, VRF, and security policy analysis
  • 🔍 Security Monitoring: Contract deny logging, vulnerability checking via PSIRT API
  • 📋 Documentation Generation: Automated document generation for infrastructure reports
  • ⚡ Fabric Monitoring: Fabric health monitoring and troubleshooting capabilities

🏗️ Architecture Overview```

┌─────────────────┐ ┌─────────────────┐ ┌─────────────────┐
│ Client Apps │ │ APIC-MCP-Server │ │ Cisco APIC │
│ │ │ │ │ Controllers │
│ • VS Code │◄──►│ • FastMCP │◄──►│ │
│ • Claude │ │ • Authentication │ │ • REST API │
│ • Custom Tools │ │ • Analysis Tools │ │ • Policy Data │
└─────────────────┘ └─────────────────┘ └─────────────────┘
│
▼
┌─────────────────┐
│ External APIs │
│ │
│ • Cisco PSIRT │
│ • Field Notices │
│ • Vulnerability │
│ Database │
└─────────────────┘


## 📦 Components

### Core Components

#### 1. **apic_mcp_server.py** (Main Server)
- **FastMCP Framework**: Primary MCP server implementation
- **20+ Tools**: Comprehensive set of APIC management tools
- **Document Generation**: Creates professional reports

#### 2. **auth_utils.py** (Authentication)
- **APIC Authentication**: Secure JWT token management
- **Session Management**: Persistent connection handling
- **Error Handling**: Robust authentication error recovery

### Configuration Files

#### 3. **.env.template** (Environment Template)
- **Environment Setup**: Template for environment variables
- **APIC Configuration**: Connection settings and credentials
- **Security**: PSIRT API configuration for vulnerability checking

#### 4. **.vscode/** (VS Code Integration)
- **MCP Configuration**: VS Code MCP server settings
- **Development Setup**: IDE configuration for development```bash
# APIC Connection Settings
APIC_URL=https://your-apic.example.com
APIC_USERNAME=admin
APIC_PASSWORD=your-password
APIC_VERIFY_SSL=false

# PSIRT API Settings (Optional)
MY_PSIRT_API_URL=https://api.cisco.com/security/advisories
MY_PSIRT_CLIENT_ID=your-client-id
MY_PSIRT_CLIENT_SECRET=your-client-secret

🛠️ Available Tools

Authentication & Status

  • authenticate_apic() - Authenticate to APIC controller
  • get_apic_status() - Check current session status
  • logout_apic() - Logout and cleanup session

Fabric Discovery

  • get_tenants() - List all tenants
  • get_fabric_nodes() - List fabric switches and controllers
  • search_objects_by_name() - Search for specific objects

Tenant Management

  • get_application_profiles() - List application profiles
  • get_epgs() - List endpoint groups
  • get_bridge_domains() - List bridge domains
  • get_vrfs() - List VRFs
  • get_contracts() - List security contracts

Security Analysis

  • get_denied_logs_for_tenant() - Check audit violations
  • get_contract_denies_for_tenant() - Analyze contract denies
  • get_contract_permit_logs_for_tenant() - Review permitted traffic

External Connectivity

  • fetch_apic_class() - Generic APIC class queries
  • get_node_interface_status() - Interface operational status

Security Intelligence

  • verify_apic_vulnerability() - Check APIC vulnerabilities
  • check_cisco_aci_switches_psirt() - PSIRT advisory lookup
  • get_apic_field_notices() - APIC field notices
  • get_nexus_9000_field_notices() - Switch field notices

Documentation

  • create_tenant_analysis_document() - Generate reports

⚠️ Dangerous Operations

  • create_apic_object() - Create an APIC object in the fabric
  • delete_apic_object() - Delete an APIC object from the fabric

Warning: These tools perform changes directly on your Cisco ACI fabric. Creating or deleting objects can disrupt production environments, cause outages, or result in data loss. Always double-check your parameters and use these tools only if you understand the impact. It is recommended to test in a non-production environment first.

Confirmation Workflow for Create/Delete Actions

For all dangerous operations (such as creating or deleting APIC objects), the MCP server enforces a confirmation workflow:

  • Preview Step: When you request a create or delete action (e.g., creating a tenant or deleting an EPG), the server will first show you a preview of what will be pushed or deleted. This includes the full payload or distinguished name (DN) of the object.
  • Explicit Confirmation Required: The operation will only proceed if you explicitly confirm (e.g., by replying "yes" or confirming in the UI). If you do not confirm, the action is cancelled and no changes are made.
  • Safety: This workflow helps prevent accidental changes and ensures you have a chance to review all destructive or impactful actions before they are executed.

Example: Creating a Tenant```python

Request to create a tenant

result = create_apic_object(parent_dn="uni", object_payload={"fvTenant": {"attributes": {"name": "mcp-server"}}}, confirm=False)

You will receive a preview and must confirm before proceeding

if result["status"] == "pending":
# Review the payload, then confirm
result = create_apic_object(parent_dn="uni", object_payload={"fvTenant": {"attributes": {"name": "mcp-server"}}}, confirm=True)


#### Example: Deleting a Tenant```python
# Request to delete a tenant
result = delete_apic_object(object_dn="uni/tn-mcp-server", confirm=False)
# You will receive a preview and must confirm before proceeding
if result["status"] == "pending":
    # Review the DN, then confirm
    result = delete_apic_object(object_dn="uni/tn-mcp-server", confirm=True)

This confirmation workflow applies to all create and delete operations exposed by the MCP server.


🚀 Getting Started

Prerequisites

  • Python 3.12+ for best compatibility
  • Access to Cisco APIC controller
  • Network connectivity to APIC management interface
  • VS Code (for VS Code integration) or Claude Desktop (for Claude integration)

Installation

  1. Clone the Repository```bash
    git clone <your-repo-url>
    cd <your-project-directory>

2. **Install Dependencies**```bash
# Install all dependencies
pip install -r requirements.txt

The requirements.txt includes:

  • fastmcp (core MCP server framework)
  • requests (HTTP client)
  • python-dotenv (environment variable management)
  • beautifulsoup4 (HTML parsing)
  • python-docx (Word document generation)
  • uvicorn (optional, async server)

pytest, flake8 (optional, for testing/linting)

  1. Configure Environment```bash

Copy and edit environment file

cp .env.template .env

Edit .env with your APIC and credentials

PSIRT client id and client secret are optional but recommended for security analysis


Edit the `.env` file with your APIC details:```bash
# APIC Connection Settings
APIC_URL=https://your-apic.example.com
APIC_USERNAME=admin
APIC_PASSWORD=your-password
APIC_VERIFY_SSL=false

# PSIRT API Settings (Optional)
MY_PSIRT_API_URL=https://api.cisco.com/security/advisories
MY_PSIRT_CLIENT_ID=your-client-id
MY_PSIRT_CLIENT_SECRET=your-client-secret

🔧 MCP Client Configuration

Option 1: VS Code Integration

  1. Install the MCP Extension
    - Install the "Model Context Protocol" extension in VS Code
    - Or install "Claude Dev" extension which supports MCP

  2. Configure MCP Server

Create or update your VS Code .vscode/mcp.json:json { &quot;servers&quot;: { &quot;cisco-aci-apic&quot;: { &quot;command&quot;: &quot;uv&quot;, &quot;args&quot;: [ &quot;run&quot;, &quot;--with&quot;, &quot;mcp&quot;, &quot;mcp&quot;, &quot;run&quot;, &quot;&lt;path-to-your-apic_mcp_server.py&gt;&quot; ] } } }
Replace ` with the full path to yourapic_mcp_server.py` file.```

  1. Restart VS Code and the MCP server will be available in your VS Code environment.

Option 2: Claude Desktop Integration

  1. Locate or create Claude Desktop Config
    ```bash
    # macOS
    ~/Library/Application Support/Claude/claude_desktop_config.json

# Windows
%APPDATA%\Claude\claude_desktop_config.json

# Linux
~/.config/Claude/claude_desktop_config.json```

  1. Add MCP Server Configuration

Edit claude_desktop_config.json:
json { &quot;mcpServers&quot;: { &quot;cisco-aci-apic&quot;: { &quot;command&quot;: &quot;uv&quot;, &quot;args&quot;: [ &quot;run&quot;, &quot;--with&quot;, &quot;mcp&quot;, &quot;mcp&quot;, &quot;run&quot;, &quot;&quot; ] } } }
Replace &lt;full-path-to-your-apic_mcp_server.py&gt; with the full path to your apic_mcp_server.py file.
If you encounter issues with the project path, you may need to adjust the path accordingly, like this:
json { &quot;mcpServers&quot;: { &quot;cisco-aci-apic&quot;: { &quot;command&quot;: &quot;&quot;, &quot;args&quot;: [ &quot;run&quot;, &quot;--project&quot;, &quot;&quot;, &quot;python&quot;, &quot;&quot; ] } } }

Replace &lt;full-path-to-your-uv&gt; with the full path to your uv executable, and &lt;full-path-to-your-apic_mcp_server&gt;
with the directory containing your apic_mcp_server.py.

  1. Restart Claude Desktop and the APIC tools will be available in your conversations.

🧪 Testing Your Setup

  1. Test Environment Variables
# Verify your .env file is loaded correctly
python -c &quot;
import os
from dotenv import load_dotenv
load_dotenv()
print(f&#x27;APIC URL: {os.getenv(\&quot;APIC_URL\&quot;)}&#x27;)
print(f&#x27;Username: {os.getenv(\&quot;APIC_USERNAME\&quot;)}&#x27;)
&quot;
# Ensure APIC URL and credentials are correct```

2. **Test MCP Server**
```bash
# Verify MCP server is running
curl -X GET http://localhost:5000/mcp/status```bash
# Basic import test
python -c &quot;
from apic_mcp_server import mcp
print(&#x27;✅ MCP Server loaded successfully&#x27;)
&quot;
  1. Test APIC Connectivity```bash

Test network connectivity to your APIC

curl -k https://your-apic.example.com/api/class/topSystem.json


### 🎯 Using the APIC-MCP Server

Once configured with VS Code or Claude Desktop, you can use natural language to interact with your ACI fabric:

#### **In VS Code with MCP Extension:**```
Ask: &quot;Show me all tenants in my ACI fabric&quot;
Ask: &quot;List EPGs in the &#x27;Production&#x27; tenant&quot;
Ask: &quot;Check for contract denies in tenant &#x27;Production&#x27;&quot;
Ask: &quot;Generate a security analysis report for tenant &#x27;DMZ&#x27;&quot;

In Claude Desktop:```

Ask: "Authenticate to my APIC and show fabric health"
Ask: "What bridge domains exist in tenant 'Web-Services'?"
Ask: "Check PSIRT advisories for my ACI switches"
Ask: "Generate a report analyzing the 'Database' tenant"


## 💡 Usage Examples

### Basic Tenant Analysis```python
# Get tenant overview
tenants = get_tenants(include_children=True)

# Analyze networking
bridge_domains = get_bridge_domains(tenant_name=&quot;MyTenant&quot;)
vrfs = get_vrfs(tenant_name=&quot;MyTenant&quot;)

# Security analysis
contracts = get_contracts(tenant_name=&quot;MyTenant&quot;)
denies = get_contract_denies_for_tenant(tenant_name=&quot;MyTenant&quot;)

Security Monitoring```python

Check for contract violations

denies = get_contract_denies_for_tenant("production")
if denies['deny_count'] > 0:
print(f"Found {denies['deny_count']} security violations")

PSIRT vulnerability check

psirt_result = verify_apic_vulnerability()
aci_advisories = check_cisco_aci_switches_psirt("5.2(3e)")


### Documentation Generation```python
# Generate comprehensive tenant report
analysis_content = &quot;&quot;&quot;
# Tenant Analysis Results
... (analysis content)
&quot;&quot;&quot;

doc_result = create_tenant_analysis_document(
    analysis_content=analysis_content,
    tenant_name=&quot;Production&quot;,
    output_filename=&quot;production_analysis&quot;
)

🔧 Development Guide

Project Structure```

<your-project-directory>/
├── apic_mcp_server.py # Main MCP server with 60+ tools
├── auth_utils.py # APIC authentication utilities
├── .env.template # Environment template file
├── README.md # Project documentation
├── requirements.txt # Project dependencies
├── LICENSE # Project license
└── .vscode/ # VS Code configuration (you need to create this folder for VS Code integration)
├── mcp.json # MCP server configuration

### Adding New Tools

1. **Define the Tool Function**```python
@mcp.tool()
def my_new_tool(parameter1: str, parameter2: Optional[int] = None) -&gt; Dict[str, Any]:
    &quot;&quot;&quot;
    Description of what this tool does.

    :param parameter1: Description of parameter1
    :param parameter2: Optional description of parameter2
    :return: Dictionary with results
    &quot;&quot;&quot;
    try:
        authenticator = get_authenticator()

        if not authenticator.token:
            return {
                &quot;status&quot;: &quot;error&quot;,
                &quot;message&quot;: &quot;Not authenticated. Please authenticate first.&quot;
            }

        # Your tool logic here
        result = authenticator.make_authenticated_request(&quot;/api/your-endpoint.json&quot;)

        return {
            &quot;status&quot;: &quot;success&quot;,
            &quot;data&quot;: result
        }

    except Exception as e:
        return {
            &quot;status&quot;: &quot;error&quot;,
            &quot;message&quot;: f&quot;Tool failed: {str(e)}&quot;
        }
  1. Add Error Handling
    - Always check authentication status
    - Use try-catch blocks for API calls
    - Return consistent response format
    - Log errors appropriately

  2. Document the Tool
    - Add clear docstrings
    - Include parameter descriptions
    - Provide usage examples
    - Update this README

Code Style Guidelines

  • PEP 8 Compliance: Follow Python coding standards
  • Type Hints: Use type annotations for all functions
  • Error Handling: Implement comprehensive error handling
  • Documentation: Document all functions and classes
  • Logging: Use appropriate logging levels

Testing```bash

Run basic functionality test

python -c "
import asyncio
from apic_mcp_server import mcp

async def test():
print('MCP Server loaded successfully')

asyncio.run(test())
"


## 🐛 Troubleshooting

### Common Issues

#### 1. **Authentication Failures**```
Error: &quot;Authentication failed: Invalid credentials&quot;

Solutions:
- Verify APIC URL is correct and accessible
- Check username/password in .env file
- Ensure APIC certificate is trusted (set VERIFY_SSL=false for testing)
- Check network connectivity to APIC management interface

2. SSL Certificate Issues```

Error: "SSL: CERTIFICATE_VERIFY_FAILED"

**Solutions:**```bash
# Temporary fix for testing
export PYTHONHTTPSVERIFY=0

# Or set in .env
APIC_VERIFY_SSL=false

3. Module Import Errors```

Error: "ModuleNotFoundError: No module named 'mcp'"

**Solutions:**```bash
# Install missing dependencies
pip install -r requirements.txt

# Or using uv
uv pip install -r requirements.txt

# Verify installation
python -c &quot;import mcp; print(&#x27;MCP installed successfully&#x27;)&quot;

4. APIC API Timeouts```

Error: "Request timeout"

**Solutions:**
- Check network latency to APIC
- Verify APIC is not overloaded
- Increase timeout in auth_utils.py
- Check firewall rules

#### 5. **Permission Denied**```
Error: &quot;Insufficient privileges&quot;

Solutions:
- Verify user has appropriate APIC privileges
- Check user role assignments
- Use admin account for testing
- Review RBAC policies

Debug Mode

Enable debug logging:```python
import logging
logging.basicConfig(level=logging.DEBUG)


### Environment Validation```bash
# Check Python version
python --version  # Should be 3.12+ for best compatibility

# Verify dependencies
pip list | grep -E &quot;(requests|mcp|fastmcp)&quot;

# Test APIC connectivity
curl -k https://your-apic.com/api/aaaLogin

Performance Tuning

  • Connection Pooling: Reuse APIC sessions
  • Caching: Cache frequently accessed data
  • Pagination: Use pagination for large datasets
  • Filtering: Apply server-side filtering when possible

Logs and Monitoring```python

Enable detailed logging

import logging
logging.basicConfig(
level=logging.INFO,
format='%(asctime)s - %(name)s - %(levelname)s - %(message)s'
)


## 🤝 Contributing

### How to Contribute

1. **Fork the Repository**
2. **Create Feature Branch with descriptive name**```bash
   git checkout -b feature/new-feature
   ```
3. **Make Changes**
   - Follow code style guidelines
   - Add comprehensive tests
   - Update documentation
4. **Commit Changes**```bash
   git commit -m &quot;Add new feature&quot;
   ```
5. **Push to Branch**```bash
   git push origin feature/new-feature
   ```
6. **Open Pull Request**

### Development Setup```bash
# Clone your fork
git clone https://github.com/yourusername/mcp-server.git
cd mcp-server

# Install development dependencies
pip install -r requirements.txt
pip install black flake8 pytest

Areas for Contribution

  • New APIC Tools: Add support for additional APIC classes / use cases
  • Enhanced Analysis: Improve fabric object analysis algorithms
  • Documentation: Improve examples and tutorials
  • Testing: Add comprehensive test suite
  • Performance: Optimize API calls and caching

📝 License

This project is licensed under the MIT License - see the LICENSE file for details.

🆘 Support

  • Issues: GitHub Issues
  • Documentation: This README and inline code comments

🔗 Related Resources

  • Cisco ACI Documentation
  • MCP Protocol Specification
  • FastMCP Framework
  • Cisco PSIRT API

Made with ❤️ for network automation and ACI management

常见问题

8 问
答案由本站依据条目字段整理,不引用上游原文
Apic MCP Server 7eeb4d35 怎么安装?

在客户端按下面的安装命令接入:pip install -r requirements.txt。装完在客户端配置里引用同一个包或端点。

Apic MCP Server 7eeb4d35 怎么在 Claude Desktop、Claude、VS Code 里配置?

它的传输方式是stdio · 本地进程,在客户端的 MCP 配置里填好启动命令和参数,保存后完全退出客户端再打开,配置才会生效。

Apic MCP Server 7eeb4d35 收费吗?

本站不代收费用,也没有标注具体价格。是否收费取决于服务本身和背后的接口额度,正式使用前按官方说明确认。

Apic MCP Server 7eeb4d35 需要 API Key 吗?

资料标注需要Token认证,使用前准备好对应凭据,并按最小权限配置。

Apic MCP Server 7eeb4d35 支持哪些客户端?

资料标注支持 Claude Desktop、Claude、VS Code;其他客户端只要能配置 MCP Server,也能用同样的命令或地址接入。

Apic MCP Server 7eeb4d35 能提供哪些能力?

资料显示约 23 个工具;能力标签包括 网络管理、安全分析、Python、Claude。具体工具清单以官方文档为准。

Apic MCP Server 7eeb4d35 需要什么运行环境?

属于本地进程,需要在本机装好运行环境。

Apic MCP Server 7eeb4d35 是本地还是远程?

它是本地进程(stdio),由客户端在本机拉起。传输方式为stdio · 本地进程。

热门专题

按标签挑服务器
全部专题 →

服务器信息以作者仓库与官方文档为准;分类、传输方式与鉴权方式的中文说明为中文整理,最近核验 2026-05-17。