edu-db-readonly-mcp
Edu DB Readonly MCP — 教育・教务向け読み取り専用データベースゲートウェイ
教育・教务業務データベース向けの安全な読み取り専用クエリゲートウェイ MCP。公式 FastMCP SDK を使用して「教务データベース(学生 / コース / 成績 / 履修)」を一連の MCP ツールとして公開し、 LLM Agent が業務データを安全にクエリできるようにしつつ、プロトコル層からデータベース層まで一切の書き込み操作を禁止します。
ChatGPT のラッパー、汎用 MCP Server、純粋な RAG デモとは異なり、本プロジェクトは **「業務データベースを Agent に安全に読み取り開放する」**というエンジニアリングチェーンに特化しており、 データセキュリティ + MCP 実装の本格的なケースです。
コアセールスポイント(面接で話せる内容)
セキュリティ観点 | 実装方法 |
書き込み保護 | SQL 字句静的検証: |
読み取り専用フォールバック | SQLite を |
データベース過負荷防止 |
|
インジェクション防止 | ゲートウェイ層はすべてパラメータバインドを使用し、業務ツールは固定クエリのホワイトリスト関数を使用するため、文字列連結によるインジェクションに本質的に免疫 |
タイムアウト保護 | スロークエリがしきい値(デフォルト 3 秒)を超えると自動終了し、Agent のハングアップを防止 |
認証 | オプションの |
監査 | 毎回のクエリを |
Related MCP server: sql-safety-executor
ツール一覧(MCP)
ツール | 説明 |
| すべての業務テーブルと行数を一覧表示 |
| 指定テーブルのフィールド / 型 / 主キーを返す |
| 生の読み取り専用 SQL ゲートウェイ(セキュリティ検証 + LIMIT + タイムアウト) |
| 学生プロフィール(基本情報 + 平均点 + 履修成績の明細) |
| コース人数 / 平均点 / 最高・最低 / 合格率 |
| 履修成績の集計レポート。年 / 学期でフィルタ可能 |
query は「生の SQL ゲートウェイ」機能を示し、その他は教务向けの業界特化型セキュリティラッパー関数
(固定パラメータ化クエリで、素の SQL より安全かつ業務に適合)です。
クイックスタート
# 1. 安装依赖
pip install -r requirements.txt
# 2. 初始化教务演示库
python scripts/init_db.py
# 3. 运行命令行演示(连 stdio MCP,展示 6 个工具 + 写操作被拦截)
python scripts/demo_client.py
# 4. 启动为 MCP Server(供 Claude / Cursor / 任意 MCP 客户端接入)
python -m src.server
# 开启鉴权:
# READONLY_GATEWAY_TOKEN=your_secret python -m src.serverサンプルクエリ:学生プロフィール、CS205 コース統計、学期別集計……
テスト
pytest tests/ # 22 个用例:写防护/注入/多语句/截断/工具行为/审计ディレクトリ構成
edu-db-readonly-mcp/
├── README.md
├── pyproject.toml
├── requirements.txt
├── data/edu.db # 生成的教务演示库(只读打开)
├── scripts/
│ ├── init_db.py # 建表 + 造种子数据(10学生/10课/32选课)
│ └── demo_client.py # 命令行 MCP 演示
├── src/
│ ├── server.py # FastMCP 入口,注册 6 个工具
│ ├── gateway/
│ │ ├── readonly_gateway.py # 核心:SQL 只读校验 + LIMIT + 超时
│ │ ├── auth.py # token 鉴权
│ │ └── audit.py # 审计日志
│ ├── db/connection.py # mode=ro 连接 + 元数据读取
│ └── tools/
│ ├── query_tool.py # 原始 SQL 网关
│ ├── schema_tools.py # list_tables / describe_table
│ └── edu_workflows.py # 教务业务封装工具
└── tests/
├── test_gateway_security.py # 安全用例
└── test_tools.py # 工具行为用例設計ドキュメント → docs/DESIGN.md
履歴書用の説明(貼り付け可能)
教育・教务向け読み取り専用データベースゲートウェイ MCP(FastMCP) 教育・教务データベース向けの安全な読み取り専用 MCP Server を独自開発。軽量 SQL 読み取り専用ゲートウェイを設計:
SELECT/WITHのみ許可する静的検証で DML/DDL と セミコロン複数文インジェクションをブロック、LIMIT未指定時は自動で行数を制限、 パラメータ化クエリでインジェクション防止、スレッドタイムアウト保護、 SQLitemode=roによる読み取り専用フォールバック。テーブル内省と教务業務ラッパーツールを 提供し、トークン認証とaudit.log監査をサポート。22 のユニットテストで書き込み保護、インジェクション、 複数文、切り詰めなどのセキュリティシナリオをカバーし、エンドツーエンドのデモで書き込み操作がプロトコル層でブロックされることを検証。
This server cannot be installed
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Related MCP Servers
- AlicenseNot gradedqualityAmaintenanceProvides a read-only PostgreSQL SQL surface for LLM agents via MCP, with defense-in-depth security layers for safe database queries.3MIT
- AlicenseNot gradedqualityCmaintenanceEnables LLMs to safely execute database queries via MCP tools, with security features including query restrictions, truncation, and timeout.6MIT
- FlicenseNot gradedqualityDmaintenanceEnables AI agents to explore MySQL database schemas and execute read-only queries through a safe, MCP interface.
- AlicenseNot gradedqualityBmaintenanceProvides read-only access to databases for MCP-compatible AI tools, allowing schema exploration and SELECT queries without exposing credentials or risking data changes.923MIT
Related MCP Connectors
Read-only MCP server for ClassQuill, a tutoring-business-management platform.
Official Microsoft MCP Server to query Microsoft Entra data using natural language
Query PostgreSQL databases in plain English — LLM-generated, safety-validated SQL.
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/Vanity-1/edu-db-readonly-mcp'
If you have feedback or need assistance with the MCP directory API, please join our Discord server