Discover Awesome MCP Servers

Extend your agent with 17,088 capabilities via MCP servers.

All17,088
MCP Montano Server

MCP Montano Server

BinjaLattice

BinjaLattice

Interface de plugin para comunicações remotas com o banco de dados do Binary Ninja e o servidor MCP para interagir com LLMs.

mcpserver-semantickernel-client-demo

mcpserver-semantickernel-client-demo

Absolutely! Here's a breakdown of how you could create a very basic C# MCP (Message Control Protocol) server using Aspire, and then consume it with Semantic Kernel. I'll focus on simplicity and clarity. **Conceptual Overview** 1. **MCP Server (Aspire-Hosted):** * Listens for incoming MCP messages on a specific port. * Parses the message (in this example, a very basic format). * Performs a simple action based on the message content. * Sends a response back to the client. 2. **Semantic Kernel Client:** * Uses Semantic Kernel to orchestrate a task. * As part of that task, it sends an MCP message to the server. * Receives the response from the server. * Uses the response within the Semantic Kernel workflow. **Implementation** **1. Create a new Aspire Application** ```bash dotnet new aspire -o MyAspireApp cd MyAspireApp ``` **2. Create the MCP Server Project** ```bash dotnet new worker -o MyAspireApp.McpServer dotnet add MyAspireApp.McpServer package Microsoft.Extensions.Hosting dotnet add MyAspireApp.McpServer package Microsoft.Extensions.ServiceDiscovery dotnet add MyAspireApp.McpServer package Microsoft.Extensions.Http ``` **3. Create the Semantic Kernel Client Project** ```bash dotnet new console -o MyAspireApp.SemanticKernelClient dotnet add MyAspireApp.SemanticKernelClient package Microsoft.SemanticKernel dotnet add MyAspireApp.SemanticKernelClient package Microsoft.Extensions.Hosting dotnet add MyAspireApp.SemanticKernelClient package Microsoft.Extensions.ServiceDiscovery dotnet add MyAspireApp.SemanticKernelClient package Microsoft.Extensions.Http ``` **4. Add the projects to the solution** ```bash dotnet sln add ./MyAspireApp.McpServer/MyAspireApp.McpServer.csproj dotnet sln add ./MyAspireApp.SemanticKernelClient/MyAspireApp.SemanticKernelClient.csproj ``` **5. Reference the projects in the AppHost** ```bash dotnet add ./MyAspireApp.AppHost/MyAspireApp.AppHost.csproj reference ./MyAspireApp.McpServer/MyAspireApp.McpServer.csproj dotnet add ./MyAspireApp.AppHost/MyAspireApp.AppHost.csproj reference ./MyAspireApp.SemanticKernelClient/MyAspireApp.SemanticKernelClient.csproj ``` **6. MCP Server Code (MyAspireApp.McpServer/Worker.cs)** ```csharp using System.Net; using System.Net.Sockets; using System.Text; using Microsoft.Extensions.Hosting; using Microsoft.Extensions.Logging; namespace MyAspireApp.McpServer; public class Worker : BackgroundService { private readonly ILogger<Worker> _logger; private readonly int _port = 12345; // Choose a port private TcpListener? _listener; public Worker(ILogger<Worker> logger) { _logger = logger; } public override async Task StartAsync(CancellationToken cancellationToken) { _listener = new TcpListener(IPAddress.Any, _port); _listener.Start(); _logger.LogInformation("MCP Server started on port {Port}", _port); await base.StartAsync(cancellationToken); } public override async Task StopAsync(CancellationToken cancellationToken) { _listener?.Stop(); _logger.LogInformation("MCP Server stopped."); await base.StopAsync(cancellationToken); } protected override async Task ExecuteAsync(CancellationToken stoppingToken) { if (_listener is null) { return; } try { while (!stoppingToken.IsCancellationRequested) { TcpClient client = await _listener.AcceptTcpClientAsync(stoppingToken); _ = HandleClientAsync(client, stoppingToken); // Fire and forget } } catch (OperationCanceledException) { // Expected when the service is stopping. } catch (Exception ex) { _logger.LogError(ex, "Error in MCP server loop."); } } private async Task HandleClientAsync(TcpClient client, CancellationToken cancellationToken) { try { _logger.LogInformation("Client connected: {RemoteEndPoint}", client.Client.RemoteEndPoint); NetworkStream stream = client.GetStream(); byte[] buffer = new byte[1024]; int bytesRead = await stream.ReadAsync(buffer, 0, buffer.Length, cancellationToken); string message = Encoding.UTF8.GetString(buffer, 0, bytesRead); _logger.LogInformation("Received message: {Message}", message); // **Simple Message Processing** string response = ProcessMessage(message); byte[] responseBytes = Encoding.UTF8.GetBytes(response); await stream.WriteAsync(responseBytes, 0, responseBytes.Length, cancellationToken); _logger.LogInformation("Sent response: {Response}", response); } catch (Exception ex) { _logger.LogError(ex, "Error handling client."); } finally { client.Close(); _logger.LogInformation("Client disconnected: {RemoteEndPoint}", client.Client.RemoteEndPoint); } } private string ProcessMessage(string message) { // **Very Basic Example:** If the message starts with "SUM", return the sum of two numbers. if (message.StartsWith("SUM")) { try { string[] parts = message.Split(' '); if (parts.Length == 3 && int.TryParse(parts[1], out int a) && int.TryParse(parts[2], out int b)) { return $"RESULT {a + b}"; } else { return "ERROR: Invalid SUM format. Use SUM <number1> <number2>"; } } catch (Exception) { return "ERROR: Could not process SUM command."; } } else { return $"ECHO: {message}"; // Just echo the message back. } } } ``` **7. Semantic Kernel Client Code (MyAspireApp.SemanticKernelClient/Program.cs)** ```csharp using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.Hosting; using Microsoft.SemanticKernel; using Microsoft.Extensions.Logging; using Microsoft.Extensions.Configuration; using System.Net.Sockets; using System.Text; public class Program { public static async Task Main(string[] args) { using IHost host = Host.CreateDefaultBuilder(args) .ConfigureServices((context, services) => { services.AddHostedService<Worker>(); services.AddHttpClient("McpServer", client => { var mcpServerUri = context.Configuration["McpServerUri"] ?? "http://localhost:12345"; client.BaseAddress = new Uri(mcpServerUri); }); }) .Build(); await host.RunAsync(); } public class Worker : BackgroundService { private readonly ILogger<Worker> _logger; private readonly IHttpClientFactory _httpClientFactory; private readonly IConfiguration _configuration; public Worker(ILogger<Worker> logger, IHttpClientFactory httpClientFactory, IConfiguration configuration) { _logger = logger; _httpClientFactory = httpClientFactory; _configuration = configuration; } protected override async Task ExecuteAsync(CancellationToken stoppingToken) { try { // **Semantic Kernel Setup** Kernel kernel = Kernel.CreateBuilder() .Build(); // **Define a simple function (skill)** var mcpSkill = kernel.CreateFunctionFromMethod( (string input) => SendMcpMessageAsync(input, stoppingToken).GetAwaiter().GetResult(), // Synchronously get the result "SendMcpMessage", "Sends a message to the MCP server and returns the response." ); // Import the skill into the kernel kernel.ImportSkill(new { SendMcpMessage = mcpSkill }, "McpSkill"); // **Run a Semantic Kernel "plan"** var result = await kernel.RunAsync( "SUM 10 20", // Input to the plan (MCP message) kernel.Skills.GetFunction("McpSkill", "SendMcpMessage") ); _logger.LogInformation("Semantic Kernel Result: {Result}", result.GetValue<string>()); } catch (Exception ex) { _logger.LogError(ex, "Error in Semantic Kernel client."); } // Keep the service running while (!stoppingToken.IsCancellationRequested) { await Task.Delay(1000, stoppingToken); } } private async Task<string> SendMcpMessageAsync(string message, CancellationToken cancellationToken) { string hostName = _configuration["McpServerHostName"] ?? "localhost"; int port = int.Parse(_configuration["McpServerPort"] ?? "12345"); try { using TcpClient client = new TcpClient(); await client.ConnectAsync(hostName, port, cancellationToken); NetworkStream stream = client.GetStream(); byte[] messageBytes = Encoding.UTF8.GetBytes(message); await stream.WriteAsync(messageBytes, 0, messageBytes.Length, cancellationToken); byte[] buffer = new byte[1024]; int bytesRead = await stream.ReadAsync(buffer, 0, buffer.Length, cancellationToken); string response = Encoding.UTF8.GetString(buffer, 0, bytesRead); _logger.LogInformation("Received from MCP server: {Response}", response); return response; } catch (Exception ex) { _logger.LogError(ex, "Error sending MCP message: {Error}", ex.Message); return $"ERROR: Could not connect to MCP server: {ex.Message}"; } } } } ``` **8. Aspire AppHost Code (MyAspireApp.AppHost/Program.cs)** ```csharp var builder = DistributedApplication.CreateBuilder(args); var mcpServer = builder.AddProject<Projects.MyAspireApp_McpServer>("mcpserver"); builder.AddProject<Projects.MyAspireApp_SemanticKernelClient>("semantickernelclient") .WithReference(mcpServer, "McpServerHostName", "McpServerPort"); builder.Build().Run(); ``` **9. Aspire AppHost Code (MyAspireApp.AppHost/appsettings.json)** ```json { "McpServerHostName": "mcpserver", "McpServerPort": "12345" } ``` **Explanation and Key Points** * **MCP Server:** * The `TcpListener` listens for incoming connections. * `HandleClientAsync` processes each client connection in a separate task. * `ProcessMessage` is where you'd implement your MCP logic. This example has a very basic `SUM` command and an echo. * **Semantic Kernel Client:** * The `SendMcpMessageAsync` function establishes a TCP connection to the server, sends the message, and receives the response. * The Semantic Kernel is set up with a simple skill that calls `SendMcpMessageAsync`. * A "plan" is executed to send the `SUM` message and log the result. * **Aspire Integration:** * The `AppHost` project orchestrates the deployment of both the MCP server and the Semantic Kernel client. * It uses service discovery to allow the Semantic Kernel client to find the MCP server's address. * **Error Handling:** Includes basic `try-catch` blocks for error handling. In a real application, you'd want more robust error handling and logging. * **Simplicity:** This is a deliberately simplified example. A real MCP server would likely have a more complex message format, error handling, and security considerations. **How to Run** 1. Make sure you have the .NET 8 SDK and Aspire workload installed. 2. Navigate to the `MyAspireApp` directory in your terminal. 3. Run `dotnet run --project MyAspireApp.AppHost`. **Important Considerations** * **MCP Protocol:** This example uses a very basic text-based protocol. For real-world applications, you'd likely want a more structured protocol (e.g., binary, JSON, Protocol Buffers). * **Security:** This example has no security. In a production environment, you'd need to implement authentication, authorization, and encryption. * **Scalability:** For high-volume scenarios, you might need to consider asynchronous I/O, connection pooling, and other techniques to improve scalability. * **Service Discovery:** Aspire provides a service discovery mechanism that allows the client to locate the server without hardcoding the address. **To Adapt and Extend** * **Message Format:** Change the `ProcessMessage` method to handle different MCP commands and data formats. * **Semantic Kernel Integration:** Create more complex Semantic Kernel skills that use the MCP server to perform various tasks. * **Error Handling:** Add more detailed error handling and logging. * **Configuration:** Use configuration files to manage settings like the port number and server address. Let me know if you'd like help with any of these specific areas!

