edu-db-readonly-mcp
Click on "Install Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@edu-db-readonly-mcpGet the course statistics for CS205."
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
Edu DB Readonly MCP — Education Administration Read-Only Database Gateway
A secure read-only query gateway MCP for education administration business databases. Using the official FastMCP SDK, it exposes the "administration database (students / courses / grades / enrollments)" as a set of MCP tools, allowing LLM Agents to safely query business data while prohibiting all write operations from the protocol layer down to the database layer.
Unlike ChatGPT wrappers, generic MCP Servers, or pure RAG demos, this project focuses on the engineering pipeline of "safely opening business databases to Agents for reading" — a hardcore case of data security + MCP implementation.
Core Selling Points (Interview-Ready)
Security Dimension | Implementation |
Write Protection | Static SQL lexical validation: only |
Read-Only Fallback | SQLite opened with |
Anti-Dump Protection | Missing |
Injection Prevention | The gateway layer uses parameter binding exclusively; business tools use fixed query whitelist functions, naturally immune to concatenation injection |
Timeout Protection | Slow queries exceeding the threshold (default 3s) are automatically terminated, preventing clever Agents from hanging |
Authentication | Optional |
Auditing | Every query is written to |
Related MCP server: sql-safety-executor
Tool List (MCP)
Tool | Description |
| Lists all business tables and row counts |
| Returns fields / types / primary keys for a given table |
| Raw read-only SQL gateway (security validation + LIMIT + timeout) |
| Student profile (basic info + average score + enrollment grade details) |
| Course enrollment / average score / max-min / pass rate |
| Enrollment grade summary report, filterable by year / term |
query demonstrates the "raw SQL gateway" capability; the rest are industry-specific secure wrapper functions for administration
(fixed parameterized queries, safer and more business-aligned than raw SQL).
Quick Start
# 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.serverExample queries: student profile, CS205 course statistics, summary by term...
Testing
pytest tests/ # 22 个用例:写防护/注入/多语句/截断/工具行为/审计Directory Structure
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 # 工具行为用例Design document → docs/DESIGN.md
Resume Description (Copy-Paste Ready)
Education Administration Read-Only Database Gateway MCP (FastMCP) Independently developed a secure read-only MCP Server for education administration databases. Designed a lightweight SQL read-only gateway: static validation that only allows
SELECT/WITHto block DML/DDL and semicolon multi-statement injection, automatic row limiting whenLIMITis missing, parameterized queries for injection prevention, thread timeout protection, and SQLitemode=roread-only fallback; provided table introspection and administration business wrapper tools with Token authentication andaudit.logauditing. 22 unit tests cover security scenarios including write protection, injection, multi-statement, and truncation; end-to-end demo verifies write operations are blocked at the protocol layer.
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