Lesson 15 of 30, Module 2: Your First Server. Your own server edits real documents in your Drive folder.
What you can do after this lesson
A working server is small. It is a plain function with one decorator line and one docstring line, and a failure you saw coming should return a plain sentence the AI can act on. Any new capability is then the same short list run again.
The problem we inherited
You install the official Google Drive server and Claude reads every document and changes none of them.
Code in this lesson
Every block the lesson shows on screen, in the order it appears.
1. Write the plain Python function
2. Put the @mcp line above it
3. Write the one-line docstring
4. Restart Claude Desktop
5. Ask Claude to use it
Downloads
- Module 2 checkpoint (scribe-checkpoint-m2.zip): working code as the module leaves it, so a broken session costs you nothing
- The course GitHub repo: every checkpoint, the README and the full lesson list
Prefer to read?
The written version of this part of the course is on Substack: https://genaiunplugged.substack.com/p/how-to-build-an-mcp-server-and-connect.
Lesson transcript
Where the map stands
When this module began, the middle of our map was a hole. Today it holds a server that you wrote.
Hello, and welcome to lesson 15 of the MCP Masterclass. This lesson is a quick recap of everything we built in module 2. And we start with our map, as always.
11 lit boxes on the diagram. Your Scribe server sits in the middle. Beside it are read_doc, edit_doc, the folder Claude can browse, and your saved jobs.
Well, there is nothing new in this lesson. 5 points, and then module 3.
Five things to remember
Point number 1. The official server reads, and it cannot write.
It has 1 tool, which is search. Its permission slip says drive.readonly, and the server has been retired. So nobody had built the thing you needed.
Point number 2. A tool is a plain Python function with 2 small additions.
You put the @mcp line above it, and 1 sentence inside it. The name, the description and the inputs are then built for you.
That was reason number 3 from module 1, and you watched it pay off.
Point number 3. You proved it, and you did not take the server at its word.
The real document changed, and Drive named Scribe as the one who changed it. A second app used your server with no new code. And Scribe cannot make a new file, because Google refuses.
Point number 4. An error message is a message to your AI.
A surprise gets hidden, which keeps your secrets safe. A failure you saw coming gets a plain sentence, and Claude can act on it.
Point number 5. Resources and prompts cost the same 3 steps as a tool.
A resource is something Claude can look at, and a prompt is a job you saved. The model picks the tools. You pick the resources and the prompts.
The list
And if you remember one thing from this whole module, remember the list.
1. Write the plain Python function
2. Put the @mcp line above it
3. Write the one-line docstring
4. Restart Claude Desktop
5. Ask Claude to use it
Write the plain Python function. Put the @mcp line above it. Write the one line docstring. Restart Claude Desktop. Ask Claude to use it.
You have run that list 2 times now. The second run was quicker than the first, and the list never changed by a word.
Oh, and one more thing worth carrying forward. External intelligence. Your drafts sit outside what the model was trained on, and Scribe is how they get in.
What comes in module 3
So what is coming next?
Module 3 opens with a quiet mistake.
Your server can write now. So it can also write over the wrong document. And there is no undo that you can reach from a chat.
In module 3 we make Scribe safe to trust. It will stay inside its folder. It will ask before it writes over anything. And it will remember what you told it.
Grab the module 3 checkpoint before you start. It holds your full server as it stands today.
So where does our map stand at the end of module 2?
11 boxes lit, and 5 still dark. The hole is gone, and the next box to light up is the guard.
Bye now, and I will see you in the next lesson.
What we covered
- The official Google Drive server reads and cannot write: 1 tool (search), drive.readonly scope, archived. Nobody had built the thing you needed.
- A tool is a plain Python function with 2 small additions, the @mcp.tool() line and a one-sentence docstring. Name, description and inputs are built from them (reason 3 from module 1, paid off).
- You proved it: the real document changed, Drive named Scribe as the editor, a second app used the server with no new code, and Scribe cannot create files because Google refuses.
- An error message is a message to your AI: hide the surprise to keep secrets safe, give a failure you expected a plain sentence Claude can act on.
- Resources and prompts cost the same steps as a tool. The model picks tools, you pick resources and prompts. The 5-step list ran twice and never changed by a word.