A simple MCP Server

A simple MCP Server

mcp-server-newbie

mcp-server-newbie

MCP Server Tutorial

MCP Server Tutorial

Java Map Component Platform (Java MCP)

Java Map Component Platform (Java MCP)

Servidor Java MCP

Remote MCP Server on Cloudflare

Remote MCP Server on Cloudflare

A deployable Model Context Protocol server on Cloudflare Workers that enables AI models to access custom tools without authentication requirements.

MCP Weather Server

MCP Weather Server

Enables users to retrieve current weather alerts for US states and detailed weather forecasts by geographic coordinates using the US National Weather Service API. Built with Node.js and TypeScript following Model Context Protocol standards for seamless LLM integration.

MCP2ANP Bridge Server

MCP2ANP Bridge Server

Enables MCP clients like Claude Desktop to interact with ANP (Agent Network Protocol) agents through three core tools: authentication setup, document fetching, and OpenRPC method invocation. Converts ANP's crawler-style interaction paradigm into MCP-compatible tools for seamless agent communication.

KatCoder MySQL MCP Server

KatCoder MySQL MCP Server

A secure MySQL Model Context Protocol server that enables AI agents to interact with MySQL databases through standardized operations. Features comprehensive security with SQL injection prevention, connection pooling, and configurable tool access for database operations.

