Posts

Showing posts with the label ai

Using LLMs and MCP in .NET

Introduction This post picks up where this one left. It will be my second post on using LLMs, and AI, in general. This time I'm going to cover integrating MCP tools with the LLM's response. MCP stands for Model Context Protocol , and it is an open standard . In a nutshell, it is a protocol designed to help LLMs communicating with the real world, for example, accessing a database, getting real-time weather information for a specific location, creating a ticket in some system, sending out an email, etc. We need an MCP host and some tools registered with it. There are many ways by which LLMs can communicate with the MCP host, always using JSON-RPC 2.0 for messaging: Standard input/output, if running on the same machine HTTP calls Server-Sent Events (SSE) Custom-defined Now, I won't go through all of them now, I'll just pick HTTP transport, as it's probably the most usual one. Also, I will be using the  OpenAI  API. Essentially, we register tools with...