multicloud365
  • Home
  • Cloud Architecture
    • OCI
    • GCP
    • Azure
    • AWS
    • IAC
    • Cloud Networking
    • Cloud Trends and Innovations
    • Cloud Security
    • Cloud Platforms
  • Data Management
  • DevOps and Automation
    • Tutorials and How-Tos
  • Case Studies and Industry Insights
    • AI and Machine Learning in the Cloud
No Result
View All Result
  • Home
  • Cloud Architecture
    • OCI
    • GCP
    • Azure
    • AWS
    • IAC
    • Cloud Networking
    • Cloud Trends and Innovations
    • Cloud Security
    • Cloud Platforms
  • Data Management
  • DevOps and Automation
    • Tutorials and How-Tos
  • Case Studies and Industry Insights
    • AI and Machine Learning in the Cloud
No Result
View All Result
multicloud365
No Result
View All Result

Sensible AI Integration with the Mannequin Context Protocol (MCP) … half 4

admin by admin
July 5, 2025
in Azure
0
Sensible AI Integration with the Mannequin Context Protocol (MCP) … half 4
399
SHARES
2.3k
VIEWS
Share on FacebookShare on Twitter


A dialogue on Mannequin Context Protocol:

  • Half 1 – Why is there a necessity for MCP Hyperlink half 1
  • Half 2 – What MCP is, together with its structure and core elements Hyperlink half 2
  • Half 3 – A demo of MCP — together with how you can configure it so anybody can run it Hyperlink half 3
  • Half 4 – An instance of how you can develop an MCP server — a possible starter challenge for connecting to your personal data sources

On this part we will focus on creating an MCP Server – particularly, the Color MCP server that was lined within the earlier part, and used within the demo.

To assist construct MCP servers with minimal effort – there are Software program Growth Kits (SDKS) for the next languages:

  • C#
  • Java
  • Kotlin
  • Python
  • Ruby
  • Swift
  • TypeScript

Hyperlinks to the totally different SDKS are at https://modelcontextprotocol.io/

The supply code to the Colours MCP server is at : https://github.com/markharrison/ColorsMCP

It may very well be used as the idea of your personal MCP Server – for data that you simply wish to make obtainable to your AI functions. So take a duplicate:

git clone https://github.com/markharrison/ColorsMCP

There are a number of initiatives within the answer:

  • ColorsMCP … this makes use of the STDIO transport protocol
  • ColorsMCP-http … this makes use of the HTTP Streamable transport protocol
  • ColorsCommonMCP … that is widespread code utilized by each the ColorMCP and ColorsMCP-http initiatives
  • MCPClient … it is a easy consumer challenge to check calling the MCP servers

The code is easy – due to the C# SDK, which does the majority of the work.

Test program.cs to see how the server software is instantiated with MCP assist.

var builder = WebApplication.CreateBuilder(args);
builder.Companies
.AddMcpServer()
.WithHttpTransport()
.WithTools();

builder.Companies.AddCors(choices =>
{
choices.AddDefaultPolicy(coverage =>
{
coverage.AllowAnyOrigin()
.AllowAnyHeader()
.AllowAnyMethod();
});
});

builder.Companies.AddSingleton();

var app = builder.Construct();

var colorsService = app.Companies.GetRequiredService();

app.UseCors();

app.MapMcp();

app.MapGet("/well being", () => "Wholesome");

app.Run();

We will see that the startup logic .WithTools refers to a category known as ColorsTools – that is what incorporates our MCP Instruments. We will have a look at this intimately shortly.

The challenge incorporates our widespread code – that’s utilized by the initiatives to assist totally different transport protocols.

The Colours data is tough coded in a JSON file. However different such servers may entry info in databases or name APIs.

[
{
"name": "ALICEBLUE",
"hexcode": "#F0F8FF",
"rgb": "RGB(240, 248, 255)",
"families": [ "white" ]
},
{
"identify": "ANTIQUEWHITE",
"hexcode": "#FAEBD7",
"rgb": "RGB(250, 235, 215)",
"households": [ "white", "tan" ]
},
{
"identify": "AQUA",
"hexcode": "#00FFFF",
"rgb": "RGB(0, 255, 255)",
"households": [ "blue", "aqua" ]
},

and so on

]

The three MCP Instruments are positioned in ColorsTools.cs


utilizing ModelContextProtocol.Server;
utilizing System.ComponentModel;
utilizing System.Textual content.Json;

namespace ColorsCommonMCP;

