
alokverma18/mcp
Developer toolsこのページは AI により自動翻訳されています。技術的な詳細は原文をご確認ください。 原文を見る
カスタムMCP(Model Context Protocol)サーバーの構築と使用
概要
MCP(Model Context Protocol)サーバーのビルドと使用方法を実証するシンプルなプロジェクトです。 3. - Windsurf/Claudeデスクトップを起動 - 質問: "octocatのリポジトリを表示する" - LLMはMCPサーバーツールを自動的に呼び出します このMCPサーバをデプロイし、テスト用に利用できます: - : [https://my-mcp.fastmcp.app/mcp] - : 準備完了 デプロイされたエンドポイントを使用するWindsurfの設定: - MCP のサポートで LLM を尋ねる: "gn1264 のリポジトリを表示する" - デプロイされたサーバーは GitHub のデータに応答します - ✅ ローカルのPython環境は必要ありません - ✅ 常に利用可能で信頼できる - ✅ 管理されたインフラ - ✅ ローカルバージョンと同じ機能 どちらのサーバーも独立しており、異なる使用例を実証しています。 - : GitHub MCP サーバーが市場でどのように動作するかを説明します - : 一般ユーザー向けの公開 GitHub API アクセス - : GitHub API 操作 (リポジトリ、コミット、検索など) - : 商用 GitHub MCP 統合
概要(AI 翻訳)
MCP(Model Context Protocol)サーバーのビルドと使用方法を実証するシンプルなプロジェクトです。
クイックスタート
1.依存関係のインストール:
2.Windsurf/ClaudeデスクトップのMCPサーバーの設定:
3。LMでの使用:
- Windsurf/Claudeデスクトップを起動する
- 質問: “私はoctocatのリポジトリを表示する”
- LLM は MCP サーバー ツールを自動的に呼び出します
OST ライブ展開
この MCP サーバーは、以下のテストで利用できます。
-URL:[https://my-mcp.fastmcp.app/mcp
- Status: 準備ができた生産
デプロイされたサーバーの使用
デプロイされたエンドポイントを使用するWindsurfの設定:
デプロイされたサーバーをテストして下さい:
- MCPサポートでLMを尋ねる: “gn1264のリポジトリを表示する”
- デプロイされたサーバーはGitHubデータと応答します
デプロイサーバーの###利点
- ✅ ローカルPython環境は必要ありません
- ✅ 常に利用でき、信頼できる
- ✅ 管理されたインフラ
- ✅ローカルバージョンと同じ機能
テスト(任意)
開発およびテストのため:
プロジェクト構成
MCP サーバー
どちらのサーバーも独立しており、異なる使用例を実証しています。
GitHub サーバー ([[T1])
-Purpose: GitHub MCP サーバーが市場でどのように動作するかを宣言
このページは AI により自動翻訳されています。技術的な詳細は原文をご確認ください。
README
以下は原文 README の抜粋です。原文を見る。
MCP Server Project
A simple project demonstrating how to build and use MCP (Model Context Protocol) servers.
Quick Start
- Install dependencies:
pip install -r requirements.txt
- Configure MCP server in Windsurf/Claude Desktop:
{
"mcpServers": {
"github": {
"command": "python",
"args": ["/path/to/server/github.py"],
"env": {
"GITHUB_TOKEN": "your_github_token_here (see .env.example)"
}
},
"database": {
"command": "python",
"args": ["/path/to/server/database.py"]
}
}
}
- Use with LLM:
- Start Windsurf/Claude Desktop
- Ask: “Show me octocat’s repositories”
- LLM will automatically call the MCP server tools
🚀 Live Deployment
This MCP server is deployed and available for testing at:
- URL:
https://my-mcp.fastmcp.app/mcp - Status: Production ready
Using the Deployed Server
Configure Windsurf to use the deployed endpoint:
{
"mcpServers": {
"github-mcp-deployed": {
"url": "https://my-mcp.fastmcp.app/mcp",
"disabled": false
}
}
}
Test the deployed server:
- Ask any LLM with MCP support: “Show me repositories for gn1264”
- The deployed server will respond with GitHub data
Benefits of Deployed Server
- ✅ No local Python environment required
- ✅ Always available and reliable
- ✅ Managed infrastructure
- ✅ Same functionality as local version
Testing (Optional)
For development and testing:
# Test GitHub server
python testing/test_github_server.py get-repos octocat
# Test Database server
python testing/test_database_server.py query "SELECT * FROM users"
Project Structure
mcp/
├── server/ # MCP servers
│ ├── github.py # GitHub API server
│ └── database.py # Database server
├── client/ # Real LLM client
│ └── mcp_client.py # LLM integration example
├── testing/ # Server testing utilities
│ ├── test_github_server.py # Test GitHub server
│ └── test_database_server.py # Test Database server
├── simple.db # Sample database file
├── requirements.txt # Dependencies
├── README.md # This file
└── learn.md # Learning guide
MCP Servers
Both servers are independent and demonstrate different use cases:
GitHub Server (server/github.py)
- Purpose: Demonstrates how GitHub MCP servers work in the market
- Use Case: Public GitHub API access for general users
- Tools: GitHub API operations (get repos, commits, search, etc.)
- Similar to: Commercial GitHub MCP integrations
Database Server (server/database.py)
- Purpose: Shows enterprise database integration patterns
- Use Case: Internal database access in enterprise environments
- Tools: SQL query execution
- Similar to: Custom internal MCP servers for company data
Testing vs Real Usage
Testing Utilities (testing/)
インストール
This server does not publish a one-line install command.
Open the repository installation guide MCP 初心者?mcpskill.org のガイドから始めましょう →設定
{
"mcpServers": {
"github": {
"command": "python",
"args": ["/path/to/server/github.py"],
"env": {
"GITHUB_TOKEN": "your_github_token_here (see .env.example)"
}
},
"database": {
"command": "python",
"args": ["/path/to/server/database.py"]
}
}
}