It’s been a few days since I posted last. I’m going to let myself off, but resolve to do better in the future – since I do want to keep posting on a daily basis but I am aware I want to make the posts more valuable; so I feel they represent value that can then go onto LinkedIn, and the other social networks.
Things are definitely building in my mind; and projects are coming along. However, still a long way from anything concrete taking off.
For the moment would just like to talk about MCP, because it really is a very significant milestone in the AI world. (Image context from OpenAI was another one recently).
MCP
Model Context Protocol was announced in Nov 2024 by Anthropic.
This is a big step forward since it has standardised how language models can/should interact with external tools.
In order for LLMs to be further useful, they need to be able to action things.
I’m guessing that once Anthropic had integrated a couple of tools with their LLMs they realised it would be better to have a standard way of doing that … and from that they came up with the MCP architecture.
At first understanding, giving a language model a standard way of interfacing with the outside world is a bit of a game-changer and there are already a ton of integrations that we can use straight away. Things are happening really fast.
Core Architecture
Essentially, you have an application (called the Host), and this has a Client inside it.
The Client maintains connection to the Servers which have access to the tools you want the LLMs to connect to.
Protocol Layer
It’s fairly simple … you have:
- Requests
- Notifications
- Results
You have functions that:
- Handle incoming requests
- Send requests and await response
- Handle income notification
- Send a notification
Transport Layer
All transport layers use JSONRPC
JSON-RPC Request Object
- jsonrpc : always going to be “2.0”
- method
- params (optional)
- id
Without an ID, it is considered a notification that doesnt expect a response. In fact, servers MUST NOT reply to a notification.
JSON-RPC Response Object
- jsonrpc (version string)
- result
- error
- id
To be clear, MCP is a standard way – a proposed specification that multiple parties can agree on – for how language models will interact with outside tools.
Protocols are vital in tech. We have TCP-IP and email, which you use all the time. Without that agreement, we could have had an incredibly fractured internet.
When companies and developers can agree to do things in a certain way, it makes it easier to make systems.
Using MCP I assume is very much like working with interfaces. If you code an LLM up to work with your own tools and then for whatever reason you decide to switch LLMs … then using a protocol would mean there’s no lost work – because the new one will use exactly the same interface as the current one.
Reference
4 Request object
A rpc call is represented by sending a Request object to a Server. The Request object has the following members:jsonrpcA String specifying the version of the JSON-RPC protocol. MUST be exactly “2.0”.methodA String containing the name of the method to be invoked. Method names that begin with the word rpc followed by a period character (U+002E or ASCII 46) are reserved for rpc-internal methods and extensions and MUST NOT be used for anything else.paramsA Structured value that holds the parameter values to be used during the invocation of the method. This member MAY be omitted.idAn identifier established by the Client that MUST contain a String, Number, or NULL value if included. If it is not included it is assumed to be a notification. The value SHOULD normally not be Null [1] and Numbers SHOULD NOT contain fractional parts [2]
The Server MUST reply with the same value in the Response object if included. This member is used to correlate the context between the two objects.
[1] The use of Null as a value for the id member in a Request object is discouraged, because this specification uses a value of Null for Responses with an unknown id. Also, because JSON-RPC 1.0 uses an id value of Null for Notifications this could cause confusion in handling.
[2] Fractional parts may be problematic, since many decimal fractions cannot be represented exactly as binary fractions.
Leave a Reply