Students Architecture MCP Server
Students Architecture
学生を管理するためのREST APIおよびMCPインターフェースを実装したサンプルプロジェクト。
著者: MsC Felipe Buitrago Carmona
所属: カルダス大学、人工知能・工学部、システム・情報学科
説明:
レイヤードアーキテクチャ:
presentation(REST + MCP),business(サービス),data(リポジトリ),models(DTOおよびエンティティ)。JSONおよびSQLiteの永続化をサポートし、
.envを通じて動的に選択可能。
要件
Python 3.12+ (仮想環境を推奨)
requirements.txtに記載された依存関係。
クイックインストール
仮想環境を作成して有効化する:
python -m venv venv
& venv\Scripts\Activate.ps1依存関係をインストールする:
pip install -r requirements.txt設定 (.env)
ルートディレクトリに
.envファイルをコピーまたは作成し、以下のような値を設定します:
FASTMCP_STATELESS_HTTP=true
REPO_TYPE=json # o sqlite
JSON_PATH=students.json
SQLITE_PATH=students.db
API_PORT=5000
MCP_PORT=9000REPO_TYPE を json と sqlite の間で変更することで、永続化の実装を選択できます。
注: .env を変更した後は、リポジトリファクトリが読み込めるようにサーバーを再起動してください。
REST APIの実行 (開発用)
venv\Scripts\python.exe -m uvicorn main_api_rest_server:app --reload --port 5000MCPサーバーの実行
venv\Scripts\python.exe main_mcp_server.py主なルート (REST)
GET /students— 学生一覧の取得POST /students— 学生の作成GET /students/{id}— 学生の取得PUT /students/{id}— 更新DELETE /students/{id}— 削除
学生を作成するための curl の例:
curl -X POST http://localhost:5000/students -H "Content-Type: application/json" -d '{"name":"Ana","email":"ana@example.com","age":21,"career":"Ingenieria","semester":4}'役立つメモ
デバッガー(例: PyCharm)を使用していて
loop_factoryに関連するTypeErrorが発生する場合、起動処理にはmain_api_rest_server.py内のasyncio.runに対する互換性処理が含まれています。Pydantic v2で
orm_modeを使用すると警告が表示されます。Pydantic v2へ移行する際はfrom_attributesを使用することを推奨します。
Claude Desktopの設定
Claude Desktopをインストールし、左下のユーザー名が表示されている箇所から 設定 セクションへ移動し、デベロッパー セクションの 設定を編集 を選択して、以下のJSONを貼り付けてください。
{
"mcpServers": {
"students_architecture": {
"command": "npx",
"args": [
"-y",
"mcp-remote",
"http://localhost:9000/mcp",
"--allow-http"
],
"env": {
"MCP_TRANSPORT_STRATEGY": "http-only"
}
}
},
"preferences": {
"coworkScheduledTasksEnabled": false,
"sidebarMode": "chat",
"coworkWebSearchEnabled": true,
"ccdScheduledTasksEnabled": false
}
}連絡先 MsC Felipe Buitrago Carmona felipe.buitrago@ucaldas.edu.co カルダス大学 システム・情報学科
This server cannot be installed
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Latest Blog Posts
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/CesarRL23/MCP'
If you have feedback or need assistance with the MCP directory API, please join our Discord server