github-portfolio
🏗️ GitHub Portfolio MCP 服务器
一个将大语言模型(如 Claude)连接到 GitHub API 的模型上下文协议 (MCP) 服务器。
本项目通过在 LLM 的上下文窗口与外部数据源之间构建一个安全、标准化的桥梁,展示了对 AI 基础设施的理解。通过使用 MCP 标准,LLM 可以动态请求实时数据,而无需定制一次性的 API 集成。
🧠 架构概述
此集成通过 stdio 使用标准的 MCP JSON-RPC 架构:
LLM / 客户端(例如 Claude Code): 充当大脑和中介。它读取工具模式并决定何时获取外部数据。
MCP 服务器(本仓库): 一个使用
mcpSDK 的轻量级 Python 应用程序。它安全地公开特定工具并处理 JSON-RPC 通信。外部 API (GitHub): 数据源。服务器执行标准的 HTTP 请求以获取实时数据。
🛠️ 可用工具
fetch_public_repos:接收一个 GitHubusername字符串,并返回一个针对 LLM 上下文窗口优化过的、清晰提取的公共仓库列表(包括名称、URL 和描述)。
🚀 快速开始
前置条件
已安装 Python 3.x
Claude Code(或其他兼容 MCP 的客户端)
安装
克隆此仓库:
git clone <your-repo-url> cd <your-repo-folder>```安装所需的依赖项:
pip install -r requirements.txt
在 Claude Code 中运行
你可以轻松地将此服务器注册到 Claude Code,以便 LLM 能够动态使用它。在项目目录的终端中运行以下命令:
claude mcp add github-portfolio python3 server.py
添加后,你可以向 Claude Code 发送如下提示词:
"Use the github-portfolio tools to fetch the public repositories for user1."
Claude 将自动格式化 JSON-RPC 请求,唤醒本地 Python 服务器,执行 API 调用,并格式化响应。
本地测试
如果你想在没有 Claude Code 的情况下测试服务器,项目中包含了一个自定义的 Python 客户端。运行:
python3 client.py
这将启动一个后台进程,通过标准输入/输出进行连接,并获取一个硬编码的测试请求。
This server cannot be installed
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Latest Blog Posts
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/sanjay-vasoya/mcp-github-portfolio'
If you have feedback or need assistance with the MCP directory API, please join our Discord server