限定项目与工具范围
决定服务器将公开哪些能力。
限定项目与工具范围 是 CoddyKit 上的免费 MCP Academy 课时。 这是第 1 节课,共 4 节。 你可以在下方免费阅读本课时的完整内容 — 然后在浏览器中使用内置代码编辑器和全天候 AI 导师进行实践。 这是 MCP Academy 学习路径的一部分,你的进度在网页和 CoddyKit 应用中同步。 MCP Academy 课程共包含 4 节课。
本课时的部分内容尚未翻译,以英文显示。
Time to Ship Something Real
You have learned the pieces; now you build a complete server. This capstone wraps one real service into a tidy, installable MCP server. 🚀
Start with the User Goal
Before any code, name the job your server helps with. A clear goal like search my notes keeps every later decision focused and small.
Pick One Real Service
Choose a single concrete backend: a notes folder, a SQLite database, or one public API. One source keeps the capstone shippable, not sprawling.
List the Capabilities
Write down what the AI should be able to do, like search, read, and add. This short capability list becomes your map of tools and resources.
Sort Actions from Reads
Split your list: things that change state are tools, things that only fetch context are resources. This sorting decides each primitive up front.
Sketch the Tool Signatures
For each tool, jot a name, its arguments, and what it returns. A quick signature sketch catches missing inputs long before you write logic.
# add_note(title: str, body: str) -> str
# search_notes(query: str) -> list[str]
# A two-line sketch is enough to start.Plan One Resource
Pick one piece of read-only context to expose as a resource, such as a single note by its id. Resources feed the model without taking action.
Plan One Prompt
Add one reusable prompt the user can trigger, like summarize this note. Prompts package your best instructions so callers do not retype them.
Define Done Early
Decide what finished looks like now: the server loads, lists three tools, and answers one real query. A clear scope stops endless feature creep.
Name the Server
Give your project a short, descriptive name like notes-mcp. Clients show this name to users, so make it instantly tell people what it does.
from mcp.server.fastmcp import FastMCP
mcp = FastMCP("notes-mcp")Write a Tiny Spec
Capture the plan in one short spec file: goal, backend, tools, resource, and prompt. This page becomes your checklist as you build the rest.
Quick Check
Let us confirm how you sort capabilities.
Recap
You scoped a real project: one goal, one backend, and a tight list of tools, a resource, and a prompt. A clear plan makes the build easy. 🎯
常见问题解答
「限定项目与工具范围」课时是免费的吗?
是的 — 「限定项目与工具范围」的完整文本可在网页上免费阅读。要进行交互式练习(内置代码编辑器和全天候 AI 导师)并解锁 MCP Academy 课程的其余内容,请升级到 CoddyKit PRO。 MCP Academy 课程共包含 4 节课。
「限定项目与工具范围」这节课中我会学到什么?
决定服务器将公开哪些能力。 你通过在浏览器中直接运行的动手代码来练习 MCP Academy,全天候 AI 导师会在你学习这节课的过程中回答你的问题。
学习 MCP Academy 需要有经验吗?
无需任何先前经验。CoddyKit 上的 MCP Academy 课程适合初学者到高级学习者,你可以从这里开始或从头开始,按照自己的节奏学习。 这是第 1 节课,共 4 节。
「限定项目与工具范围」课时需要多长时间?
大多数 CoddyKit 课程大约需要 5–10 分钟。每节课都很精短且互动,所以你能稳步进步,并在网页和应用中从离开的地方继续。
我能在这节 MCP Academy 课中编写并运行代码吗?
能。每节 MCP Academy 课都包含内置代码编辑器,你可以在浏览器中直接编写并运行真实代码,并获得即时 AI 反馈 — 无需本地设置。
此课程中的所有课时
- 限定项目与工具范围
- 实现工具、资源与提示词
- 测试、检查并强化
- 记录文档并发布服务器