MCP服务器卡片生成工具

一个用于生成、验证和发现MCP服务器卡片的工具,标准化描述MCP服务器以便AI代理自动发现和理解。

  • by AiAgentKarl
  • Python
  • 本地部署
  • 更新于
在 GitHub 查看 AiAgentKarl/agent-server-card-mcp

使用说明

MCP服务器卡

用于生成、验证和发现MCP服务器卡的MCP服务器——一种描述MCP服务器的标准化方法,以便AI代理可以自动找到并理解它们。

什么是服务器卡?

服务器卡是机器可读的JSON文件,描述了MCP服务器的功能,类似于 robots.txt 描述爬行规则或 manifest.json 描述了网络应用程序。他们住在 .well-known/mcp-server-card.json 并包含:

  • 名称和描述 --服务器做什么
  • 工具 --可用工具列表及说明
  • 作者和存储库 --谁建造的,在哪里可以找到来源
  • 分类 --用于发现和搜索的标签
  • 定价 --无论是免费、免费增值还是付费
  • 运输 --它是否使用stdio、HTTP或两者都使用
  • 认证 --是否需要身份验证

为什么是服务器卡?

随着MCP生态系统的发展,代理需要一种自动发现和评估服务器的方法。服务器卡通过提供以下功能来解决此问题:

  1. 自动发现 --代理人可以检查 .well-known/mcp-server-card.json 在任何域上
  2. 标准化元数据 --用于比较服务器的一致格式
  3. 能力描述 --代理在连接之前知道有哪些工具可用
  4. 信任信号 --作者、存储库和定价信息

安装

pip install agent-server-card-mcp

用法

作为MCP服务器

{
  "mcpServers": {
    "server-cards": {
      "command": "server-card-server"
    }
  }
}

使用uvx

{
  "mcpServers": {
    "server-cards": {
      "command": "uvx",
      "args": ["agent-server-card-mcp"]
    }
  }
}

可用工具

工具 说明
generate_card 生成一个 .well-known/mcp-server-card.json 适用于任何MCP服务器
validate_card 根据JSON模式验证服务器卡
discover 尝试通过以下方式从URL发现服务器卡 .well-known
search 按关键字搜索索引服务器卡
register 在本地索引中注册服务器卡
schema 获取服务器卡的完整JSON模式

服务器卡示例

{
  "name": "weather-mcp-server",
  "description": "Provides real-time weather data and forecasts",
  "version": "1.0.0",
  "author": "WeatherCorp",
  "repository": "https://github.com/example/weather-mcp",
  "tools": [
    {
      "name": "get_weather",
      "description": "Get current weather for a location"
    },
    {
      "name": "get_forecast",
      "description": "Get 7-day weather forecast"
    }
  ],
  "categories": ["weather", "climate", "data"],
  "pricing": "free",
  "auth_required": false,
  "transport": "stdio"
}

服务器卡架构

必填字段:

  • name --唯一服务器名称
  • description --服务器做什么
  • version --语义版本
  • tools --数组 {name, description} 物体

可选但推荐:

  • author --作者或组织
  • repository --源代码URL
  • categories --可搜索性标签
  • pricing — free | freemium | paid | open-source
  • auth_required --布尔值
  • transport — stdio | http | both

Discovery的工作原理

  1. 代理希望在上找到MCP服务器 example.com
  2. 它要求 https://example.com/.well-known/mcp-server-card.json
  3. 如果文件存在,代理将解析它并了解可用的工具
  4. 然后,代理可以根据元数据决定是否连接

这遵循与以下相同的模式 .well-known/openid-configuration 对于OAuth或 .well-known/ai-plugin.json 用于ChatGPT插件。


AiAgentKarl提供的更多MCP服务器

类别 服务器
🔗 区块链 索拉纳
🌍 数据 天气 · 德国 · 农业 · 太空 · 航空 · 欧盟公司
🔒 安全 网络安全 · 策略网关 · 审计跟踪
🤖 代理基础设施 记忆 · 目录 · 中心 · 声誉
🔬 研究 学术的 · LLM基准 · 法律

→ 完整目录(40+台服务器)

许可证

麻省理工学院