📄️ Consuming a server with Visual Studio Code
Visual Studio Code can be used to consume a server. The idea is that Visual Studio Code can be used to run a server and then the tool can be run via GitHub Copilot chat. This is a great way to create an "agentic" app.
📄️ Activity: Consume server with Visual Studio Code
For this exercise, keep using the hello-mcp server that you created in the previous exercise or clone an existing repo here:
📄️ Consuming a server with an MCP client
Another way to connect and consume an MCP server is by using a client. This is similar to how you would connect to a server using a web browser or a command line tool like curl. The client programmatically connects to the server and sends requests for tools, resources and more, receiving responses in return.
📄️ Activity: Creating a client
To create a client, we'll use a similar set up as with the server. At high level, here's what we need to do:
📄️ LLM Client
An even better client can be built by adding LLM capabilities to it. How do we do that? We can use the OpenAI SDK to call an AI model, for example, GPT-3.5 or GPT-4. A good free alternative is using GitHub Models.
📄️ Activity: Create an MCP client using LLM
Let's add an LLM and ensure the LLM is what's between the user and the server. Here's how it will work on high level: