关于 GitHubCard
GitHubCard MCP 服务可根据实时 GitHub 数据生成个人资料和仓库卡片,面向需要在 README、链接预览或社交帖子中展示项目的人。它提供远程和本地接入,并可将卡片写入本地 Markdown 文件。
主要功能
- 01生成个人资料和仓库卡片
- 02提供 SVG、PNG 和嵌入代码
- 03校验卡片配置且不消耗配额
- 04浏览模板、调色板和组件
- 05管理卡片及使用配额
- 06更新本地 README 文件
适用场景
- 01为个人资料或仓库生成 README 卡片
- 02制作链接预览或社交帖子图片
- 03调整模板、背景和组件后生成卡片
MCP 相关
作为 MCP 服务,提供创建、校验、浏览和管理卡片等工具;可通过 Streamable HTTP 远程连接,或使用 ghcard CLI 以 stdio 本地运行。本地模式可启用 README 文件写入。
配置
远程服务无需本地安装。选择你使用的客户端,复制配置或使用一键安装。
https://githubcard.com/mcpclaude mcp add --transport http com-githubcard https://githubcard.com/mcp{"mcpServers":{"com-githubcard":{"type":"http","url":"https://githubcard.com/mcp"}}}在 Cursor 中打开{"servers":{"com-githubcard":{"type":"http","url":"https://githubcard.com/mcp"}}}在 VS Code 中打开{"mcpServers":{"com-githubcard":{"type":"http","url":"https://githubcard.com/mcp"}}}{"mcpServers":{"com-githubcard":{"serverUrl":"https://githubcard.com/mcp"}}}命令在终端中运行;JSON 粘贴到对应客户端的 MCP 配置后重启。需要授权的服务会在首次连接时提示登录。
https://githubcard.com/mcp需要授权工具
详细介绍
GitHubCard MCP 服务
让 AI 助手创建 GitHubCard 图片:适用于 README、链接预览和社交帖文的个人资料卡片和仓库卡片,数据来自实时 GitHub。
- 托管版:
https://githubcard.com/mcp(Streamable HTTP)。无需安装。 - 本地版: 使用
ghcardCLI 运行npx -y @ghcardhq/ghcard mcp(stdio)。还可以编辑磁盘上的 README。
可以尝试这样提问:
为我的个人资料创建一张 GitHubCard,并将其添加到 README 顶部。
为
vercel/next.js创建一张深色卡片,用作链接预览。使用紧凑仓库模板,但将背景设为
#1e3a5f,并移除语言组件。
获取 API 密钥
创建卡片需要免费的 API 密钥。登录 githubcard.com/dashboard,然后在 API keys 下创建密钥。密钥格式类似 ghc_live_…。
没有密钥时,服务仍会列出模板、配色方案和组件类型,因此你可以先试用,再注册。
设置
在以下示例中,将 ghc_live_… 替换为你的密钥。
Claude Code
claude mcp add --transport http githubcard https://githubcard.com/mcp \
--header "Authorization: Bearer ghc_live_…"
此外,还有一个 Claude Code 插件,会同时添加服务和 GitHubCard 技能:请参阅 ghcardhq/skills。
Claude Desktop
设置 → 连接器 → 添加自定义连接器,URL 为
https://githubcard.com/mcp。目前尚不支持自定义请求头,因此若要传入密钥,请改用 claude_desktop_config.json 中的本地服务:
{
"mcpServers": {
"githubcard": {
"command": "npx",
"args": ["-y", "@ghcardhq/ghcard", "mcp"],
"env": { "GHCARD_API_KEY": "ghc_live_…" }
}
}
}
Cursor
~/.cursor/mcp.json:
{
"mcpServers": {
"githubcard": {
"url": "https://githubcard.com/mcp",
"headers": { "Authorization": "Bearer ghc_live_…" }
}
}
}
VS Code
.vscode/mcp.json(VS Code 会提示你输入一次密钥,并安全地保存):
{
"inputs": [
{
"id": "githubcard-key",
"type": "promptString",
"description": "GitHubCard API key",
"password": true
}
],
"servers": {
"githubcard": {
"type": "http",
"url": "https://githubcard.com/mcp",
"headers": { "Authorization": "Bearer ${input:githubcard-key}" }
}
}
}
Windsurf
~/.codeium/windsurf/mcp_config.json:
{
"mcpServers": {
"githubcard": {
"serverUrl": "https://githubcard.com/mcp",
"headers": { "Authorization": "Bearer ghc_live_…" }
}
}
}
Codex CLI
~/.codex/config.toml:
[mcp_servers.githubcard]
url = "https://githubcard.com/mcp"
bearer_token_env_var = "GHCARD_API_KEY"
然后在 shell 中导出 GHCARD_API_KEY=ghc_live_…。
其他客户端
远程:使用 https://githubcard.com/mcp 上的 Streamable HTTP,请求头为
Authorization: Bearer ghc_live_…。
本地(stdio):命令为 npx,参数为 ["-y", "@ghcardhq/ghcard", "mcp"],环境变量为
GHCARD_API_KEY。在参数中添加 --allow-file-writes 以启用
update_readme。需要 Node.js 20 或更高版本。
工具
| 工具 | 需要密钥 | 功能 |
|---|---|---|
create_card | 是 | 为用户或 owner/repo 创建(或复用)卡片。返回 SVG/PNG 链接以及 Markdown/HTML 嵌入代码片段。消耗每日配额中的 1 个单位 |
validate_card | 是 | 对 create_card 进行试运行:检查 ID、Pro 功能和自定义设计,不消耗配额 |
list_templates | 否 | 列出布局,可按范围(个人资料/仓库)、Free 计划和组件类型筛选 |
list_palettes | 否 | 列出背景配色方案 |
list_components | 否 | 列出卡片可包含的组件类型 |
get_template_design | 否 | 获取模板布局的可编辑设计文档 |
get_card_design | 是 | 获取你的一张卡片的设计文档 |
list_cards | 是 | 列出你创建的卡片 |
delete_card | 是 | 删除卡片;删除后,其链接将失效 |
get_usage | 是 | 查看你的计划和今日剩余配额 |
update_readme | 仅本地 | 在 Markdown 文件中插入或更新卡片。仅限使用 ghcard mcp --allow-file-writes |
create_card 具有幂等性:相同的输入会返回相同的卡片和链接。卡片图片始终显示最新的 GitHub 数据,因此无需重新创建。
失败的调用会返回 isError: true,其中包含稳定的 code、retryable 标志,以及告知模型下一步操作的 hint。
限额
| 计划 | 每日卡片数 |
|---|---|
| Free | 100 |
| Pro | 5000 |
配额于 UTC 时间 00:00 重置。失败的调用不计入配额。Free 卡片带有小型水印。请参阅定价。
链接
- githubcard.com:编辑器和图库
- ghcardhq/ghcard:CLI 和本地 MCP 服务
- ghcardhq/skills:Claude Code 插件和技能
server.json:在 MCP 注册表中的条目,名称为com.githubcard/mcp
许可证
MIT
评论
一个开放协议,规定了 AI 应用如何以统一方式连接外部工具与数据源。客户端负责与模型对话,MCP 服务负责提供工具、资源和提示模板,两者通过标准消息通信,同一个服务可以被不同客户端复用。