KIS REST API MCP Server

KIS REST API MCP Server

Um servidor de Protocolo de Contexto de Modelo para interagir com a API REST da Korea Investment & Securities (KIS), permitindo negociação de ações nacionais e estrangeiras, verificação de preços e gerenciamento de contas.

System Information MCP Server

System Information MCP Server

Provides comprehensive system diagnostics and hardware analysis through 10 specialized tools for troubleshooting and environment monitoring. Offers targeted information gathering for CPU, memory, network, storage, processes, and security analysis across Windows, macOS, and Linux platforms.

SQL-Server-MCP

SQL-Server-MCP

Atla MCP Server

Atla MCP Server

Versão inicial de um servidor mcp para agentes interagirem com os modelos da atla.

mcp-server-docker

mcp-server-docker

mcp-server-docker

Swift Test MCP Server

Swift Test MCP Server

Enables running Swift package tests through the swift test command in specified directories. Provides a secure way for MCP clients to execute Swift tests without requiring full shell access.

mcp-bitbucket

mcp-bitbucket

Access all major Bitbucket Cloud features—repositories, pull requests, issues, branches, pipelines, deployments, and more—using a modern Rust codebase. Expose Bitbucket as Model Context Protocol (MCP) tools, ideal for bots, CI/CD, and workflow automation.

