YouTube2Text

Build an MCP Server in Python (Claude Code Uses It) — Transcript

by TrickyWorld · 941 words · 173 segments · language en · Watch on YouTube

Full transcript

  1. 0:00Copy a popular MCP tutorial today and
  2. 0:02its very first import can fail. On my
  3. 0:05Mac, even the install failed. By the
  4. 0:08end, you'll have a working MCP server in
  5. 0:11under 50 lines.
  6. 0:13>> [music]
  7. 0:13>> The two fixes old tutorials miss and
  8. 0:16plot code using your own tools. Build an
  9. 0:19MCP server.
  10. 0:20>> [music]
  11. 0:22>> MCP, the Model Context Protocol, is an
  12. 0:24open standard that lets AI apps use
  13. 0:27outside tools [music] and data.
  14. 0:29Anthropic introduced it in November
  15. 0:312024.
  16. 0:33Since December 2025,
  17. 0:36it's run under the Linux Foundation.
  18. 0:38[music] Think of an MCP server as a
  19. 0:40power strip for your tools. Build it
  20. 0:43once and any app with an MCP plug can
  21. 0:46use [music] every tool on it. Cload
  22. 0:48code, Cload desktop, Cursor, VS Code,
  23. 0:53Gemini CLI,
  24. 0:56and Codex from OpenAI. Last episode, our
  25. 1:00agent kept its two tools inside its own
  26. 1:03code.
  27. 1:04Today, we move them into a server and
  28. 1:06add a third, the latest posts from a
  29. 1:09website. A server can offer tools the
  30. 1:12model calls,
  31. 1:13>> [music]
  32. 1:13>> resources the app reads, and prompts you
  33. 1:16pick.
  34. 1:17Today, tools. And we'll use standards
  35. 1:20IO.
  36. 1:22The app starts our server as a program
  37. 1:25on your own machine. The official Python
  38. 1:28SDK is the MCP package.
  39. 1:32Version 2.3.0 is current and it needs
  40. 1:35Python [music] 3.10 or newer. Fix one.
  41. 1:39On an Intel Mac, the plain install
  42. 1:41fails. A dependency called cryptography
  43. 1:44[music]
  44. 1:44stopped shipping Intel Mac builds in
  45. 1:47June. Our only binary cryptography and
  46. 1:50it installs [music] an older build that
  47. 1:52works. Fix two. Version two renamed fast
  48. 1:56MCP to MCP server. So, the import line
  49. 2:00in older tutorials now fails. [music]
  50. 2:02No module named. The new line from
  51. 2:05mcp.server
  52. 2:07import MCPServer.
  53. 2:09>> [music]
  54. 2:10>> Here's a whole server. One line creates
  55. 2:12it with a name, notes, [music]
  56. 2:15and one sentence that tells the AI what
  57. 2:18it's for. Each tool is a normal Python
  58. 2:21function with mcp.tool on top, brackets
  59. 2:26included. The function's name becomes
  60. 2:28the tool's name, the docstring it's
  61. 2:31description, and the type hints its
  62. 2:33input [music] schema.
  63. 2:35Last time we wrote that schema by hand.
  64. 2:38Read note keeps last episode's guard.
  65. 2:42It finds the real path, symlinks
  66. 2:44included, and refuses anything outside
  67. 2:47the notes folder. One change since
  68. 2:50version 2.1.
  69. 2:52>> [music]
  70. 2:52>> If a tool crashes with an ordinary
  71. 2:55Python error, the model only sees error
  72. 2:58executing tool.
  73. 3:00So, we raise tool error and Claude gets
  74. 3:03the real reason. The new tool, latest
  75. 3:06post,
  76. 3:08reads an RSS feed with Python's built-in
  77. 3:11XML parser.
  78. 3:13Only HTTPS links,
  79. 3:15>> [music]
  80. 3:15>> at most 5 megabytes,
  81. 3:18at most 20 posts. Last line, mcp.run.
  82. 3:24With no arguments, it uses standard IO.
  83. 3:28So, standard output belongs to the
  84. 3:30protocol, log to standard error,
  85. 3:34>> [music]
  86. 3:34>> never print. Test it first before any
  87. 3:37model touches it.
  88. 3:39>> [music]
  89. 3:39>> The official MCP inspector needs Node
  90. 3:4222.19
  91. 3:44[music] or newer, which this Mac doesn't
  92. 3:47have. So, I use the SDK's own client, 14
  93. 3:52lines.
  94. 3:53It lists our three tools, reads
  95. 3:56todo.txt,
  96. 3:58and when I ask for the server's own
  97. 4:01file,
  98. 4:01>> [music]
  99. 4:01>> it refuses. And latest posts pulls the
  100. 4:05three newest tricky word posts live from
  101. 4:08the feed. Now, plug it in. In your
  102. 4:11terminal, Claude
  103. 4:13MCP at [music]
  104. 4:15notes, two dashes, then the command that
  105. 4:19starts the server. Claude MCP list
  106. 4:22[music] says it's connected. By default,
  107. 4:25it's just for you in this project.
  108. 4:28Scope user puts it in all your projects.
  109. 4:32Scope project writes a file your team
  110. 4:35can share. [music] And with a local
  111. 4:37model through Ollama,
  112. 4:39set enable tool search to false, so the
  113. 4:42tools load up front. Time for the real
  114. 4:45test. [music] I asked Claude code,
  115. 4:47running the free local model, "What's
  116. 4:49[clears throat] in todo.txt,
  117. 4:51and what [music] are the three latest
  118. 4:53tricky word posts?" It found our server
  119. 4:56and called read note. Right answer.
  120. 4:59>> [music]
  121. 5:00>> Then it called latest posts and made up
  122. 5:03the feed's address
  123. 5:04twice.
  124. 5:06Neither site exists. Our tool error
  125. 5:09passed back the real reason, so it
  126. 5:11didn't pretend.
  127. 5:12>> [music]
  128. 5:12>> It told me it couldn't get the posts.
  129. 5:16That's a lesson in tool design. I gave
  130. 5:18the model a choice it didn't need.
  131. 5:20[music] In version two, the address is
  132. 5:23fixed in the code. The model can't get
  133. 5:25it wrong, and nobody can point this tool
  134. 5:28[music] at another site. Same question,
  135. 5:30version two. Read note, then latest
  136. 5:33[music] posts with just a limit of
  137. 5:35three, and a clean answer. My to-do list
  138. 5:39[music]
  139. 5:40and the three newest posts. On this
  140. 5:43laptop, it took about 10 and 1/2
  141. 5:45minutes.
  142. 5:47The first request failed after 6
  143. 5:49minutes, [music] and Claude code retried
  144. 5:52it on its own. Now, safety. An MCP
  145. 5:56server is a normal program running with
  146. 5:59your permissions.
  147. 6:01It is not a sandbox. In September 2025,
  148. 6:06a fake postmark MCP package on NPM
  149. 6:10>> [music]
  150. 6:10>> added one line that quietly copied every
  151. 6:14email it sent to the attacker. And
  152. 6:17everything a server sends goes into the
  153. 6:19model's context.
  154. 6:21In April 2025,
  155. 6:23>> [music]
  156. 6:24>> researchers showed tool poisoning.
  157. 6:26Hidden instructions inside a tool's
  158. 6:28description. Our RSS tool brings web
  159. 6:31text in two. A post title could carry
  160. 6:35instructions. Even the official
  161. 6:37inspector has had security fixes as
  162. 6:40recently as the 21st of October.
  163. 6:44So, install servers you trust, pin their
  164. 6:47versions, and keep them updated. So, one
  165. 6:50MCP server, three decorated functions,
  166. 6:53[music]
  167. 6:54MCP.run,
  168. 6:55and one cloth MCP add.
  169. 7:00And don't make the model guess what your
  170. 7:02code [music] already knows. Next, we
  171. 7:05attack our own agent. Can a webpage
  172. 7:08hijack it through the text it reads? And
  173. 7:11how do we stop it?

About this transcript

This page contains the full transcript of Build an MCP Server in Python (Claude Code Uses It) by TrickyWorld, generated from the public captions YouTube serves with the video. The transcript has 941 words across 173 segments, with the original timestamps preserved so you can click any line to jump to that moment in the embedded player.

What you can do with it

Use the transcript to take notes, quote the speaker, build a study guide, generate a summary with ChatGPT or Claude via the YouTube Summary tool, or export it as a timed subtitle file with YouTube to SRT. You can also re-open it in the transcriber to choose a caption track available on the video.

Free YouTube transcript tool

YouTube2Text is a free YouTube transcript generator — no signup, no daily limit. Paste any YouTube link and get the full transcript instantly, with timestamps, click-to-jump, caption language selection, AI prompts for ChatGPT, Claude, and Gemini, and exports to TXT, SRT, VTT, or Markdown.