MCP stands for Model Context Protocol, and it's
a standard for exposing tools and resources
to AI tools, to Claude code or
similar tools. And there's a broad variety
of MCP servers you can add to Claude code.
The official documentation has a list of some popular options.
And the idea behind all these MCP servers
is simply to give Claude code more tools and more
resources it can leverage. And specifically, it will leverage them
when it needs to just as it will do web search when it needs to
or when you tell it to. And one specific MCP server that can
be very useful, in my experience, is the context7 MCP
server. That is an MCP server that you can add to Claude
code that gives Claude code easier access
to official documentation of libraries.
That's the entire idea behind that server.
It makes browsing documentation for Claude code
way easier. On that MCP
server GitHub page, you also find installation
instructions for Claude code, and of course, you find a link to
that GitHub page attached. And all you need to do
is copy this command here, go back to your
system, open a terminal, and then you wanna run this command.
Important, you can remove this API key part here.
You can pay for this server to get higher access limits, but
you can also use it for free, at least at the point of time where I'm
this. So if you now hit Enter, this will install this
MCP server to Claude code. And if you thereafter open Claude
code and you run /mcp, you should see this
MCP server as installed. Now, if you want to
install this MCP server not just locally
but globally so that all your projects have access to it, you can add
the --scope flag here
and set that to user. So if I run this, this gets added
as a global MCP server to my system, so now that all my
projects can use it. Now, with that MCP server installed,
Claude code can browse this documentation.
What I'll do here is I'll copy my prompt and actually
close this Claude code instance by pressing Control C twice,
and then I'll restart it here and paste that back in,
formatting is a bit broken but that's not too bad, so
code also has access to the installed MCP servers.
At the bottom, I'll say use web search or the
context7 MCP to find relevant documentation.
So I'll simply give Claude code one other tool for
exploring and finding the relevant context it needs for
this prompt. Now, as mentioned, you can, if you know which
sources are needed, absolutely copy them in by hand.
That's the safest way of ensuring that just the right information is
available. So, that is absolutely something you wanna do.
But if you don't know exactly which documentation articles are
relevant and you don't wanna look it up right now, you can also rely
on web search and MCP servers like the context7 MCP
server. With that, I'll switch to plan mode
Claude code do its thing and use these tools to
find the relevant documentation and make a plan for implementing the
database and authentication. Now, here, since it's the first time
it's using that MCP server, it's asking me for permission, and
yeah, I don't wanna get asked again for the
It's a good sign though that it wants to use it, of course.
And here, I'm not sure why the display is broken like
this. It works to some degree if I highlight it, but it
now made a plan and I can see that it correctly wants
to import the database class from bun SQLite
and set up a database, run some queries to use WAL
mode, which is better for performance, and
then also set up the tables for user,
session, account, verification,
and also notes, which are the tables I have in my spec.md
file. Then it also creates some indexes
and then it sets up the auth.ts file where it wants to use the
database handle from the db.ts file, set up an auth client file, which
BetterAuth indeed recommends in their documentation, set up a
auth cache-all route, which BetterAuth indeed needs with the
to-next-js handler, which BetterAuth also needs,
in a lib folder. So that plan looks good to me,
like this. I wanna clear the context and auto-accept edits and let
it do its thing. And, of course, the fact that we have a
good plan here is because we used plan mode, but we also
gave it some relevant instructions and context now
by clearly pointing it at its web search tool and by giving
it this extra documentation-focused MCP, the
context7 MCP. And it wants to start the development
server to verify this, but I don't want that, so I'll say no.
And what you can always do if you decline or also if you
allow something, is you can hit Tab with
extra information, so for example, a reason why you don't grant that,
also provide extra information if you do grant it.
So here I'll say I'll run the dev server myself, just to check for TypeScript
linting and build errors. And therefore, it now does run the lint
command, the build command, and it's done.
So now I reloaded this and resumed this conversation to get rid
glitches, but it did now indeed successfully go
plan.