Anomaly Detection MCP Server

Anomaly Detection MCP Server

A server that enables LLMs to detect anomalies in sensor data by providing tools for data retrieval, analysis, visualization, and corrective action execution.

Understanding MCP (Model Context Protocol) and GitHub Integration

Understanding MCP (Model Context Protocol) and GitHub Integration

A comprehensive guide to setting up and using MCP server with Cursor IDE, including GitHub integration and AI agent configuration.

Remote MCP Server (Authless)

Remote MCP Server (Authless)

A template for deploying MCP servers on Cloudflare Workers without authentication. Provides a foundation for creating custom tools accessible via Server-Sent Events from both web-based and desktop MCP clients.

MCP Demo Server

MCP Demo Server

Provides calculator, text analysis, and file reading tools through two different implementations - a FastAPI version for learning MCP concepts and an official SDK version for production use with Claude Desktop integration.

🦉 OWL x WhatsApp MCP Server Integration

🦉 OWL x WhatsApp MCP Server Integration

Database MCP

Database MCP

Enables interaction with MySQL and PostgreSQL databases through separate pluggable MCP servers with shared core functionality. Features optional TTL caching, bilingual prompts, and a unified gateway for managing multiple database connections.

Chroma MCP Server

Chroma MCP Server

Servidor MCP para integração do ChromaDB no Cursor com modelos de IA compatíveis com MCP.

Debug-MCP

Debug-MCP

Enables AI assistants to perform interactive Python debugging with breakpoints, step execution, and variable inspection using the Debug Adapter Protocol (DAP) through an MCP server interface.

ResembleMCP

ResembleMCP

Desafio de Implementação do Servidor MCP da Resemble AI

Duyet MCP Server

Duyet MCP Server

An experimental Model Context Protocol server that enables AI assistants to access information about Duyet, including his CV, blog posts, and GitHub activity through natural language queries.

Blender MCP Server

Blender MCP Server

Transforms Blender into an MCP server with 50+ tools for AI-driven 3D workflows, enabling complete control over objects, materials, animations, physics simulations, and rendering through natural language commands.

MCP Google Trends Server

MCP Google Trends Server

Provides access to Google Trends search interest data with backtesting support, allowing retrieval of historical 30-day trend windows ending at specified cutoff dates for forecasting applications without future information leakage.