内容
# 思科 API 指南 MCP 服务器
[MCP(Model Context Protocol)服务器](https://modelcontextprotocol.io),为 AI 助手提供思科产品 API 文档的可搜索、高效访问。
## 概述
`cisco-api-guide-mcp` 以单个自包含的二进制文件发布,内嵌 SQLite 数据库,包含 API 端点、身份验证指南和参考内容,适用于:
- 思科 ACI(Application Centric Infrastructure,应用中心基础设施)
- 思科 NDFC(Nexus Dashboard Fabric Controller,前身 DCNM)
- 思科 Intersight / UCS(Unified Compute System,统一计算系统)
服务器通过 stdio(JSON-RPC 2.0)使用 [MCP 协议](https://modelcontextprotocol.io),并暴露三个工具,供 AI 助手调用,以搜索端点、检索完整的端点详细信息和查找产品身份验证指南。适用于构建自动化、集成和思科基础设施 API 工具的 AI 开发人员。
## 快速入门
### 1. 下载二进制文件
从 [GitHub Releases 页面](https://github.com/brightpuddle/cisco-api-guide-mcp/releases) 为您的平台下载最新版本:
| 平台 | 存档文件 |
| --------------------- | ----------------------------------- |
| macOS(Apple Silicon) | `cisco-api-guide_darwin_arm64.zip` |
| Linux(x86-64) | `cisco-api-guide_linux_amd64.zip` |
| Windows(x86-64) | `cisco-api-guide_windows_amd64.zip` |
解压存档文件,并将 `cisco-api-guide` 二进制文件放在您的 `PATH` 中。
### 2. 从源代码构建
需要 Go 1.21+:
```sh
git clone https://github.com/brightpuddle/cisco-api-guide-mcp.git
cd cisco-api-guide-mcp
go build -o cisco-api-guide ./cmd/cisco-api-guide
```
> **注意:** 构建过程内嵌了绑定的 API 数据库,位于 `internal/embeddb/api.db`。运行时无需外部数据库或网络访问。
### 3. 配置您的 MCP 客户端
服务器作为 stdio 进程运行。在您的 MCP 客户端配置中添加它:
**Claude Desktop**
(macOS:`~/Library/Application Support/Claude/claude_desktop_config.json`,Windows:`%APPDATA%\Claude\claude_desktop_config.json`):
```json
{
"mcpServers": {
"cisco-api-guide": {
"command": "/usr/local/bin/cisco-api-guide"
}
}
}
```
**OpenCode**(项目中的 `opencode.json` 或 `~/.config/opencode/config.json`):
```json
{
"mcp": {
"cisco-api-guide": {
"type": "stdio",
"command": "/usr/local/bin/cisco-api-guide"
}
}
}
```
任何 MCP 兼容的客户端都可以按相同方式配置:将 `command` 指向二进制文件并使用 stdio 传输。
## 工具
### `search_endpoints`
按自然语言或关键词搜索思科 API 端点。返回匹配端点的排名列表。
| 参数 | 类型 | 必需 | 描述 |
| --------- | ------ | ---- | -------------------------------------------------------------------------------- |
| `query` | 字符串 | 是 | 自然语言或关键词查询。例如:`"query VRFs in a tenant"` 或 `"create EPG"`。 |
| `product` | 字符串 | 否 | 过滤到特定产品。支持:`aci`、`ndfc`、`intersight`、`ucs`、`dcnm`。 |
| `release` | 字符串 | 否 | 按前缀匹配版本。例如:`"3"` 匹配 `"3.2.2m"`。 |
| `limit` | 整数 | 否 | 返回的最大结果数。默认为 `10`,最大 `50`。 |
### `get_endpoint`
获取特定思科 API 端点的完整详细信息,包括参数、请求正文架构和响应。
| 参数 | 类型 | 必需 | 描述 |
| --------- | ------ | ---- | -------------------------------------------------------------------------------- |
| `product` | 字符串 | 是 | 产品缩写。支持:`aci`、`ndfc`、`intersight`、`ucs`、`dcnm`。 |
| `method` | 字符串 | 是 | HTTP 方法。支持:`GET`、`POST`、`PUT`、`DELETE`、`PATCH`。 |
| `path` | 字符串 | 是 | API 路径,如 `search_endpoints` 返回的路径。例如:`"/api/node/class/{class}.json"`。 |
| `release` | 字符串 | 否 | 版本前缀,用于选择特定版本。当多个版本匹配时需要。 |
### `get_product_guide`
获取思科产品 API 的身份验证说明和一般使用说明。
| 参数 | 类型 | 必需 | 描述 |
| --------- | ------ | ---- | -------------------------------------------------------- |
| `product` | 字符串 | 是 | 产品缩写。支持:`aci`、`ndfc`、`intersight`、`ucs`、`dcnm`。 |
## 贡献
欢迎贡献。请参阅 [CONTRIBUTING.md](CONTRIBUTING.md) 以了解有关报告问题、提交拉取请求和使用摄入工具更新 API 数据库的指南。
对于安全漏洞,请遵循 [SECURITY.md](SECURITY.md) 中描述的负责任披露流程。
## 许可证
SPDX-License-Identifier: Apache-2.0
版权 2026 思科系统有限公司及其附属公司
根据 Apache License, Version 2.0(“许可”)授权;您不得使用此文件,除非符合许可要求。您可以在以下网址获得许可副本:
<http://www.apache.org/licenses/LICENSE-2.0>
除非适用法律要求或书面同意,否则根据许可分发的软件以“原样”提供,不附带任何形式的保证或条件。有关许可的特定语言管辖和限制的详细信息,请参阅许可。