MCP测试笔记应用程序
用于测试MCP集成的简单Notes应用程序的后端和前端。
后端(FastAPI)
后端使用FastAPI和SQLite实现。
设置
我们使用 紫外线 管理Python环境和依赖关系。
uv sync运行后端服务器
uv run uvicorn app.main:app --reloadAPI将于 http://localhost:8000.
运行后端测试
uv run pytest注释API
基础路径: http://localhost:8000/api/v1/notes
POST /api/v1/notes/–创建注释。主体:{ "content": "your note" }(最多500个字符,修剪后不为空)。GET /api/v1/notes/–按顺序列出注释created_at下降。DELETE /api/v1/notes/{note_id}–按ID删除注释。如果找不到,则返回404。
前端(Next.js+TypeScript)
前端生活在 frontend/ 目录,并使用Next.js、TypeScript和Tailwind CSS构建。
快速开始
cd frontend
npm install
npm run dev前端将在 http://localhost:3000 并期望后端在 http://localhost:8000.
前端测试
cd frontend
npm test有关更多详细信息,请参阅 前端/README.md.
