afc-mcp
Provides read-only access to Aruba Fabric Composer inventory, network state, and VMware vCenter/vSphere visibility through MCP tools over streamable HTTP.
README
afc-mcp
MCP server for Aruba Fabric Composer (AFC) focused on inventory, network state and VMware vCenter/vSphere visibility. Read-only.
Included
server.py: FastMCP entrypoint exposing the MCP tools (transport: streamable-http).afc_client.py: AFC API client with auth token handling and mapped read-only endpoints.Dockerfile: container image for the MCP server.docker-compose.yml: local runtime (host port8010→ container8000)..env.example: environment variable template.
Quick start
- Create env file:
cp .env.example .env
- Fill at least:
AFC_BASE_URL(host root without/api, e.g.https://afc.example.local)AFC_USERNAMEAFC_PASSWORDAFC_VERIFY_SSL(optional, defaultfalse)AFC_TIMEOUT(optional, default30)
- Build and run:
docker compose up --build -d
- Check logs:
docker compose logs -f
Endpoint
The server speaks MCP over streamable-HTTP:
URL: http://<docker-host>:8010/mcp
By default the endpoint is open. You can enable Bearer-token authentication so only clients presenting a valid token can call the tools (see below).
Authentication (Bearer token)
Authentication is optional and disabled by default (backward compatible).
When enabled, every MCP request must carry an Authorization: Bearer <token>
header; requests without a valid token are rejected with 401.
Tokens are named (one per client) and stored in secrets/.tokens (git-ignored,
mounted read-write into the container).
- Create the first token (run on the host or inside the container):
# on the host (stdlib only, no dependencies needed)
cd afc-mcp
python afc_token_manager.py generate --name "vscode-dev" --description "Laptop VSCode"
# ...or inside the running container
docker compose exec afc-mcp python afc_token_manager.py generate --name "vscode-dev"
The command prints the clear-text token once — copy it now.
- Enable auth and (re)start the server:
# in .env or the shell environment
AFC_AUTH_ENABLED=true
docker compose up -d --build
Safety net: if
AFC_AUTH_ENABLED=truebut no token exists yet, the server starts in LOCKED mode and refuses every request (503) until a token is created and the container restarted. This prevents accidentally exposing an open endpoint.
Manage tokens with the CLI:
python afc_token_manager.py list # masked preview
python afc_token_manager.py show --name vscode-dev # reveal a value
python afc_token_manager.py revoke --name vscode-dev
Revoking or adding a token requires a container restart to take effect.
Note:
MCP_HOST/MCP_PORTonly control where the server listens inside the container (0.0.0.0:8000, mapped to host8010). They are unrelated to authentication — they say where the server listens, not who may call it.
Integrate with VS Code
VS Code (with GitHub Copilot / agent mode) discovers MCP servers from an mcp.json file.
- Create
.vscode/mcp.jsonin your workspace (or add to your usermcp.json):
{
"servers": {
"afc-mcp": {
"type": "http",
"url": "http://localhost:8010/mcp"
}
}
}
Replace
localhostwith the Docker host address if the container runs elsewhere.If authentication is enabled, add the Bearer token as a header:
{ "servers": { "afc-mcp": { "type": "http", "url": "http://localhost:8010/mcp", "headers": { "Authorization": "Bearer afc_xxxxxxxx" } } } }
- Open the Command Palette → MCP: List Servers, select
afc-mcpand start it. - In the Chat view (Agent mode), the AFC tools become available under the tools picker.
Integrate with Claude Desktop
Claude Desktop connects to local (stdio) servers by default. To reach this
streamable-HTTP server, bridge it with mcp-remote.
Edit claude_desktop_config.json:
- macOS:
~/Library/Application Support/Claude/claude_desktop_config.json - Windows:
%APPDATA%\Claude\claude_desktop_config.json
{
"mcpServers": {
"afc-mcp": {
"command": "npx",
"args": ["-y", "mcp-remote", "http://localhost:8010/mcp"]
}
}
}
Restart Claude Desktop; afc-mcp appears in the tools menu.
Alternatively, recent Claude Desktop builds support remote MCP servers directly under Settings → Connectors → Add custom connector using the same URL.
Available MCP tools
Server & system
get_server_status— MCP server reachability/health.get_system_info— AFC system information.
Switches & fabrics
list_switches,get_switch— switch inventory and per-switch detail (ports, software, tags).list_fabrics,get_fabric— fabric inventory and members.
Routing & overlay
list_vrfs,get_vrf— VRF inventory and detail.get_vrf_routes— VRF IP routing table (RIB) with next-hop lookup. Accepts VRF and switch by name or UUID; with adestination(host IP or CIDR) it does a longest-prefix match and returns the winning route(s) and next hop(s).get_vrf_arp— VRF ARP table (IP-to-MAC bindings) learned on the switches. Accepts VRF and switch by name or UUID; passswitchto scope the table to one switch. Each entry exposes the IP/MAC, interface, physical port, owning switch and neighbor reachability state (reachable, stale, incomplete, …).get_vrf_ip_interfaces— VRF L3 (IP) interfaces. Accepts VRF and switch by name or UUID; filter byif_type(routed,vlan,loopback,evpn). Withinclude_status(default), the operational state (admin up/down, MAC, IP MTU, duplex, IPv4 address) is returned alongside the configuration.get_vrf_static_routes— IP static routes configured in a VRF (destination prefix, next hop or nullroute/discard, next-hop interface, distance, tag, type and applied switches). Accepts VRF and switch by name or UUID.get_vrf_bgp_status,get_vrf_bgp_summary— BGP state and summary per VRF.get_vrf_ospf_neighbors,get_vrf_ospf_summary— OSPF neighbors and summary per VRF.list_evpn,list_evpn_routes— EVPN instances and routes.get_vrf_virtual_environment— virtual environment bound to a VRF.
Sites & overview
list_afc_sites,get_afc_site_inventory— AFC (remote) sites and their inventory.get_network_overview— aggregated network state snapshot.
Health
list_health_alerts— active AFC health alerts.run_health_check— aggregated health (alerts, switch/fabric health, BGP/OSPF adjacencies, optional HA + license status).
Integrations & VMware vCenter/vSphere
list_integrations— all integration packs, their remote servers and connection state.list_vmware_integrations— vSphere-only: one entry per configured vCenter with server address, connection state and fault message.get_vmware_inventory— VMware hosts with location (vCenter, datacenter, cluster, domain) and status (physical NIC states, VM power breakdown), plus vSwitches, Port Groups and VMs. Optional filter by ESXi host name.list_vmware_vms— flat VM inventory with power status and placement (ESXi host, cluster, datacenter, vCenter), IPs and tags. Optional filters:power_state,host_name.get_vm_attachment— trace a VM's end-to-end network attachment (vNIC → Port Group → vSwitch → host uplink → physical switch/port).
Notes
AFC_BASE_URLmust be the host root without/api; the client adds the/apiprefix.- API authentication uses
POST /api/auth/tokenwithX-Auth-UsernameandX-Auth-Passwordheaders; the token is reused and refreshed automatically on401. - The vSphere pack does not expose a per-host power/health field: host status is derived
from physical NIC states and VM power counts;
vcenteris the vSphere instance UUID.
推荐服务器
Baidu Map
百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。
Playwright MCP Server
一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。
Magic Component Platform (MCP)
一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。
Audiense Insights MCP Server
通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。
VeyraX
一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。
graphlit-mcp-server
模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。
Kagi MCP Server
一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。
e2b-mcp-server
使用 MCP 通过 e2b 运行代码。
Neon MCP Server
用于与 Neon 管理 API 和数据库交互的 MCP 服务器
Exa MCP Server
模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。