
npb mcp
一个使用 FastAPI 构建的工具,用于获取日本职业棒球选手的详细信息和赛季数据。
Repository Info
About This Server
一个使用 FastAPI 构建的工具,用于获取日本职业棒球选手的详细信息和赛季数据。
Model Context Protocol (MCP) - This server can be integrated with AI applications to provide additional context and capabilities, enabling enhanced AI interactions and functionality.
Documentation
岡大海選手のプロフィール、通算成績、シーズン成績などを取得できるツールです。
概要
FastAPIを使用して、岡大海選手の成績情報を取得するRESTful APIを構築。
SPAIA NPB APIを使用してデータを取得し、APIエンドポイントを通じて簡単にアクセスできるようにしました。
ローカルで簡単に動作させ、データ取得を行うことができます。
使用技術
-
FastAPI: 高速なAPIを簡単に構築するためのフレームワーク。
-
SPAIA NPB API: プロ野球の選手データを提供するAPI。
-
Python 3.13: 本プロジェクトで使用しているPythonのバージョン。
セットアップ方法
- クローン まず、リポジトリをクローンします。
git clone https://github.com/takuma-8trees/npb-mcp.git
cd npb-mcp
- 必要なパッケージをインストール Poetryを使用して依存関係を管理しています。以下のコマンドで依存関係をインストールします。
poetry install
- APIサーバの起動 次に、FastAPIサーバを起動します。
poetry run uvicorn src.api_server:app --reload --app-dir src
サーバが起動したら、ブラウザで以下のURLにアクセスできます。(動作確認未実施)
-
http://localhost:8000/profile: 岡大海選手のプロフィール情報を取得
-
http://localhost:8000/career: 通算成績
-
http://localhost:8000/season?year=2023: 2023年シーズン成績
ngrokを使用した外部公開方法
ngrokを使用することで、ローカルのFastAPIサーバを簡単に外部に公開することができます。
- ngrokのインストール もしまだngrokがインストールされていない場合は、以下のコマンドでインストールします。
brew install --cask ngrok
- ngrokでローカルサーバを公開 FastAPIサーバが起動している状態で、以下のコマンドでngrokを使用して外部に公開します。
ngrok http 8000
成功すると、次のようなメッセージが表示されます。
Forwarding https://xxxxxxx.ngrok.io -> http://localhost:8000
これで、https://xxxxxxx.ngrok.ioが外部からアクセスできるURLとして提供されます。 このURLを使用して、他の人がインターネット経由でAPIにアクセスできるようになります。
- ngrokのURLを使用 例えば、https://xxxxxxx.ngrok.io/profileにアクセスすると、岡大海選手のプロフィール情報を取得できます。
Quick Start
Clone the repository
git clone https://github.com/takuma-8trees/npb-mcpInstall dependencies
cd npb-mcp
npm installFollow the documentation
Check the repository's README.md file for specific installation and usage instructions.
Repository Details
Recommended MCP Servers
Discord MCP
Enable AI assistants to seamlessly interact with Discord servers, channels, and messages.
Knit MCP
Connect AI agents to 200+ SaaS applications and automate workflows.
Apify MCP Server
Deploy and interact with Apify actors for web scraping and data extraction.
BrowserStack MCP
BrowserStack MCP Server for automated testing across multiple browsers.
Zapier MCP
A Zapier server that provides automation capabilities for various apps.