MCP Study Tools
A local MCP study assistant that explains topics, creates study plans, and generates revision checklists through the Model Context Protocol.
README
🎓 MCP Study Tools — Local MCP Study Assistant
A complete checkpoint project implementing a local Model Context Protocol (MCP) server for a study assistant.
⚠️ Version compatibility
This project intentionally targets the FastMCP API:
from mcp.server.fastmcp import FastMCP
and pins the MCP SDK to:
mcp[cli]>=1.26,<2
This avoids the MCPServer import error that occurs when code written for a
different SDK generation is mixed with a FastMCP-based installation.
The project also uses the official MCP stdio client:
from mcp import ClientSession
from mcp.client.stdio import StdioServerParameters, stdio_client
✨ Checkpoint features
- Local FastMCP server: MCP Study Tools
explain_topiccreate_study_plangenerate_revision_checklist- Read-only
project://course-outline - Read-only
project://status - Structured validation errors
- Empty-topic protection
- Topic length and character validation
- Study days clamped to 1–14
- Checklist items clamped to 1–12
- MCP client using stdio
- Tool discovery
- Multiple MCP tool calls
- Agent-style routing
- Explicit tool allow-list
- Failure demonstration
- Security documentation
- Jupyter notebook
- Pytest tests
📁 Structure
mcp-study-tools/
├── server.py
├── client_test.py
├── requirements.txt
├── pyproject.toml
├── README.md
├── .gitignore
├── docs/
│ └── mcp-checkpoint-report.md
├── notebooks/
│ └── mcp_study_tools_walkthrough.ipynb
└── tests/
└── test_server.py
🚀 Installation on macOS/Linux
From the project folder:
python3 -m venv .venv
source .venv/bin/activate
python -m pip install --upgrade pip
pip install -r requirements.txt
Verify the SDK:
python -c "import mcp; print(mcp.__version__)"
python -c "from mcp.server.fastmcp import FastMCP; print('FastMCP OK')"
🧪 Run the client checkpoint
python client_test.py
The client launches server.py through the MCP stdio transport, initializes
an MCP session, discovers the three tools, calls two tools, demonstrates an
empty-input failure, and performs an agent-style routing example.
Expected discovery:
=== MCP TOOL DISCOVERY ===
[
"explain_topic",
"create_study_plan",
"generate_revision_checklist"
]
🖥️ MCP Inspector
The CLI development command is:
mcp dev server.py
This starts the server through the MCP development/Inspector workflow.
📓 Jupyter
Open:
notebooks/mcp_study_tools_walkthrough.ipynb
It covers:
- architecture
- validation
- direct tool behavior
- MCP client connection
- tool discovery
- tool calls
- failure handling
- agent-style routing
- checkpoint verification
🔐 Security
The tools are deliberately low-risk.
Input validation
Topics:
- must be strings;
- cannot be empty;
- maximum 160 characters;
- restricted to a simple human-readable character set.
Resource limits
Study days:
1..14
Checklist items:
1..12
Values outside these ranges are clamped.
No dangerous capabilities
The server does not:
- execute shell commands;
- execute arbitrary Python;
- make network requests;
- read secrets;
- write arbitrary files;
- mutate persistent application state.
Agent allow-list
Before an agent-style request is executed:
ensure_allowed(tool_name)
Only the three approved learning tools may be invoked.
❌ Failure demonstration
Calling:
explain_topic(" ")
returns a structured error:
{
"ok": false,
"error": {
"code": "EMPTY_TOPIC",
"message": "Please provide a topic, for example 'Python functions'.",
"field": "topic"
}
}
The server does not crash.
🧪 Automated tests
pytest -q
📚 Official MCP references
🏁 Requirement mapping
| Requirement | Implementation |
|---|---|
| Python MCP SDK | requirements.txt |
| FastMCP server | server.py |
| 3 required tools | server.py |
| Read-only resource | 2 resources |
| Input validation | validate_topic() |
| Empty topic safe error | EMPTY_TOPIC |
| Day limit 1–14 | clamp_integer() |
| Client test | client_test.py |
| Agent demonstration | pick_tool() + ensure_allowed() |
| Failure documentation | docs/mcp-checkpoint-report.md |
| Jupyter | notebooks/*.ipynb |
| Comments/documentation | All Python files |
推荐服务器
Baidu Map
百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。
Playwright MCP Server
一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。
Magic Component Platform (MCP)
一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。
Audiense Insights MCP Server
通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。
VeyraX
一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。
graphlit-mcp-server
模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。
Kagi MCP Server
一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。
e2b-mcp-server
使用 MCP 通过 e2b 运行代码。
Neon MCP Server
用于与 Neon 管理 API 和数据库交互的 MCP 服务器
Exa MCP Server
模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。