Syntax Video
MCP Explained | What, Why and How
- 0:00 Intro
- 0:30 Everything is Inputs and Outputs
- 1:55 How LLMs are Created
- 3:06 LLM Context In Commercial Services
- 4:29 LLMs are Static
- 4:54 List of Tools as Context
- 5:17 LLM Tool Calls
- 7:42 The LLM Loop
- 8:27 What is MCP?
- 9:40 Weather MCP Server Example
- 12:12 Building MCP Servers with SDKs
- 13:51 Weather MCP Server Code Walkthrough
- 17:45 Local MCP Servers with stdio
- 20:34 Remote MCP Servers
- 24:34 Debugging and Inspecting MCP Servers
- 29:03 Awesome MCP Servers
- 29:36 MCP Recap
- 29:56 MCP Servers in Cursor
- 30:23 context7 MCP Server
- 33:18 MCP Servers In VS Code Github Co-Pilot (FREE)
- 34:47 MCP Server Setup in Gemini CLI (FREE)
- 36:25 Web Scraping and Undocumented APIs in MCP Servers
- 38:01 MCP Client Support
- 38:51 Sentry MCP Server
- 42:18 Thanks!
Intro
In this video, we're talking all about MCP or model context protocol. Talk about what it is, why it's needed, how to build your own servers, how to integrate with existing ones, how to debug them, and everything in between. That sounds good to you, let's dive in. My name is CJ. Welcome to Syntax.
[Music] Now, before we talk about MCP, let's take a step back and just talk about how LLMs work. Now, if you're already familiar with all of this stuff, go ahead and skip ahead. You can see the timestamps in the description. But for all of this, including LLMs and MCP, we can think about things in terms of input, some process or blackbox, and some output. And the world of programming is like this as well. And a simple example of this is an add function. So add we can think of as our black box. Our inputs might be two numbers. So let's say we pass two and two into this add black box. And then the output of this would be four. Now add is predefined, right? we we know how to add two numbers together. It's mathematical. We can basically take any two numbers and add them together.
Everything is Inputs and Outputs
There's a very specific algorithm for doing that. We can also think of a black box that has a more interesting process. So for example, a text predictor. So let's say we have this black box called text predictor. It takes input which is text and spits out text as output. And one example might be if we pass in Mary had a little, we might expect that the text predictor responds with lamb. uh because Mary had a little lamb is pretty common uh in the English language. Now, what actually happens inside of this text predictor, we don't know. Um we could come up with ways of creating a text predictor that isn't an LLM. We could come up with like a list of word pairings and say like 80% of the time when the words Mary and little appear in a sentence, lamb is likely the next word to occur. Like we could come up with our own algorithm for that. But LLMs are basically this with a much more complex process to come up with them. And it's not a specific algorithm. So the way we create an LLM is also through this input output process. So in this case the blackbox is training. The input is going
How LLMs are Created
to be some training data and the output is going to be the LLM itself. Now this training data in a lot of cases might be question answer pairs. So it might be a million different sets of questions and answers and we build out a neural network based on those questions and answers. And we built out this large language model that given some question will output a seemingly correct answer based on all of the data that it was trained on. But it's interesting to see that even the creation of an LLM is an input output process. Now once we have an LLM, it works exactly that way. So given some user input, it spits out some output and it actually is a text prediction model. So, as much as we might think that LLMs are smart or doing more than than what they actually are doing, for the most part, they're just predicting the next piece of text, the next token in any given sequence. And it actually turns out that if your training data is good enough and large enough and general enough, you actually can get an LLM that can work in most cases and seem
like it's actually pretty smart to be able to uh answer questions or or give facts about certain things. Now, when you're interacting with an LLM in a tool like ChatGPT or Claude Desktop or even like Cursor IDE or VS Code with GitHub Copilot, there's actually a lot more that goes into this user input that is eventually passed to that LLM. And it looks kind of like this. So, you typically have some kind of system prompt that you don't have access to, but the owners of this LLM service, whether it's OpenAI or Google or Anthropic, they've come up with some kind of system prompt that makes sure that the output it generates aligns with maybe their ideals. Maybe it adds some safety guards. Maybe it has a specific personality. And so this system prompt is going to to describe that. If you use prompt like ChatGPT or Claude Desktop, you know that sometimes it lets you save preferences like I want the LLM to always output the most succinct answer always or I don't want you to always agree with me. You should push back. So with tools like ChatGPT and and Claude Desktop, you add those in your user preferences and then those are sent
LLM Context In Commercial Services
along to the LLM in every single message that you send to it. The other aspect of this that gives us this answer response flow is your chat history is included in this when sending it to the LLM. And then finally, you have the actual user prompt. So that's the question you just asked or the follow-up question or whatever you just typed in, that's going to be the last thing included in what gets sent to the LLM. And so all of that gets wrapped up together, passed to the LLM, and then we get some output. In this case, it's going to be the response to the question or the follow-up that you just sent. Now the one thing to note about this whole process is this LLM is standalone. It doesn't have access to the internet or to the outside world.
LLMs are Static
Basically it was trained once created and now all of your interactions with it are just with this black box. It has no way of of reaching out and getting new data. It's a snapshot in time based on all of the data that it was trained on. And when we interact with it, we're interacting with that snapshot. So there's no connection to the internet. Now, to get around this, we can actually insert another thing into this context that we're sending to the LLM along with the user's latest prompt. In this case, we'll send a list of available tools.
List of Tools as Context
And so, these are all things that the LLM could potentially invoke if it thinks it needs to perform an action or needs to go get more data. Essentially, every single call to the LLM, it knows what tools are available. An example of this might be let's say we have a tool available called get weather and we have another tool available called get coordinates and in this context window we say those two tools are available when you call them you specifically need to pass in latitude longitude to get the weather and then for the get coordinates tool you need to pass in a place name and so all of that information about those tools and how to call them is included here and let's say the user's prompt is what's the current weather in Denver Colorado part of the system prompt here is will say you can call these tools if you believe it has information that you might need. And so the LLM is going to think on this. It's going to see all of that context window.
LLM Tool Calls
It's going to see the available tools. It's going to see the fact that it can call tools. It's going to see the user's input, which is what is the current weather in Denver, Colorado. And it might decide, hm, I know that I was trained on past data. The user wants very relevant, up-to-date information, and I have tools available that I can call. First, let's actually call the get coordinates tool because I want to be able to call the get weather tool, but I need some coordinates first. So it might actually output, hey, I would like to call the get coordinates tool for Denver, Colorado. And that's literally all it outputs. After that, it's done.
But this output here says call this tool with the input Denver, Colorado. From there, the host application like chat GBT or cloud desktop or cursor. They will see that tool call and now they'll actually make the call. And so the tool itself can reach out to the internet. And the tool can be thought of as something that has inputs and outputs. And so in this case, the input is Denver, Colorado. The tool is get coordinates. It's going to call some web API that geoloccates things. So given the name of a place, it can come back with latitude longitude and its output are going to be the latitude longitude of Denver, Colorado. From there, we can now send all of that back into the LLM.
So the tool output here will have the latitude longitude of Colorado. And in this case, the same user input of what is the current weather in Denver, Colorado. But now the LLM will potentially see, oh, uh, I have the coordinates and I want to know the weather. So maybe I'll make another tool call that will actually give me the weather based on some coordinates. So its output would actually be a tool call and then that will call the tool that will reach out to the API get the weather specifically for those coordinates and then all of that will again be included and finally the LLM will see okay I have the coordinates I have the weather forecast in my tool output and the user just asks what's the current weather in Denver Colorado.
Okay, I think I can answer that question without calling any other tools. And then it will just answer the user to say what the weather is based on the the fact that it just got that weather forecast from that tool. And so when you're sitting at home talking to chat GPT or anything else, this process is just happening over and over and over. Every single time you send a new message in that chat window, this whole process is happening where if you have any tools available and you just ask the AI for something that it thinks it should invoke the tool for, it's going to invoke that tool. And then when the tool result comes back, that whole context of your conversation, the tool response, your latest question is all going to get passed back into the LLM. So it's this this loop where this context window here kind of just grows and grows as you chat with that LLM more and more. Now this is the current state of things.
The LLM Loop
Essentially, if an LLM wants to have more up-to-date information, it needs to call these tools and all of the various tools like ChatGPT and Claude and VS Code and Cursor and all of these other things that can talk to LLMs have implemented a flow like this. Now, this is where MCP comes into play, which is the model context protocol because there's lots of different LLMs. There's lots of different clients that we can use to talk to LLMs and MCP was essentially an effort to standardize how these host applications and LLMs can talk to these various tools that are available. So, the model context protocol specification defines how an MCP client or host application can talk to an MCP server. talks about the kind of things an MCP server can expose like tools or prompts or resources and basically all of this is defined in a standardized way so that any application whether it's ChatGPT or Claude or Cursor or VS Code which in this case are
What is MCP?
going to be the MCP clients can all implement this way of talking to these servers and then regardless of who defined that server any one of these client applications can start to talk to it and this essentially opens up a whole world of connecting LLMs to the internet and data sources and all of the stuff that it doesn't have access to that is like the most up-to-date information or the most relevant information about a specific user or a specific company. Now these LLMs can get access to that information in a standardized way. Now I actually developed a tool for getting the weather based on a location and let's see it in action. So I'm just going to say what is the weather like right now? And because I set up Claude Desktop with access to this MCP tool, you'll see that it first responds and says, "I'd be happy to help you check the current weather to get accurate weather information for your area." I'll need to know your location. Could you tell me what city, state, or country you're in? So, because I made these tools available, Claude Desktop sees, okay, I have a tool I can call, which is get weather, but that requires coordinates. Coordinates require
Weather MCP Server Example
location. So, the user asks me a very general question. I need to know where they are. So, I'm going to tell them, hey, I'm in Denver, Colorado. And we should see now that it has the context it needs, it's going to make a request out to the tool that I set up. So I have this tool available called get coordinates. And I'm just going to click allow once. And you can see that it called that tool with the place Denver, Colorado. And then from there, it got the coordinates. Now it can call get weather and pass those in. So you can see that these client applications can call multiple tools back to back and they can feed information from one tool called to another. So in this case, got the coordinates. It's going to pass that to get weather. And now we can say the current weather in Denver, Colorado is looking quite nice. It's 79° Fahrenheit, mostly clear skies, humidity of 43%, etc. So each of these actually reached out to my tool, my tool called various APIs to get that data. All of that was put into the context and now Claude has everything it needs to answer in a grounded way than not hallucinate about what the current weather is. And you can
see for get coordinates, my tool literally just responds with some JSON data. So I'm using the Nominatim API which is from OpenStreetMap. Basically given a place it'll give you back a list of place results that include latitude and longitude. So that's one tool call and it responded with that. And then get weather. I'm actually using the pirate weather API and it accepts latitude longitude. There's several different types you can pass in like do you want the current weather, the daily forecast, the hourly forecast, the minutely forecast and you can also pass in units.
You can see this responded with Fahrenheit because I'm in the US and that's what we use. But it also accepts other units like SI and it would respond in Celsius. And then you can see the actual response is just this JSON object that has the current forecast for Denver. And this is the data we got back from the pirate weather API. So you can see how basically making these tools available to a client application allows it to be grounded in the current time and place and what the user is talking about and not just hallucinate things.
Building MCP Servers with SDKs
Now reading this model context protocol spec can be a little bit dense at times. But I want to reassure you that creating tools and MCP servers is fairly easy especially if you just use their SDK. And so you can see here that there's SDKs for many different languages. I specifically work in the world of JavaScript and TypeScript. So I just use the TypeScript SDK. And even just looking at their readme, you can see how easy it is to set up these MCP servers.
And so this defines a server. You register some tools. You define what that tool takes in as input. And then you have a function that will get called whenever that tool is invoked. And this function can do anything. It can talk to an API. It can talk to a database. And so it's this easy to create tools. And then what gets a little bit trickier is how you actually expose these MCP servers. And so in the default example here, it's just using the standard IO server. And that means that this tool whenever it's called is just running directly on your machine. There is a way for you to define a remote server. So that's a that is an MCP server hosted in the cloud and then anytime a host application wants to invoke those tools, it will actually make requests to your deployed server. that gets a little bit trickier because you do need to know how to deploy that and potentially set things up with server sent events or with streaming HTTP. But again, there are SDKs that make that much simpler.
So, aside from all of the spec and protocol descriptions and and everything else that gets into the nitty-gritty, at the end of the day, as someone making MCP servers, really all you have to do is learn about the specific SDK for the language that you're familiar with and then also learn a little bit about the SDKs that have been defined to help you set up a remote server if that's the path you want to go down for your MCP server. Now, let's see my specific weather tool to see how I set all of this up. The codes itself are fairly simple. I just have an entry point which actually creates the MCP server. And from here we register all of the available tools and then expose it over standard io. And then to register a tool you pass in a name. In this case the name of the tool is get coordinates. You can give it a title and then a description. Now I found with the description you can kind of give some hints as to when the host application should call this tool. So here we have get the coordinates of a given place typically the user's location. if you don't know the user's location, ask them for it before calling this tool. And so
Weather MCP Server Code Walkthrough
we saw that happen inside of Claude Desktop. It was like, wait, I want to call that tool, but where are you? I said Denver, Colorado. And then it was able to call this tool and it passed in an input. And so for tool, you can define the input schema. And this is what data needs to be passed to this tool. Now, in this case, we're using zod to say that when you call this tool, you'll pass in place and place is a string. You can see in the description, I also provided some examples of places so that way the LLM could potentially even reformat the user's input to look more like what we're expecting. And then that's what's going to be passed in here. So all of this is the setup. It's the tool name, the description.
Basically, this is what is going to be exposed to the LLM in any prompt that a user types in to let them know that this tool is available. And then we can pass in a callback function. And this callback function is going to get access to that input. So you can see here that it exactly corresponds to the input schema. And so when the LLM calls this tool, it's going to pass in a place and it figures out what that is, right?
Based on the user's prompt or their text or their input, it's going to figure out what to pass into our function here. And from there, we can do the work. In this case, I'm calling an API. So like I mentioned earlier, we're just calling the Nominatim OpenStreetMap API. It accepts a place name, responds with JSON, and in this case, I'm just sending the response exactly back. Now, depending on the tool that you're building, instead of just sending back JSON data, you could reformat this as like markdown. But for these purposes, the LLM is actually really good at just parsing that JSON data that it gets back and it's able to use that in further tool calls. So, we literally just stringify that data we got back from the place search API. And so then the LLM can now use that coordinate data as further context for other prompts or in this case tool calls. Because we saw earlier after it got the coordinates, then it called the get weather endpoint. And so similar idea, we give it a tool name. We give it a title. And for the description, I also give it some hints that say if you don't have the latitude and longitude, you can use the get coordinates tool to get them. So I'm basically letting it know, hey, call this other tool if you want to call this
tool. And then this also accepts in the type. So you can ask for multiple. So you can ask for the current weather, hourly, daily, or minutely. And it can be any combination of these. And then you also pass in the units. Now in this case, when it called the tool, it probably inferred that my local was English. And so it just passed in the units as US. But you can see here on input, we're going to get access to the latitude, longitude, what types of weather they're asking for, and then the units that we should respond with. And then again, we just call an API. So if you look at my get weather function, I'm specifically talking to pirate weather.
I have an API key set up. So that gets passed in. We pass in the latitude, longitude, and units. And then we get back the data. And then from there, whatever the LLM asks for. So if it wanted current, hourly, daily or minute or any combination of those, we include that in the response and then again just respond with the JSON which gets stringified. So these are fairly simple tools and when you're first getting started out with MCP, this is kind of the way you can think about things.
They're really just guided API connectors, right? um they can get much more complex than this and of course you could have a function that itself calls multiple APIs and gathers data for multiple services but on the service level and when you're just getting started this is one way to think about how to build out these tools which is define how the LLM can structure data to call this API and then you write the code to actually call that API now the next thing is how is this thing actually running so here we're using the standard IO server transport you can see we're just importing that in from the SDK and then we're starting the server up Now when we configure this inside of Claude desktop we actually just tell it that it should start this by running this TypeScript file with Node.js. So in Claude Desktop if you press command comma and you head to your developer settings you can see that I have a couple of tools set up. And if you click on edit config that will actually show you where on your computer is that config file so that you can set all of these things up.
Local MCP Servers with stdio
And so if I open this JSON file with Cursor, you can see first of all it has an MCP servers section. And then inside of there, we can set up each of our MCP servers. And for the git weather server, I tell it that the command it needs to use is node. Now, usually you can just specify node right here or python or however you typically would run your program, but in my case, I wanted it to use a specific version of node and I use nvm. So I gave it the full path to that executable. So essentially when Claude Desktop wants to start up this server, it's going to use this node command and then it's going to pass in the argument of the file that it needs to run. And so whenever Claude Desktop starts up, it literally runs Node.js with this file and that's just running as a background process that's going to be able to output data over standard IO. I also gave it the current working directory because this needs an API key, but ended up actually just having to specify my API key directly. So for any MCP server that you're setting up in this way, you can also pass in environment variables.
And in this case, I pass in my pirate weather API key. And when it's running this program, it'll have access to that environment variable. So right now, this is somewhat manual and cumbersome. Uh but I'm okay with this because I'm a developer. I know how to work inside of JSON files. Um and for the servers that I develop, I'm very likely just going to set them up this way, especially if I only need to access them on my computer.
Now, another way you might set up or configure tools is to just use npx. So if these are published to npm, you can actually just specify the name of an npm package and this will run it without having to manually point it to a directory or anything like that. So this is another way of of getting MCP servers set up is you can just pull them directly from npm. Similarly, if you find one on GitHub and you want to run it locally, you could clone it down into a folder and then set it up in a similar way to what I'm doing here. But basically whenever Claude Desktop starts up, it sees that these MCP servers need to be run and it will actually spin up these terminals in the background and then write to standard in and read from standard out in order to communicate with this process that's running. And so this is the the simplest form of MCP.
These are running directly on my machine. That's the other thing to keep in mind here is when I prompt Claude that actually goes off to Anthropic and talks to their APIs and which interfaces with their LLM with which makes this response here. But when it needs to call tools, if they're just set up as local tools, it's literally just talking to a process that's running on my machine. But there are other types of tools that can actually be exposed over the web.
Remote MCP Servers
And one example of this is the currency conversion model context protocol server that Wes Bos wrote. And his code is completely open source. It's on GitHub. And in order to talk to it, he actually has a hosted server at currency-mcp.wesbos.com. And so if anyone wants to add this, it's actually much easier. you can actually just point it directly at his hosted server. So, let me do this right now.
I'm going to add it to my Claude Desktop config. And typically, I've found I need to completely restart Claude Desktop to make sure that it picks up all of those changes. Now, I tried just using these settings exactly for Claude Desktop, but I ran into a bunch of issues, but I did find this gist which talks about how to use Claude MCP with NVM, which is a node version manager. And so they have a few different things you can do with your shell configuration to make sure that this works. So I got all of that working and I created a special command called pnpm for Claude. So this specifically chooses the right version and then here we're using dlx and it can then run this MCP remote command with that server URL.
with all of that now Claude Desktop has the tool and I can say something like convert 25 USD to yen. Of course, you can see Claude Desktop figured out, hey, I need to call that tool. So, we're going to allow it. It calls Wes's tool, which actually reaches out over the web to his deployed server, gives back a response. You can see that he's just responding with some JSON data here, and then it's able to say, "Hey, 25 USD is about 3600 Japanese yen." Now, I'll link all of the resources I found for setting up these remote servers inside of Claude Desktop. But one of the things to note here is this MCP remote tool. So this is just a tool that lives on npm. And essentially you can take any remote server and turn it into a local server.
And right now this is what's needed if you want to do this more developeresque setup of there's a server somewhere. Maybe you're working with a tool that doesn't support remote URLs. MCP remote basically turns it into a standard IO tool. But let's take a look at the actual code that Wes had to write to make this a remotely deployed server. So if you look in the entry point file here, he's actually using MCP agent which comes from the Cloudflare Agents SDK. So his server is actually deployed to Cloudflare that makes these tools available over the web. Now the code for initializing a server is very similar to our standard IO server. You can see here that they register tools, they create an instance of the server, but then specifically in order to expose it over the web, this Cloudflare worker whenever it receives an incoming request can connect to that client, whether it was coming over server sentent events or just over the HTTP protocol and then respond accordingly. But all of the nitty-gritty details of talking over that protocol are handled by the SDK.
And so that's really another takeaway from developing these tools. We're kind of at a point where you don't really have to worry about the specifics of the protocol as long as you're using an SDK. Writing the tools themselves is fairly simple. You can see Wes is just calling out to some APIs given the input and just registering these tools here. But then all of the protocol stuff is handled by the SDK itself. And this is one thing to think about if you are going to be creating a remote MCP server for people to use. You're going to be paying for that server bandwidth, right?
So Wes absolutely is paying the monthly bill for this on Cloudflare to run these commands in the cloud. Now for some users it's easier to set up because they don't have to like download the whole repo and like host it locally. Um and this is probably the way you want to go especially if you maybe have some secret sauce that you don't want to just expose in the tool directly, right? Because if people are just cloning down your repo, they have access to all of the tools source code. But if you're hosting it in the cloud, anything that happens whenever a tool is called could do much more secret things, right? It could talk to a database that maybe you don't want to expose the the password for or whatever else. But in this case, Wes is just reaching out to a third party API.
Nothing crazy, but you could follow this format if you want to kind of hide what's happening in the tool call and not just have it run on the user's local machine. Now, when you're building out your MCP server locally, you're going to want to test it somehow, and it's pretty cumbersome to restart your client every single time you make changes to your server to see it in action. And this is where the model context protocol inspector can help you out. So essentially you can run this command in the folder where you're developing your tool and it will give you a web dashboard where you can actually invoke your tools with various arguments. So for instance I have this other tool which I've been working on which gets web search results from DuckDuckGo. But if I want to run this and debug it, I can do npx @modelcontextprotocol/inspector node and then the name of the file. Now, this will just spin up a local server.
Debugging and Inspecting MCP Servers
If I head to that URL, I get a nice little dashboard and then I can connect to the server. And this is just essentially connecting to it via standard IO. So, it's spinning up that process in the background. And now all of the things that a client application like Cursor or Claude Desktop would do to interact with that tool, we can do from this web dashboard. So, for one, we can list the available tools. And you can see that I have two tools. I have list search results and get URL contents. So for instance, I can call list search results, pass in a search term, and this is going to search duck.go. So let's search for reverse string in JavaScript.
This will run my tool. And you can see my tool responds with those search results that came back from DuckDuckGo. And so as you're building out these tools, this is going to be one of the easiest ways to make sure that your tools are outputting what's expected and test them with various types of input as well. Now, another tool I made available is called get URL contents. And so this essentially just takes in a URL, fetches that page, converts it to markdown, and then responds with the markdown and some metadata about the page. So you can see if I pass this GeeksforGeeks uh URL into my tool, it actually pulls back the description of the page and then all of the content of the page as markdown. And then this could further be used as context whenever an LLM is trying to respond to a user's question. Now, if your tool isn't a standard IO tool, they do support testing out SSE servers or streaming HTTP. So, even if you're running them locally, you can connect here and do things like list tools and make tool calls. And so, like I said, this is great for testing things out before you actually add them into any
host application. Now, after debugging that tool, I can use it, for instance, inside of Claude. And personally, I've been liking using my integration instead of using the built-in web one because it's smart enough to basically choose which of the pages it wants to get the source for and and it's a whole lot faster. So, for instance, if I say search the web or how to reverse a string in JavaScript, it should call my web search tool. So, it's going to list those DuckDuckGo search results. I'm going to always allow it. How to reverse a string JavaScript methods. And then you can see that it got the list of results, but it's like, all right, I need more detailed information. And so now it's specifically going to make a request for one of those search results. And so typically this is actually the kind of question that LLMs are good at answering without tools. But this now grounds its answer in relevant results that it retrieved from the web. Like let's try another prompt like um what are the most
foundational novels in science fiction? what authors are important, compare some of the top stories, and make a ranking of what I should read. So, it didn't immediately reach for a tool, but I can further tell it to uh search the web to confirm your findings. And now, it's going off and and doing the work. So, you can see that it got back the search results for most important foundational science fiction novels, essential reading list. And then from that set of results, it's now going off and getting the full page for each of the ones that it thinks is important. Um, and you can see that it's searching the web even more. So, it did another search for golden age science fiction, uh, Asimov and Clark, science fiction, golden age, big three. So, it came up with all these different search terms to send off to the, uh, search engine, and we can see that happening in real time. So based on my web search, I can confirm that my original assessment aligns with established lit literary opinions.
Fascinating. So this potentially is what this built-in web search tool is doing. But I like how transparent uh this tool is because you can actually see the various search terms that it used and then also the specific pages that it went off and and got to confirm its own findings. Now, before you go off and start developing your own MCP servers, there is this list called awesome MCP servers that has a ton of existing servers that people have implemented that you can try adding to your client applications that you're using. Um, or take a look at the source code to get inspiration for your own MCP servers.
Awesome MCP Servers
And that's actually what I did before I started building out my own. I I kind of looked to see how people were implementing theirs. But this list has all kinds of MCP servers that are worth exploring. I'm going to show you a couple that I've been using that I found very useful. and let me know down in the comments as well if there are some MCP servers that you can't live without. So this is the main idea with MCP. Basically, you have a client application. It can call these tools. To write the tools is fairly simple, especially if you're using these SDKs and then they have some kind of transport protocol. The easiest one is that tool is running locally, just spinning it out over standard IO. It's a little bit more complex if you wanted to communicate over the web with either server events or HTTP. Now, I've been using Claude Desktop for all of the examples I'm showing you so far. But you can set up these tools inside of a lot of other places. So, specifically, if you're inside of the cursor IDE and you press command shift P, you can look for MCP settings. And this is where you can set up all of your MCP servers. Now, within cursor, if you want to add or modify servers, you can click the edit button on any one of these, and it will open up a very similar JSON file that we
MCP Recap
MCP Servers in Cursor
saw for Claude Desktop and can add each of these MCP servers that you want to enable. Now, one of the publicly available MCP servers I highly recommend you add to Cursor is called Context7. And this is an MCP server that has a tool which can retrieve documentation for many many different libraries or frameworks. You can see on the homepage some of the most popular ones that are available. And so essentially what they've done is they've indexed the documentation for all of these things.
context7 MCP Server
And if you're ever asking Cursor to do something and it needs more context about what you're working in or what library you're using, it can use this tool to retrieve the specific parts of the documentation that might help with that. Now, to see context 7 in action, I actually used it to help me write the code to talk to the pirate weather API. And so, if we open up a new chat window here, and I say, uh, call the pirate weather API. The last time I did this, it was like, I have no idea what the pirate weather API is, so I can't help you with that. But let's see. Let's see what it outputs this time. Yeah, you can see cursor is trying it's trying to find the context. It's like, uh, what is that? What is that? Um, so yeah, there are no references to the pirate API. Uh, the typical endpoint is this URL. Uh, I have a feeling it figured that out because of the current context because I like deleted the code that that already talks to it. But check this out. Let's start a brand new chat window and let's say uh get the docs for the pirate weather API. You'll see that it actually makes a tool call to resolve library ID.
And so this is a tool that is available via context 7. And so it's going to find the library ID for the pirate weather API. And then it's going to get the specific docs for pirate weather. And then this just gives me the base documentation. Um, now I haven't worked with this a ton, so this is kind of how I found it useful. Essentially, this kind of primes the chat window here to know that it has this documentation available. And so now if I ask it to call the API, it might even further query their docs to find the specific part that it needs. So let's ask it now.
So let's say uh call the pirate weather API with the included options. And with that, it was able to actually know the exact endpoint it could call. And also given the docs, it knows that it can pass those units in via query params in the URL. So this is just one example of using Context7. If you're working with any library or anything else, you can do the exact same thing where in a chat window you say, "Hey, give me the docs."
It adds it to the context and then also it didn't happen this time, but potentially also it will make further calls to get other parts of the documentation because you can see in Context7 some of these docs are hundreds of thousands of tokens, but their API essentially allows you to add like a search term and then also set the number of tokens that should be returned. And so their tool is smart enough to only give the right amount of context to still keep the token window open to still leave enough room in the token window so that the LLM can open. Um so yeah, Context7 is an awesome tool. I definitely recommend you install it in cursor if you haven't yet. Now speaking of other clients, you can also add MCP servers into VS Code. So, inside of VS Code, if you press command shiftp and do mcplist servers, one of the cool things about VS Code is it will detect if you have Claude Desktop installed or Cursor installed, and you can see that it's actually allowing me to connect to any of these MCP servers that are actually configured inside of those other tools. Uh, so if I
MCP Servers In VS Code Github Co-Pilot (FREE)
want to get access to Context7, I don't even have to further configure it. I can just say, hey, start that server. And now inside of VS Code, I have access to that tool and it's nice and configured. So if we open up a chat window and say uh get the docs for hono, you can see that it's making a tool call. It's going to reach out and find the ID for the hono docs and then actually grab those docs. So that's just like the main documentation. And then let's say you're trying to do something more niche. You could say something like how do I add the CORS module in a Hono app? Now it was able to oneshot that. Let's come up with something that maybe is not at the top level of the docs. Let's just say uh how can I set up open API with my Hono app. It's oneshotting everything. But honestly, this is kind of amazing because all of my other experiences uh trying to use like Hono isn't that new, but it's not as popular. So, pretty often LLM can't get it right. But this is just getting it right. So, I have to keep working with this. All I know is
that this is making my life a whole lot easier. and the LLM makes up stuff a whole lot less because it's actually grounded in the documentation. Now, another spot you can set up MCP servers is inside of the Gemini CLI. And so, if you're not paying for Claude Desktop or Cursor, Gemini CLI does have a free tier. And also, VS Code with the Copilot extension has a free tier. So, you can get started testing out these tools and using them with either of these things, at least for now, while they still have a free tier. But once you've installed the Gemini CLI, you can actually create a Gemini folder inside of your repo and inside of there you can set up a settings.json file and it's exactly the same as this settings file that we've set up for Cursor and VS Code and Claude Desktop. Essentially, you have an MCP server section. Specify the servers you want and then you tell it how they should run. And so this is another MCP server I wrote called Denver events that calls a few different APIs to figure out what's happening in Denver today. and let's see if I can get it to call those tools using the Gemini CLI. So, it's up
MCP Server Setup in Gemini CLI (FREE)
and running. I'm gonna ask it, is there a Rocky's game today? This is typically something we want to know living in Denver because either you want to go to the game or you want to know that there's going to be some traffic because the game is happening. Um, and you can see that it detected that I have specifically a tool called list Rocky's home games. And I'll say yes, allow that tool to run. It spits back all the upcoming home games for the Rockies and then uh Gemini is able to respond to say no, the Rockies are not playing today, but they have a home game tomorrow, July 1st, against the Houston Astros at 6:40 p.m. And so the Gemini CLI is typically for working with a code base. But as you can see, it's can still call tools that have nothing to do with code. And really, this is just another example of a different client being able to call these custom tools that I created. Now, this Denver events MCP server, I think is a good example of getting specific data that technically you could get via just a web search, but it's more targeted, right? So, specifically get Rocky's home games or specifically get
Web Scraping and Undocumented APIs in MCP Servers
all the events happening at the Mile High Stadium, which is where the Broncos play, or specifically get events happening at Ball Arena. Now, you might have used ChatGPT or Claude Desktop, and every now and then when you type something in, it'll actually search the web, and it could potentially answer some of these questions, but this is specific data about these things that's going to allow it to have just slightly more context when it's answering these types of questions about the the Denver area. And really, the main thing I want to point out about these tools I created is I kind of just found some undocumented APIs and then did just a little bit of scraping. So specifically, if you look at the list Rocky's game, I found this mlb.com endpoint just by looking at the network traffic. And I'm actually able to directly get back JSON data that has the schedule. And you'll notice that I'm I'm not spinning up a web browser to navigate to this page and get the contents and everything else. So this is a whole lot faster to get back that relevant information than trying to search the web or go directly to a
website. And I did the same thing with Ball Arena. I was looking at the network tab. I found that they had an undocumented endpoint. I'm making the request against there. And same thing with Mile High Stadium. They actually have some endpoints that return some JSON data. So this is really just an example of you may not necessarily need to spin up a browser or need to do any sort of scraping. If you can find some undocumented endpoints, you can turn those into tools as well. Now we mentioned that these MCP servers can expose several different things. Tools, prompts, and resources. Now, there are a lot of different clients. We've talked about a few so far, like Claude Desktop and Cursor and VS Code, but each of these clients has varying levels of support for all these features of MCP.
MCP Client Support
And so, there's actually a table on the model context protocol website that lists out all of the clients and says what they actually support. Now, the majority of clients support tool calls like Claude Desktop, Claude Code, Cursor, VS code, all all of those that we're mainly used to and a lot of these others can make tool calls. But from there, it's kind of in up in the air of whether or not they support it yet. And so things like resources, prompts, uh resource discovery, sampling, or roots has limited support across all of these clients. So your mileage may vary. Um but I would check out this page to see specifically what is supported. Now, another MCP server I use is the Sentry MCP. So every video you see here on the syntax channel, every podcast episode, everything we put out is brought to you by Sentry and they allow you to integrate all of the issues that are reported in the cloud into your editor directly using their MCP server. So you can see here I'm logged into the Sentry dashboard and we have all of these ongoing issues. We can see when an issue
Sentry MCP Server
occurs. We can see what exactly the user was doing when that issue happened. But what's great about their MCP server is I can have Cursor open directly inside of the site itself and then use the context of those issues to help me solve and fix some of them. So with the Sentry MCP server installed and enabled, it's super simple. You just point it at mcp.sentry.dev.
Now whenever I'm in a chat session, I can ask it for issues and also ask it about specific issues. So for instance, I can say list all the issues in the Sentry syntax project and it's going to start calling those tools. And you can see here it's calling the find projects tool. And you can see that it figured out via my prompt here that specifically I need the organization called syntax-f.
So it's going to find all the projects. It should find our website and then it's going to list out all the issues. Now this is great, but it's really no better than just going to like sentry.io. One of the cool things is we can start working on a specific issue. So let's say I grab the issue ID like this one. So so this is returning an error when someone attempts to make a post request against this URL. And I think really what we should be doing is just returning a 404 because people shouldn't be able to make post requests against that endpoint. Uh so let's do this.
Let's just say let's try and fix this. We should just return a 404 instead. So first of all, it's going to analyze this issue using Seer. So, Seer is actually an AI debugger that Sentry makes available and it can actually see all of the times that this issue has occurred.
It can see the source code and it has a much better idea of how to fix it than if Cursor were to just try to go off and and try to fix this issue. So, Seer is off running in the background and it should potentially come back with some fixes for us. So, we'll give it a second and we'll see what it comes back with. So you can see Seer came back with an analysis of what to do and now that's being fed as context into Cursor so that it can figure out what to update and in this case it's just adding a default 404 not found action to the specific route but one thought I had is is this really the way to do this so we're going to add further context and so I talked about using Context7 earlier which basically embeds docs as context so I said let's check the docs for SvelteKit 5 and make sure that the updated code is is correct and doing the right thing. So, Context7 is is now running and it's going to go off and get the docs for SvelteKit. And based on getting the docs, it says this is the right way to do it. But at this point, Sentry has done what it needs to do. So from within the editor, I didn't even
have to go out to sentry.io. I was able to list out the issues, target in on a specific one, and then reach out to Seer to automatically solve that issue, integrate that context back into Cursor, and then instantly update the file. So this is fantastic, right? Uh, basically a user runs into some error on your website and you can instantly get all the context you need to solve it right from within your editor using the Sentry MCP. If you want to try Sentry out in your own projects, head over to sentry.io/syntax.
Use code tasty treat. You'll get 2 months free. Thanks so much for watching. If you have any resources for MCP or servers that you like using, let us know down in the comments because I'd love to explore them as well. Also, if there's more info that you think people in the comments might need based on the stuff that I talked about, let us know as well. That's all I have for you in this one. I'll see you in the next one.
Thanks!
Quote it with credit and a link. Quoting Syntax