[McpServerToolType]
public sealed class ColorsTools
{
personal readonly ColorsService colorsService;

public ColorsTools(ColorsService colorsService)
{
this.colorsService = colorsService;
}

[McpServerTool, Description(ColorsInfo.GetAllColorsToolDescription)]
public async Process GetAllColors()
{
var colours = await colorsService.GetColors();
return JsonSerializer.Serialize(colours, ColorsContext.Default.ListColors);
}

[McpServerTool, Description(ColorsInfo.GetColorsByFamilyToolDescription)]
public async Process GetColorByFamily(
[Description(ColorsInfo.GetColorsByFamilyParamFamilyDescription)] string household)
{
var colours = await colorsService.GetColorsByFamily(household);
return JsonSerializer.Serialize(colours, ColorsContext.Default.ListColors);
}

[McpServerTool, Description(ColorsInfo.GetColorToolDescription)]
public async Process GetColor([Description(ColorsInfo.GetColorParamNameDescription)] string identify)
{
var colours = await colorsService.GetColors(identify);
return JsonSerializer.Serialize(colours, ColorsContext.Default.Colours);
}
}

The annotations on the features are essential, as they’re utilized by this system logic to establish and hyperlink to the suitable instruments.

The outline fields inside these annotations should be clear and exact, as they’re utilized by the AI logic to find out whether or not a selected instrument needs to be known as to fulfil a given request.

The ColorsMCP-http challenge features a Docker file to construct a container. This makes it easy to deploy e.g. to Azure App Service.

The Command to construct the container is within the repo ReadMe file.  Hyperlink to ReadMe

A consumer take a look at utility was included within the answer. This examines the server to see what Instruments it exposes, after which it invoked the Device to get the Purple info.

 

Alternatively use the MCP Inspector utility – directions to run this are within the ReadMe file. Hyperlink to ReadMe

 

 

— 

Mark Harrison https://markharrison.io/ 

 

 

Tags: ContextIntegrationMCPModelPartProtocolSmart
Previous Post

Ooredoo rolls out native AI cloud powered by Nvidia GPUs in Qatar

Next Post

Dapr 1.14: Constructing Resilient .NET Microservices | by Adem KORKMAZ | Jul, 2025

Next Post
Dapr 1.14: Constructing Resilient .NET Microservices | by Adem KORKMAZ | Jul, 2025

Dapr 1.14: Constructing Resilient .NET Microservices | by Adem KORKMAZ | Jul, 2025

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

Trending

Why Safety Stacks Want To Assume Like An Attacker, And Rating Each Person In Actual Time

Why Safety Stacks Want To Assume Like An Attacker, And Rating Each Person In Actual Time

April 20, 2025
HPE GreenLake pronounces new enhancements to the platform

HPE GreenLake pronounces new enhancements to the platform

January 28, 2025
BCD Energy IC Business Set for Strong Development with USD 19.8 Billion Incremental Alternative by 2031

BCD Energy IC Business Set for Strong Development with USD 19.8 Billion Incremental Alternative by 2031

June 2, 2025
BigML reaches 200,000 customers! – The Official Weblog of BigML.com

BigML reaches 200,000 customers! – The Official Weblog of BigML.com

January 30, 2025
Sovereign Cloud redefining the cloud market: Omdia market radar

Sovereign Cloud redefining the cloud market: Omdia market radar

May 18, 2025
Greatest AI ML Institute In Bangalore At Eduleem Institute | by Mohammed Numan | Might, 2025

Greatest AI ML Institute In Bangalore At Eduleem Institute | by Mohammed Numan | Might, 2025

May 20, 2025

MultiCloud365

Welcome to MultiCloud365 — your go-to resource for all things cloud! Our mission is to empower IT professionals, developers, and businesses with the knowledge and tools to navigate the ever-evolving landscape of cloud technology.

Category

  • AI and Machine Learning in the Cloud
  • AWS
  • Azure
  • Case Studies and Industry Insights
  • Cloud Architecture
  • Cloud Networking
  • Cloud Platforms
  • Cloud Security
  • Cloud Trends and Innovations
  • Data Management
  • DevOps and Automation
  • GCP
  • IAC
  • OCI

Recent News

What The Knowledge Actually Says

What The Knowledge Actually Says

July 19, 2025
Construct real-time journey suggestions utilizing AI brokers on Amazon Bedrock

Construct real-time journey suggestions utilizing AI brokers on Amazon Bedrock

July 19, 2025
  • About Us
  • Privacy Policy
  • Disclaimer
  • Contact

© 2025- https://multicloud365.com/ - All Rights Reserved

No Result
View All Result
  • Home
  • Cloud Architecture
    • OCI
    • GCP
    • Azure
    • AWS
    • IAC
    • Cloud Networking
    • Cloud Trends and Innovations
    • Cloud Security
    • Cloud Platforms
  • Data Management
  • DevOps and Automation
    • Tutorials and How-Tos
  • Case Studies and Industry Insights
    • AI and Machine Learning in the Cloud

© 2025- https://multicloud365.com/ - All Rights Reserved