Agent-MCP
MCP 作业 — 主机、两种传输协议与一项技能
本项目无需额外框架即可满足作业的本地部分要求:
使用 Ollama
qwen3.5:4b的 CLI 代理;加载配置、合并工具并路由调用的 MCP 主机;
包含 3 个工具、1 个资源和 1 个提示的 stdio 待办事项服务器;
通过经过身份验证的本地 Streamable HTTP 运行的同一服务器;
通过
use_skill实现的渐进式技能加载;持久化、验证、可恢复的 MCP 错误以及集成测试。
有意不进行公共托管。具体部署步骤请参见 PUBLIC_HTTP.md。
要求
Node.js 20+
Ollama
qwen3.5:4b:ollama pull qwen3.5:4b
Related MCP server: Personal OS MCP
安装与验证
npm install
npm test
npm run check在本地运行所有内容
在两个终端中使用相同的本地密钥。该密钥不会被提交。
终端 1 — 启动经过身份验证的 HTTP 服务器:
export MCP_KEY="$(openssl rand -hex 32)"
echo "$MCP_KEY" # copy this value for terminal 2
npm run server:http终端 2 — 确保 Ollama 正在运行,然后启动代理:
export MCP_KEY="paste-the-same-value"
ollama serve # omit if Ollama is already running在另一个终端中,运行:
export MCP_KEY="paste-the-same-value"
npm run agent尝试以下请求:
Add "finish MCP homework" using the stdio todo server.
Add "record the demo" using the HTTP todo server.
Standup time — what should I work on today?最后一个请求应触发 use_skill("daily-plan"),然后调用两个 MCP 服务器并返回今日、稍后和阻碍项。
使用 MCP Inspector 进行测试
Stdio:
npx @modelcontextprotocol/inspector node src/servers/stdio.jsHTTP:
export MCP_KEY="a-local-test-key"
npm run server:http
npx @modelcontextprotocol/inspector在 Inspector 中,选择 Streamable HTTP,使用 http://127.0.0.1:3000/mcp,并添加标头 Authorization: Bearer a-local-test-key。验证:
add_task、list_tasks和complete_task已列出且可调用。可以读取
todo://list。可以加载
plan_my_day。完成未知 ID 会返回
isError: true。
项目结构
config.json agent/model/server configuration
skills/daily-plan/SKILL.md on-demand workflow
src/agent/ MCP host, Ollama loop, and skill loader
src/todo/ shared todo domain and MCP capabilities
src/servers/stdio.js stdio entry point
src/servers/http.js Streamable HTTP entry point
test/ unit and protocol integration tests评分依据
要求 | 证据 |
代理主机 |
|
stdio 服务器 |
|
本地 HTTP |
|
代理中的技能 |
|
错误处理 | Zod 验证、 |
测试 |
|
演示与提交清单
对于简短的 YouTube 演示:
展示
npm test通过。在 Inspector 中展示 stdio 服务器:工具、资源和提示。
展示 HTTP 服务器在没有密钥时返回 401,然后使用密钥连接。
在代理中,通过每个服务器添加一个任务。
询问“站会时间”,展示自动技能加载以及对两个服务器的调用。
简要打开
config.json和SKILL.md,解释路由机制。
在 Moodle 上提交 YouTube 链接和源代码。如果后续部署,还需提交公共 /mcp URL 和临时评分员密钥。
This server cannot be deployed
Maintenance
Related MCP Connectors
Persistent memory, hybrid search and a goal graph for AI agents, over stdio or remote HTTP.
Nifty's MCP server — exposes tasks, projects, messages, and files as tools for AI agents.
- mcpOAuthnet.todoist
Official Todoist MCP server for AI assistants to manage tasks, projects, and workflows.
Local-first task manager: create, edit, and complete tasks, projects, and checklists via MCP.
Related MCP Servers
- AlicenseNot gradedqualityBmaintenanceA local-stdio MCP server for a single personal Todoist account with env-gated read-only mode and prompt-injection mitigations.221 npmMIT
- FlicenseAqualityBmaintenanceMCP server for Personal OS API that enables managing tasks, notes, projects, collections, reviews, and more through typed tools over stdio.66-
- FlicenseNot gradedqualityBmaintenanceA Model Context Protocol server that provides todo management via stdio, local HTTP, and public HTTPS transports, enabling agents to add, list, and complete tasks, and includes a daily standup skill.-
- AlicenseNot gradedqualityCmaintenanceA demo MCP server exposing an in-memory todo list via tools (add_task, list_tasks, complete_task), a resource, and a prompt, over both stdio and HTTP transports.1 npmISC