Model Context Protocol Model Context Protocol Model Context Protocol · Lab 7/7 Lab 7/7 Lab 7/7 · 15 phút · 15 min · 15 នាទី

07

Bạn đã là MCP builder You're an MCP Builder Now អ្នកជា MCP builder ហើយ

Nhìn lại những gì đã làm, nắm pattern MCP, và tự tin ship server tiếp theo. Celebrate what you built, understand the universal MCP pattern, and launch your next server with confidence. មើលអ្វីដែលបានធ្វើ យល់ pattern MCP ហើយ ship server បន្ទាប់ដោយទំនុកចិត្ត។

Nội dung bước (lệnh, code) giữ nguyên tiếng Anh từ nguồn chính thức. Step body (commands, code) stays in English from the official source. ខ្លឹមសារជំហាន (ពាក្យបញ្ជា និង code) រក្សាភាសាអង់គ្លេសពីប្រភពផ្លូវការ។ labs.cloudflare.dev ↗

Cần trước Prerequisites តម្រូវការជាមុន

  • Đã xong bước 1–6 Completed Steps 1-6 បានបញ្ចប់ជំហាន 1–6

Bạn sẽ làm được Learning objectives គោលបំណងសិក្សា

  • Nhận ra pattern tool MCP dùng chung Recognize the universal MCP tool pattern ស្គាល់ pattern tool MCP ទូទៅ
  • Nối kỹ năng lab với ý tưởng tool thực tế Connect lab skills to real-world tool ideas ភ្ជាប់ជំនាញ lab ទៅគំនិត tool ពិត
  • Dùng AI assistant để làm MCP nhanh hơn Use AI assistants to accelerate MCP development ប្រើ AI assistant ដើម្បីធ្វើ MCP លឿន
  • Biết bước tiếp theo trong hệ sinh thái MCP Know where to go next in the MCP ecosystem ដឹងជំហានបន្ទាប់ក្នុងប្រព័ន្ធ MCP
Chúng ta đang xây What we're building អ្វីដែលយើងកំពុងសង់
A clear understanding of everything you built, the pattern behind it all, and the confidence to build your next MCP server.
Vì sao quan trọng Why this matters ហេតុអ្វីសំខាន់
You've learned every skill you need. This step connects the dots and points you forward.

Bạn đã xây gì What You Built អ្វីដែលអ្នកបានសង់

Over the last six steps you went from zero to a fully deployed MCP server with persistent storage and a real application on top of it.

Over the last six steps you went from zero to a fully deployed MCP server with persistent storage and a real application on top of it.

Over the last six steps you went from zero to a fully deployed MCP server with persistent storage and a real application on top of it.

That is the full stack of MCP development: tool creation, validation, external data, persistence, deployment, and a working app. Everything else is a variation on what you already know.

That is the full stack of MCP development: tool creation, validation, external data, persistence, deployment, and a working app. Everything else is a variation on what you already know.

That is the full stack of MCP development: tool creation, validation, external data, persistence, deployment, and a working app. Everything else is a variation on what you already know.

Pattern MCP dùng chung The Universal MCP Pattern Pattern MCP ទូទៅ

Every MCP tool you will ever build follows the same four-part structure:

Every MCP tool you will ever build follows the same four-part structure:

Every MCP tool you will ever build follows the same four-part structure:

typescript
server.tool(
  "tool_name", // What it's called
  "What this tool does", // How the AI understands it
  { param: z.string() }, // Zod schema for validation
  async ({ param }) => {
    // Your logic
    // Do the work
    return { content: [{ type: "text", text: "result" }] };
  },
);

You used this exact pattern in Steps 2, 3, 5, and 6. The only things that change between tools are the name, description, schema, and handler logic. The shape is always the same.

You used this exact pattern in Steps 2, 3, 5, and 6. The only things that change between tools are the name, description, schema, and handler logic. The shape is always the same.

You used this exact pattern in Steps 2, 3, 5, and 6. The only things that change between tools are the name, description, schema, and handler logic. The shape is always the same.

Đi xây tool tiếp theo Go Build Your Next Tool ទៅសង់ tool បន្ទាប់

You already have every skill required. Here are some ideas, mapped to what you learned:

You already have every skill required. Here are some ideas, mapped to what you learned:

You already have every skill required. Here are some ideas, mapped to what you learned:

These are just starting points. The best tool is one that solves a problem you actually have. Come up with your own idea, build it, and deploy it. Your MCP server is already live, so just add a new server.tool() call and run npm run deploy.

These are just starting points. The best tool is one that solves a problem you actually have. Come up with your own idea, build it, and deploy it. Your MCP server is already live, so just add a new server.tool() call and run npm run deploy.

These are just starting points. The best tool is one that solves a problem you actually have. Come up with your own idea, build it, and deploy it. Your MCP server is already live, so just add a new server.tool() call and run npm run deploy.

Dùng AI để đi nhanh hơn Use AI to Accelerate ប្រើ AI ដើម្បីទៅលឿន

AI coding assistants are great at generating MCP tools once you give them the right context. Use this prompt as a starting point:

AI coding assistants are great at generating MCP tools once you give them the right context. Use this prompt as a starting point:

AI coding assistants are great at generating MCP tools once you give them the right context. Use this prompt as a starting point:

The key is giving the AI your actual code as context. It will follow the patterns you already have in place.

The key is giving the AI your actual code as context. It will follow the patterns you already have in place.

The key is giving the AI your actual code as context. It will follow the patterns you already have in place.

Ship thôi Ship It Ship ទៅ

Deploy your updated server one more time:

Deploy your updated server one more time:

Deploy your updated server one more time:

bash
npm run deploy

Your MCP server is live on our global network. Any AI assistant that supports MCP can connect to it using your Workers URL.

Your MCP server is live on our global network. Any AI assistant that supports MCP can connect to it using your Workers URL.

Your MCP server is live on our global network. Any AI assistant that supports MCP can connect to it using your Workers URL.

Tiếp tục Keep Going បន្តទៅមុខ

  • MCP Specification - The protocol standard and full documentation
  • Cloudflare Workers docs - Everything Workers can do beyond what we covered
  • Cloudflare AI docs - Run AI models directly in your tools
  • MCP servers on GitHub - Open source MCP servers to learn from and contribute to
  • Cloudflare Discord - Community support and discussion

Bạn đã là MCP builder! You're an MCP builder now! អ្នកជា MCP builder ហើយ!

You built an MCP server from scratch, gave it persistent storage, deployed it globally, and connected it to AI. That is a real thing in the world now.

You built an MCP server from scratch, gave it persistent storage, deployed it globally, and connected it to AI. That is a real thing in the world now.

You built an MCP server from scratch, gave it persistent storage, deployed it globally, and connected it to AI. That is a real thing in the world now.

What you built

What you built

What you built

  1. 01 Scaffolded the project, started the dev server, connected the MCP Inspector
  2. 02 Built a custom tool with Zod validation — the core MCP pattern
  3. 03 Integrated a live external API with a local fallback
  4. 04 Deployed globally to Cloudflare Workers
  5. 05 Added KV storage so your tools can remember things between requests
  6. 06 Built full CRUD todo management — a complete app powered by AI
  7. 07 Learned the universal MCP pattern and how to accelerate with AI

What to build next

What to build next

What to build next

Share what you built with #CloudflareMCP and connect with the community!

Share what you built with #CloudflareMCP and connect with the community!

Share what you built with #CloudflareMCP and connect with the community!