mcp-api-server

tech-sysj/mcp-api-server

3.2

If you are the rightful owner of mcp-api-server and would like to certify it and/or have it hosted online, please leave a comment on the right or send an email to henry@mcphub.com.

The MCP API Server is a robust application built using FastAPI and PostgreSQL, designed to facilitate the Model Context Protocol.

MCP API Server

このプロジェクトは、FastAPIとPostgreSQLを用いたMCP(Model Context Protocol)APIサーバーです。Docker ComposeでサーバーとDBを簡単に構築・起動できます。

ディレクトリ構成

├── docker-compose.yml         # サービス全体の定義
├── mcp-server/                # APIサーバー本体
│   ├── Dockerfile             # サーバー用Dockerfile
│   ├── requirements.txt       # Python依存パッケージ
│   ├── app/                   # サーバーアプリケーション
│   └── scripts/               # DB登録用スクリプト
├── sql-server/                # PostgreSQL用Dockerfile等
│   ├── Dockerfile
│   └── init.sql

セットアップ方法

  1. ネットワーク作成(初回のみ)
    docker network create mcp-network
    
  2. ビルド&起動
    docker-compose up --build
    

APIサーバーへのアクセス

スクリプトの利用

mcp-server/scripts/配下のスクリプトでAPI情報やプロンプトをDBに登録できます。

例:

cd mcp-server/scripts
python3 add_openmeteo_api.py
python3 add_qrcode_api.py

テスト

pytestでテスト可能です。

pip install -r mcp-server/requirements.txt
pytest

環境変数

  • DB_HOST, DB_PORT, DB_USER, DB_PASSWORD, DB_NAME
  • MCP_SERVER_HOST, MCP_SERVER_PORT

ライセンス

MIT