Lesson 11 of 30, Module 2: Your First Server. Your own server edits real documents in your Drive folder.
What you can do after this lesson
Before you build a tool, find out what already exists and read the permission scope it asks for. A scope decides what a program can do, and Google enforces it every time. A read-only scope explains the gap, and the gap is your reason to build.
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.
Tools
- search
Search for files in Google Drive
Resources
- Files
Supports all file types
scopes: [
"https://www.googleapis.com/auth/drive.readonly"
],
npm warn deprecated
@modelcontextprotocol/server-gdrive
Package no longer supported.
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
One typo, two files
Today I ask Claude to fix 1 typo in my Google Drive. I end up with 2 files that have the same name.
Hello, and welcome to lesson 11 of the MCP Masterclass, and welcome to module 2. In module 1 you got set up, and you felt the problem. Today we meet the wall that your first build climbs over. And we start with our map, as always.
6 lit boxes, and 1 hole in the middle. That hole has been open for 10 lessons, and this module is where you fill it.
What already exists
Well, before we build anything, let us look at what already exists. If somebody has built this already, you should not build it a second time.
A quick reminder first, since this is a new module.
MCP is nothing but a universal remote for AI. One handset, and it drives everything in the room.
A server is nothing but a small program that offers jobs to your AI. And a tool is nothing but one of those jobs.
So let us start with the good news.
There is an official Google Drive server. It comes from the same people who look after MCP itself.
Here is what it offers, taken from its own page.
Tools
- search
Search for files in Google Drive
Resources
- Files
Supports all file types
It has 1 tool, and that tool is search. Then it offers your files as resources.
A resource is nothing but something your AI can look at, once you hand it over.
Do you remember external intelligence from lesson 2? Your drafts sit outside what the model was trained on, and a server like this one is how they get in.
Why you are watching, not installing
Now, I made you a promise at the end of module 1. I said you would install this server yourself.
I am changing that, and I want to tell you why.
This server cannot use the key you made in lesson 4. It wants a different kind of key, where Google asks a human to sign in and agree.
That means a consent screen, a second set of keys, and a sign in step in your browser. That is a lot of clicking for a server we are about to leave behind.
So watch me do it instead. And if you are curious, the full steps sit in your module 2 checkpoint.
The live demo
So here it is, running inside my Claude Desktop. I ask Claude to find my draft, and to read it to me.
On screen: Claude searches with the official gdrive server, finds draft.md, and says it cannot pull the text.
Claude searches my Drive. It finds the file.
And then it stops. Claude can see the name of my draft, and it cannot open it.
Look back at that list, and you will see why. The server has a tool that searches, and it has no tool that reads.
But Claude does not give up. It tells me that Claude Desktop has a Google Drive connector of its own, built in, and it asks me to switch that on.
So I switch it on.
On screen: the Google Drive connector is switched on for the chat. Claude reads draft.md and points at the typo, "Ths".
Now Claude reads the whole draft, and it spots the typo straight away.
So I ask for the one thing I actually came for. Fix the typo.
On screen: Claude asks "Claude wants to use Create file from Google Drive". Allowed. Claude answers that the connector cannot edit a file in place, and that there are now two files named draft.md.
And look at what Claude asks for. It wants to create a file.
I say yes, and Claude tells me that the typo is fixed. Then it tells me the catch, in its own words. The connector cannot edit a file in place.
So it saved the corrected words as a brand new file, right beside the old one.
On screen: the Drafts folder in Google Drive, with two files named draft.md.
Here is my folder. I now have 2 files called draft.md. One has the typo, and one does not.
And Claude is asking me whether it should throw the old one away.
Well, I did not ask for a second file and a clean up job. I asked for 1 word to change.
Do that 10 times a week, and your folder fills up with twins.
Why it cannot save: scope
But you must be thinking, Dheeraj, why can the official server not simply save the file?
The answer is one word, and the word is scope.
A scope is nothing but a permission slip. When a program asks Google for access, it names what it wants to do. Google then holds it to that, every single time.
Here is the permission slip the official server asks for. This line is copied from its source code.
scopes: [
"https://www.googleapis.com/auth/drive.readonly"
],
Look at the last 2 words. drive.readonly.
Think of it like a visitor pass to a library. You can walk down every aisle, and you can look at every book. You cannot write in a single one of them.
So nothing is broken here, and nobody forgot anything. The server was built to read, and Google will refuse anything else from it.
Where we stand
And there is one more thing you should know about this server.
It has been retired, and its code now lives in a place for servers that nobody looks after any more.
Install it today, and this warning is the first thing you see.
npm warn deprecated
@modelcontextprotocol/server-gdrive
Package no longer supported.
So nobody is coming to add a save button to it.
So here is where we stand. There are 2 ways into your Drive already. One of them finds your draft and cannot open it. The other one opens it, and cannot change it where it sits.
Now, I want to be fair to both of them.
Reading only is a safe place to start, because a server that cannot write can never damage your work. And making a copy is a careful thing to do with a file that belongs to somebody else.
Hold on to that thought, because the whole of module 3 is built on it.
The gap, and Scribe
But it does leave a real gap. Nothing opens your draft, changes the words, and leaves you with 1 file.
And that gap is the whole reason your first build is worth writing. Nobody has built this one for you.
So what are we going to build?
We build a server called Scribe, and it starts with 2 tools. One tool reads a draft. The other tool changes it, right where it sits.
And Scribe uses the key you already have from lesson 4. There is no consent screen, and no second set of keys. It can reach the 1 folder you shared, and nothing else in your Drive.
Your checkpoint and what is next
One thing to do before the next lesson. Grab the module 2 checkpoint.
It holds 3 sample drafts, a pinned package list, and 2 small scripts that prove your server works. Upload the 3 drafts into your Drafts folder in Drive now.
So where does our map stand at the end of this lesson?
Still 6 boxes, and still 1 hole in the middle. But now you know exactly what shape fills it.
Next lesson you will write your first MCP server, and the tool that edits.
Bye now, and I will see you in the next lesson.