
AI tools with MCP in practice
You're chatting with your language model and find it's not updated enough or lacks information. Perhaps it suggests something, but why doesn't it do anything about it?
Contents
In the previous article, we went through how you as an organization can adapt your site to other AI models. In this text, we discuss how you can optimize and adapt your own models.
One way to extend what your language model can do is what is called tools or function calling. Here, we go through a bit about how tools work and how you can build them yourself with a focus on an open protocol called Model Context Protocol (MCP).
Tools
Tools, which are used to extend what a language model can do, can be divided into two groups;
Information Retrieval. Tools in this group can retrieve information from external sources such as databases, the web, and file systems. The goal is to extend knowledge beyond what already exists in the model so that it can answer questions whose answers are not included in the model. This could be information that was not available when the model was created or private information that could not be used when the model was created.
Taking Action. Tools in this group can perform actions, e.g., send emails, create messages on Slack, book a lunch, order new parts, or trigger a process. The goal is to automate a task that would otherwise require human effort.
How to create an AI-Tool
To create an AI-tool, there is a standard Model Context Protocol (MCP) that we focus on in this article, but there are also other alternatives such as:
- Function Calling (OpenAI API)
- Function Calling (Gemini API)
- Product-specific ones like Optimizely's Opals tools.
Model Context Protocol (MCP)
MCP provides a standard for applications to share contextual information with language models, offer tools and functions to AI systems, and build composite integrations and workflows.
The protocol uses JSON-RPC 2.0 for communication between
-
Hosts: LLMs that initiate connections
-
Clients: Connections in the host application to servers
-
Servers: Services that provide context and functions
There are three different transport methods for MCP communication, where we recommend using Streamable HTTP or STDIO.
Streamable HTTP uses HTTP POST for client-to-server messages and optional Server-Sent Events for streaming capabilities. Streamable HTTP also offers remote server communication and supports standard HTTP authentication methods. MCP recommends using OAuth to obtain authentication tokens.
STDIO uses standard I/O streams for direct communication between processes on the same machine. This provides optimal performance and no network overhead. (We should no longer use SSE; Streamable HTTP is what applies for remote servers).
Functions
A server offers the following functions to clients:
-
Resources: Context and data for users or the AI model to use
-
Prompts: Templated messages and workflows for use in the model
-
Tools: Functions that the AI model can execute
Clients can offer the following functions to servers:
-
Sampling: Allows the server to request responses from the client's AI model. Useful when the server's creator wants access to an LLM but wants to be independent of a specific model.
-
Logging: Server can send log messages for debugging or monitoring
-
Elicitation: The server needs more information from the user. Useful when more information is needed from the user or to obtain permission to perform a function.
Why is MCP important?
What MCP offers depends on your role;
-
For Developers, MCP makes it easier and faster to integrate with an AI application or agent.
-
For AI applications and agents, MCP offers an ecosystem of data sources, tools, and applications that provide extended capabilities and improve the experience for end-users.
-
For End-users, MCP provides better AI applications and agents that can use your data and perform functions for you.

CEO / CEO
Contact Martin for more information on how we can help you.
Martin Holmberg