mcp-trial
mcp-trial
Model Context Protocol を学ぶために、GitHub API 用のサーバーを構築しています。Python SDK v2 で、stdio 上で動作し、Claude Code に接続されています。
機能
2つのツールがあります。1つはリポジトリの概要用、もう1つは最近のコミットメッセージ用です。また、リポジトリの生の README を提供するリソースと、リポジトリをポートフォリオ作品として評価するためのプロンプトテンプレートもあります。
Related MCP server: MCP GitHub Reader
実行方法
uv sync
uv run mcp dev server.py # opens the inspector
uv run python test_server.py # calls the server directly, no host neededClaude Code に登録するには:
claude mcp add gh-lab -- uv run --directory /path/to/mcp-trial mcp run server.py学んだこと
型ヒントが実際の API 契約になります。SDK が関数シグネチャから直接ツールの JSON スキーマを構築するからです。limit: int = 5 と書くと、そのパラメータはオプションになり、モデルはそれを省略できます。
ドキュメント文字列は思った以上に重要でした。モデルにツールの説明として送られ、どのツールを選ぶかを決定するからです。Claude Code にリポジトリが活発にメンテナンスされているか尋ねたところ、両方のツールを呼び出して解決しました。これは、説明が組み合わせ可能に見えたからこそ起こったことです。
ツールが返すものはすべてモデルのコンテキスト内のテキストになるため、各フィールドはトークンを消費します。GitHub は約100のフィールドを返しますが、私は5つだけ返します。
エラーを返すよりも例外を発生させる方が優れています。例外を発生させるとホストがチェックするフラグが設定され、メッセージがモデルに届いて対処可能になるからです。
非同期は何も速くしません。単一の呼び出しはどちらでも同じ時間がかかります。await が行うのは、関数を一時停止してイベントループを解放し、待機中に他の呼び出しを実行できるようにすることです。
メモ
mcp-reference.md には、これを構築する際の作業メモがあります。
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Tools
Related MCP Servers
- AlicenseAqualityDmaintenanceAn MCP server that enables analyzing and querying GitHub repositories through the GitHub Chat API, allowing users to index repositories and ask questions about their code, architecture and tech stack.286MIT
- AlicenseDqualityDmaintenanceA lightweight MCP server for bringing GitHub repositories into context for large language models, enabling repository analysis, file access, and search without local cloning.4106Apache 2.0
- AlicenseNot gradedqualityDmaintenanceAn MCP server that provides tools for interacting with the GitHub API, enabling AI assistants to query repositories, pull requests, issues, commits, users, and more.467ISC
- FlicenseNot gradedqualityCmaintenanceA read-only MCP server that exposes GitHub user profiles, repository info, and search via tools for AI assistants like Claude.
Related MCP Connectors
An MCP server that gives your AI access to the source code and docs of all public github repos
A MCP server built for developers enabling Git based project management with project and personal…
Driflyte MCP server which lets AI assistants query topic-specific knowledge from web and GitHub.
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
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/Sai-Srinivas7/mcp-trial'
If you have feedback or need assistance with the MCP directory API, please join our Discord server