Portfolio MCP Server
Portfolio MCP Server
MCP(Model Context Protocol)サーバーで、Cheng-Yun Wuのポートフォリオ(プロジェクト、スキル、履歴書)をツールとして公開します。MCP互換のAIアシスタント(Claude Desktop、Claude.ai Connectors、MCP Inspectorなど)は、ウェブサイトをスクレイピングする代わりに、これらのツールを直接呼び出すことができます。
なぜこれを作ったか
MCPが実際にどのように動作するかを、読むだけでなく理解したいと思ったからです。そこで、自分のポートフォリオサイトのコンテンツを構造化されたツールに変換する小さなサーバーを構築しました。また、これまであまり触れてこなかったDockerと基本的なCI/CDパイプラインを学ぶための、意図的なきっかけでもあります。これらは、私が応募している求人情報で頻繁に登場するスキルです。
Related MCP server: Bijon Portfolio MCP Server
MCPとは(簡単に)
MCPは(Anthropicによる)オープンプロトコルで、AIアシスタントが外部の「ツール」(名前、説明、スキーマを持つ型付き関数)を呼び出して、トレーニングデータや貼り付けられたドキュメントだけに頼るのではなく、ライブ情報を取得したりアクションを実行したりできるようにします。サーバーは自身のツールを宣言し、MCP対応クライアントはそれらを発見して呼び出すことができます。このプロジェクトはそのようなサーバーの1つで、自身のポートフォリオデータに基づく4つのツールを宣言しています。
ツール
ツール | 機能 |
| すべてのポートフォリオ項目(リリース済みシステム、コンテスト参加作品、研究プロジェクト、出版論文、コースレポート。主要なケーススタディだけでなく)を、id、名前、タグライン、カテゴリ、年、1行の概要、そしてリスト内にリンク(ライブシステム、GitHub、レポート、デモ動画など)とともに表示します。 |
| 1つの項目の完全なレコード。主要プロジェクトの場合:役割、技術スタック、問題、課題と解決策、成果、リンク。軽量な項目の場合:ファイルにある情報(最低でも説明とリンク)。マッチングは寛容でエイリアスに対応しています( |
| スキル分類全体のキーワード検索。関連性でランク付けされ、各結果はそのスキルを示すプロジェクトを表示します。 |
|
|
各ツールのdocstringは、AIアシスタントがいつ呼び出すかを判断するために実際に読み取るものです。詳細は src/portfolio_mcp/server.py を参照してください。
カバレッジ: data/projects.json には全31件のポートフォリオ項目が含まれています。7件の詳細なケーススタディ(リリース済みシステム、論文、NSTC研究プロジェクト、受賞論文)と、24件の軽量な項目(その他のコンテスト参加作品、コースレポート、会議論文)です。すべての項目に少なくとも1つのリンクが含まれています。コース段階のレポートや関連論文には、所属する詳細なケーススタディを指す related_project idが含まれており、アシスタントがレポートから完全なストーリーにドリルダウンできます。
アーキテクチャ
Claude Desktop / Claude.ai / MCP Inspector
│ (stdio locally, or Streamable HTTP remotely)
▼
MCPServer instance (server.py)
│ registers 4 tools
▼
tools.py (pure, unit-tested logic)
│
▼
data_loader.py → data/*.json (projects, skills, resume)トランスポート: Streamable HTTP(stdioではありません)。ポイントは、リモートクライアント(例:Claude.aiのConnectors)がローカルで起動されたプロセスだけでなく、公開URL経由でこのサーバーにアクセスできることです。ローカルのClaude Desktop / MCP Inspectorテスト用にstdioもサポートしています。
データ層:
data/の下にある3つのフラットなJSONファイル。一度ロードされ、キャッシュされます(functools.lru_cache)。データベースはありません。データは小さく、公開されており、変更は稀です。ツールロジックとMCP配線: 意図的に分離されています(
tools.pyvs.server.py)。これにより、MCPサーバーやトランスポートを実行せずにロジックを単体テストできます。SDKに関する注意: 公式の
mcpPython SDKは、v2.0.0で高レベルサーバーAPIをFastMCPからmcp.server.mcpserver.MCPServerに変更しました。このプロジェクトはmcp>=2.0.0とその現在のAPIをターゲットにしています。from mcp.server.fastmcp import FastMCPを使用する古いMCPチュートリアルを見たことがある場合、それはv2.0.0以前のAPIであり、pip install mcpで現在入手できるものに対してインポートできません。
プロジェクト構造
portfolio-mcp-server/
├── data/ # projects.json, skills.json, resume.json
├── src/portfolio_mcp/
│ ├── server.py # MCPServer app: registers tools, stdio/HTTP entrypoints, /chat route
│ ├── tools.py # MCP tool logic (testable, no MCP dependency)
│ ├── chat.py # /chat: Claude + Tool Runner over the same data, for the site's Q&A widget
│ └── data_loader.py # cached JSON loading
├── tests/ # pytest suite run in CI (tools, server security, chat, chat route)
├── Dockerfile # python:3.12-slim + uvicorn, Streamable HTTP
├── .github/workflows/ci.yml # lint (ruff) + test (pytest) on every push
└── claude_desktop_config.json # example config for local stdio testingローカルでの実行
# from the repo root
python -m venv .venv && source .venv/bin/activate
pip install -e ".[dev]"オプションA — stdio、MCP Inspector使用
npx @modelcontextprotocol/inspector python -m portfolio_mcp.server各ツールを直接呼び出し、リクエスト/レスポンスを検査できるローカルWeb UIが開きます。
オプションB — stdio、Claude Desktop使用
claude_desktop_config.json の mcpServers エントリを自身のClaude Desktop設定(設定 → 開発者 → 設定の編集)にマージし、パスを自分のマシン用に修正してからClaude Desktopを再起動し、「この人が手がけたプロジェクトは?」などと質問してください。
オプションC — Streamable HTTP、ローカル
TRANSPORT=http python -m portfolio_mcp.server
# equivalent — both serve the exact same ASGI app, /chat included:
uvicorn portfolio_mcp.server:app --host 0.0.0.0 --port 8000テスト
pytest -v
ruff check .Dockerでの実行
docker build -t portfolio-mcp-server .
docker run -p 8000:8000 portfolio-mcp-serverコンテナは常にStreamable HTTPを提供します(コンテナ化のポイントはこれです — ポータブルで公開可能なユニットであり、1台のマシンに縛られたstdioプロセスではありません)。
デプロイ(Render)
選択したデプロイ先: Render、無料枠。長時間実行されるコンテナ(実行時間制限のあるサーバーレス関数ではない)を実行します。これはStreamable HTTPの永続的な接続に必要であり、開始にクレジットカードは不要です。
このリポジトリをGitHubにプッシュします。
render.com で: New → Web Service → このリポジトリに接続。
Renderが
Dockerfileを自動検出し、コンテナとしてビルド/実行します。Free インスタンスタイプを選択 →
https://<something>.onrender.comのURLが取得できます。動作確認:
npx @modelcontextprotocol/inspector https://<something>.onrender.com/mcp(オプション)RenderのGitHub自動デプロイを有効にすると、
git pushをmainに実行するたびに自動的に再デプロイされます。以下のCIワークフローと組み合わせることで、完全なCI/CDストーリーが完成します。
無料枠の注意: Renderの無料Webサービスは、約15分間アイドル状態が続くとスリープし、次のリクエストで起動するのに30〜60秒かかります。ポートフォリオのデモには問題ありませんが、尋ねられた場合に意図的なコスト/レイテンシのトレードオフとして言及する価値があります。
ライブデプロイ: https://yun-portfolio-mcp.onrender.com/mcp — MCPクライアントをこのURLに接続してください(/mcp パスに注意。ベアドメインは404になります。これは想定内です — Streamable HTTPはその1つのパスのみを提供します)。npx @modelcontextprotocol/inspector https://yun-portfolio-mcp.onrender.com/mcp で自分で確認できます。
これをフォークする場合:
server.pyのHostヘッダー許可リストはデフォルトでyun-portfolio-mcp.onrender.comにハードコードされています(DNSリバインディング保護により、他のHostヘッダーは421で拒否されます)。MCP_ALLOWED_HOSTS環境変数を自身のデプロイのホスト名に設定するか、ALLOWED_HOSTSを直接編集してください。
チャットエンドポイント(/chat)— ポートフォリオサイトのQ&Aウィジェット
同じRenderサービス上の2つ目の独立したドアで、yunwcy.github.io に埋め込まれたプレーンなチャットウィジェット用です。上記のMCPプロトコルサーフェスの一部ではありません。 ブラウザが {"message": "..."} を /chat に POST すると、サーバーはAnthropic Tool Runnerを使用して、Claudeに同じ4つのツールのどれを呼び出すかを決定させ(MCPハンドシェイクなしで tools.py を直接呼び出す)、{"reply": "..."} を返します。完全な実装については src/portfolio_mcp/chat.py を参照してください。
なぜこれに実際のバックエンドが必要で、GitHub Pagesだけではできないのか: 自然言語で応答するには、LLMが質問を見てどのツールを呼び出すかを決定する必要があり、それにはAnthropic APIキーが必要です。そして、キーは静的サイトのクライアントサイドJSに決して置くことができません。誰でもソースを表示してアカウントを使い潰せるからです。/chat はキーをサーバーサイド(Renderの環境変数。ブラウザには決して送信されません)に保持し、ブラウザが必要とするウィジェットのみをGitHub Pagesに配信します。
セットアップ(このエンドポイントが機能する前に必要):
Anthropic Console からAPIキーを取得し、Renderの
ANTHROPIC_API_KEY環境変数として追加します(Renderダッシュボード → このサービス → Environment)。これがない場合、/chatはサーバーをクラッシュさせる代わりに503 {"error": "not_configured"}を返します。CHAT_ALLOWED_ORIGINS(カンマ区切り)がCORSを制御します。デフォルトはhttps://yunwcy.github.ioです。ウィジェットが別の場所にある場合は設定してください。ANTHROPIC_CHAT_MODEL(デフォルトclaude-opus-5)— 最も強力な汎用選択肢ですが、これはシンプルで、潜在的に高トラフィックで、コストに敏感な公開ウィジェットであるため、claude-haiku-4-5はここで特に検討に値します。これはハードコードされず、サーバーを実行する人に委ねられた意図的な選択です。CHAT_RATE_LIMIT_PER_HOUR(デフォルト30)— シンプルなインメモリのIPごとの制限で、1人の訪問者が単独で請求額を増やせないようにします。再起動/再デプロイのたびにリセットされ、インスタンス間で共有されません。低トラフィックの個人サイトには十分ですが、一般的な悪用防止策ではありません。
CI/CD
.github/workflows/ci.yml は、main ブランチへのプッシュ/PRごとに実行されます。パッケージのインストール、ruff によるリント、pytest スイートの実行を行います。RenderのGitHub自動デプロイ(上記参照)がCD部分を担当します。
セキュリティ / コストに関する注意
MCPツールサーフェス(
/mcp)はそれ自体ではLLMを呼び出しません — ローカルのJSONを読み取って返すだけです。接続する側(そのClaude、そのトークン)がそのコストを負担し、このサーバーは負担しません。/chatエンドポイントはLLMを呼び出します。このサーバー自身のAnthropic APIキーを使用します。それがそもそもの目的です(ブラウザはキーを安全に保持できません)。コストはIPごとのレート制限、effort: "low"、および小さなmax_tokensによって制限されています。詳細は上記のチャットエンドポイントのセクションを参照してください。すべてのデータはすでに私のポートフォリオサイトで公開されています。どちらのエンドポイントにも認証は実装されていません。保護するべきプライベートなものは何もないからです。
/chatのCORS許可リストは、誰がAPI予算を使うことができるかを制御するために存在し、データを保護するためではありません。
データの更新
data/ の下のJSONファイルを直接編集してください。id は get_project_details が照合する安定した識別子です。他のフィールドは自由形式です。コンテンツの更新にコードの変更は必要ありません。
Available Tools
4 toolsget_project_detailsA
Get the full record for one portfolio item. For a flagship project this includes role, tech stack, the problem it solved, challenges and how they were solved, outcomes, and links; for a lighter item (a course report, a smaller competition entry) it returns whatever is on file — at minimum a description and its links.
Args: name: A project name, id, or known alias/alternate name — e.g. "IM Your Buddy", "knovyra", "lab handover", "NTPU OPE Assistant", or a competition name like "North Taiwan University Alliance AI Agent Competition". Matching is forgiving (case-insensitive, partial, alias-aware), so you don't need the exact id from list_projects — but calling list_projects first helps pick the right one when unsure.
Inputs: name (required).
get_resume_summaryA
Get a self-introduction / resume summary, plus name, title, and contact info. Use this to answer "tell me about yourself" or "give me a summary of this person's background" style questions.
Args: length: "short" for 1-2 sentences, "medium" for a paragraph, or "long" for a full narrative summary covering research, shipped projects, publications, and certifications. Defaults to "short".
Inputs: length.
list_projectsA
List every item in the portfolio — shipped systems, competition entries, research projects, published papers, and course reports, not just the flagship case studies — with id, name, tagline, category, year, a one-sentence summary, and its links (live system, GitHub, report, demo video, etc., whichever apply). Links are included right here, so a system or report can be pointed to without a second call. An entry's related_project (when present) is the id of a fuller case study it's a stage or companion piece of — pass that id to get_project_details for the deep-dive version. Call this first for any broad question like "what has this person worked on?" or "does a system exist for X?".
Inputs: no named parameters. Returns: result
search_skillsA
Search the skills/technology taxonomy by keyword and return matches ranked by relevance, each with the projects that demonstrate it. Use this to answer questions like "does this person know RAG / Docker / vector databases / iOS development?".
Args: keyword: A skill, technology, or category to search for, e.g. "RAG", "Docker", "vector database", "iOS", "Next.js".
Inputs: keyword (required). Returns: result
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 4 tools
Each tool has a distinct, well-defined purpose. list_projects provides an overview, get_project_details provides deep dives on individual entries, search_skills queries the technology taxonomy, and get_resume_summary returns background info. There is no overlap or ambiguity between any of these tools.
All tool names follow a consistent verb_noun pattern (list_projects, get_project_details, search_skills, get_resume_summary). The naming clearly indicates what action is being taken and on what resource, making the API predictable and easy to navigate.
With exactly 4 tools covering portfolio browsing, detail retrieval, skill search, and resume summary, the number is well-scoped for a personal portfolio MCP server. No tools are missing, and every tool serves a distinct, necessary function without redundancy.
The tool set provides a complete coverage of the portfolio domain: listing all entries, retrieving full details for any entry, searching across skills/tags, and providing a professional summary. There are no obvious gaps—a user can explore projects, drill into details, assess expertise, and get background information.
Maintenance
Related MCP Connectors
Build, version and render resumes as PDFs from Claude or any MCP client.
Public portfolio MCP for resume, services, availability, project evidence, and introductions.
Nifty's MCP server — exposes tasks, projects, messages, and files as tools for AI agents.
Your company's tools, memory and Automations for ChatGPT, Claude or any MCP agent. Open source.
Related MCP Servers
- FlicenseNot gradedqualityDmaintenanceExposes personal portfolio data as tools for Claude to answer questions about the developer, including profile, skills, experience, projects, and contact information.-
- FlicenseAqualityDmaintenanceExposes a personal portfolio's resume, projects, skills, certifications, and live GitHub repositories as tools for AI assistants to query via natural language.6-
- AlicenseNot gradedqualityDmaintenanceExposes a structured professional resume as a set of AI-queryable tools, enabling AI clients like Claude Desktop to query summary, experience, skills, projects, and tailor resumes to job descriptions.1MIT
- AlicenseAqualityDmaintenanceMCP server that exposes a resume as callable tools and resources, enabling AI agents to query experience, skills, projects, and contact information via natural language.3ISC