Interacting With the MCP Server
00:00 After connecting your custom MCP server, how do you use it? Well, you just use Cursor to interact with an LLM, and you write prompts that trigger interactions with the MCP server.
00:12 In this instance, your MCP server defines a tool that lists sales of specific customers, so if you ask the LLM about the sales of a specific customer, the LLM should realize it needs to use the MCP server. So go ahead and open Cursor.
00:29 Once you’ve connected your MCP server, make sure it’s toggled on and there is a green indicator saying that it’s running correctly. In your menu, go to View, Command Palette.
00:42 You click that, and then you type New Chat to open a new chat window. On the right, you will see the chat window that Cursor provides for you to interact with LLMs.
00:53 You can pick different models or different types of interactions depending on your plans. The defaults should be fine, and now what you want to do is write a prompt that hopefully triggers the LLM to interact with the MCP server.
01:05 You could ask something like, what’s the total sales for the customer Alice? And if you run that, give it a couple of seconds, in the thinking trace of the LLM, you should see an interaction with the MCP server.
01:23 Since you’re running a tool, by default Cursor will ask for your permission to run the tool, because tools are functions that interact with your environment, and they might involve accessing the network, interacting with the file system.
01:38 So to make this more secure, Cursor will ask for your authorization. If you press Run, then Cursor will run the MCP tool, and then you get a funny final result, which is 100,100, but that’s because Alice’s sales were 100 and 100, and the LLM just concatenated them.
01:59 The result should have been 200, so the response is wrong because the model is weak, but that doesn’t take away from the brilliance of what you just did. And if you click on the tool call, you can see that Alice was the name that the LLM passed to the tool, and you got the results 100,100, which is what the tool returns.
02:20 And this unlocks innumerable possibilities if you think about it. Regardless of the project you have, as long as you can write some Python code that interacts with the data of your project, you can have an LLM interact with it through tools in an MCP server.
02:37 And in the next lessons, you will unlock even further possibilities by working with resources and prompts.
Become a Member to join the conversation.
