Discover Awesome MCP Servers

Extend your agent with 84,508 capabilities via MCP servers.

All84,508
Echo MCP Server

Echo MCP Server

Okay, here's a basic outline and code example for a Model Context Protocol (MCP) server implementing an echo service using .NET Core. Since MCP is a somewhat abstract concept, I'll make some assumptions about how you want to structure the communication. This example focuses on a simple text-based echo service. **Assumptions:** * **Communication Channel:** I'll use TCP sockets for the communication channel. This is a common and relatively straightforward approach. You could adapt this to use other channels (e.g., named pipes, message queues) if needed. * **Message Format:** I'll assume a simple text-based message format. The server receives a text string and sends the same string back. You can easily extend this to use JSON, Protocol Buffers, or other serialization formats if you need more complex data structures. * **Error Handling:** Basic error handling is included, but you'll likely want to add more robust error handling in a production environment. * **MCP Abstraction:** This example doesn't implement a full-blown MCP framework. It focuses on the core concept of receiving a request and sending a response within a defined context (the socket connection). A true MCP implementation might involve more sophisticated context management, request routing, and service discovery. **Code Example (.NET Core Console Application):** ```csharp using System; using System.Net; using System.Net.Sockets; using System.Text; using System.Threading.Tasks; namespace MCPEchoServer { class Program { static async Task Main(string[] args) { int port = 12345; // Choose a port number IPAddress ipAddress = IPAddress.Any; // Listen on all available network interfaces TcpListener listener = new TcpListener(ipAddress, port); try { listener.Start(); Console.WriteLine($"Server started, listening on port {port}"); while (true) { TcpClient client = await listener.AcceptTcpClientAsync(); Console.WriteLine("Client connected."); _ = HandleClientAsync(client); // Fire and forget } } catch (Exception ex) { Console.WriteLine($"Error: {ex.Message}"); } finally { listener.Stop(); } } static async Task HandleClientAsync(TcpClient client) { try { NetworkStream stream = client.GetStream(); byte[] buffer = new byte[1024]; int bytesRead; while ((bytesRead = await stream.ReadAsync(buffer, 0, buffer.Length)) > 0) { string receivedMessage = Encoding.UTF8.GetString(buffer, 0, bytesRead); Console.WriteLine($"Received: {receivedMessage}"); // Echo the message back byte[] responseBytes = Encoding.UTF8.GetBytes(receivedMessage); await stream.WriteAsync(responseBytes, 0, responseBytes.Length); Console.WriteLine($"Sent: {receivedMessage}"); } } catch (Exception ex) { Console.WriteLine($"Error handling client: {ex.Message}"); } finally { client.Close(); Console.WriteLine("Client disconnected."); } } } } ``` **Explanation:** 1. **`Main` Method:** * Creates a `TcpListener` to listen for incoming connections on a specified port. * Starts the listener. * Enters an infinite loop to accept incoming client connections using `AcceptTcpClientAsync`. * For each accepted client, it calls `HandleClientAsync` to handle the communication in a separate task (using `_ = ...` to "fire and forget"). This allows the server to handle multiple clients concurrently. * Includes a `try-catch-finally` block for basic error handling and to ensure the listener is stopped when the application exits. 2. **`HandleClientAsync` Method:** * Gets the `NetworkStream` from the `TcpClient`. This stream is used for reading and writing data. * Reads data from the stream in a loop using `stream.ReadAsync`. * Converts the received bytes to a string using `Encoding.UTF8.GetString`. * Prints the received message to the console. * Creates a byte array from the received message (to echo it back). * Writes the response bytes back to the stream using `stream.WriteAsync`. * Prints the sent message to the console. * Includes a `try-catch-finally` block for error handling and to ensure the client connection is closed when the communication is finished or an error occurs. **How to Run:** 1. **Create a .NET Core Console Application:** Use the .NET CLI or Visual Studio to create a new console application project. 2. **Replace the `Program.cs` content:** Copy and paste the code above into your `Program.cs` file. 3. **Run the application:** Build and run the application from the command line (`dotnet run`) or from Visual Studio. **Testing (using `netcat` or a simple client):** You can test the server using `netcat` (if you have it installed) or by creating a simple client application. **Using `netcat`:** 1. Open a terminal or command prompt. 2. Type: `nc localhost 12345` (replace `12345` with the port you used). 3. Type a message and press Enter. You should see the same message echoed back to you. 4. Press Ctrl+C to exit `netcat`. **Simple Client Example (C#):** ```csharp using System; using System.Net.Sockets; using System.Text; using System.Threading.Tasks; namespace MCPEchoClient { class Program { static async Task Main(string[] args) { string serverAddress = "localhost"; int port = 12345; try { TcpClient client = new TcpClient(); await client.ConnectAsync(serverAddress, port); NetworkStream stream = client.GetStream(); Console.WriteLine("Connected to server. Enter messages to send (or 'exit' to quit):"); string message; while (true) { Console.Write("> "); message = Console.ReadLine(); if (message.ToLower() == "exit") { break; } byte[] messageBytes = Encoding.UTF8.GetBytes(message); await stream.WriteAsync(messageBytes, 0, messageBytes.Length); byte[] buffer = new byte[1024]; int bytesRead = await stream.ReadAsync(buffer, 0, buffer.Length); string receivedMessage = Encoding.UTF8.GetString(buffer, 0, bytesRead); Console.WriteLine($"Received: {receivedMessage}"); } client.Close(); Console.WriteLine("Disconnected from server."); } catch (Exception ex) { Console.WriteLine($"Error: {ex.Message}"); } } } } ``` **Key Improvements and Considerations:** * **Asynchronous Operations:** The code uses `async` and `await` for non-blocking I/O operations. This is crucial for scalability, as it prevents the server from blocking while waiting for data to be read or written. * **Multi-threading:** The `HandleClientAsync` method is called in a separate task for each client. This allows the server to handle multiple clients concurrently. * **Error Handling:** Basic error handling is included, but you should add more robust error handling in a production environment. Consider logging errors, handling specific exceptions, and implementing retry mechanisms. * **Message Framing:** The current example assumes that each message is sent as a single chunk of data. In a real-world application, you might need to implement message framing to handle messages that are larger than the buffer size or that are split across multiple packets. Common framing techniques include: * **Length-prefixing:** Include the length of the message at the beginning of the message. * **Delimiter-based:** Use a special character (e.g., newline) to mark the end of a message. * **Serialization:** For more complex data structures, use a serialization format like JSON or Protocol Buffers. This will allow you to easily convert objects to and from byte streams. * **Dependency Injection:** For larger applications, consider using dependency injection to manage dependencies and make the code more testable. * **Configuration:** Externalize configuration settings (e.g., port number, IP address) to a configuration file. * **Logging:** Implement a logging framework (e.g., Serilog, NLog) to record events and errors. * **Security:** If you're handling sensitive data, consider using encryption and authentication to protect the communication channel. TLS/SSL is a common choice. * **MCP Framework (Advanced):** For a more complete MCP implementation, you would need to define: * **Context Management:** How to manage the context associated with each request (e.g., user identity, session information). * **Request Routing:** How to route requests to the appropriate service or handler. * **Service Discovery:** How clients can discover available services. * **Interceptors/Middleware:** Mechanisms for adding cross-cutting concerns (e.g., logging, authentication, authorization) to the request processing pipeline. **Japanese Translation of Key Concepts:** * **Model Context Protocol (MCP):** モデルコンテキストプロトコル (Moderu Kontekusuto Purotokoru) * **Echo Service:** エコーサービス (Ekō Sābisu) * **Server:** サーバー (Sābā) * **Client:** クライアント (Kurainto) * **TCP Socket:** TCPソケット (TCP Soketto) * **Message:** メッセージ (Messēji) * **Request:** リクエスト (Rikuesuto) * **Response:** レスポンス (Resuponsu) * **Port:** ポート (Pōto) * **IP Address:** IPアドレス (IP Adoresu) * **Asynchronous:** 非同期 (Hisynki) * **Multi-threading:** マルチスレッド (Maruchi Sureddo) * **Serialization:** シリアライズ (Shiriaraizu) / シリアル化 (Shiriaruka) * **Dependency Injection:** 依存性注入 (Izonsei Chūnyū) * **Configuration:** 構成 (Kōsei) / 設定 (Settei) * **Logging:** ロギング (Rogingu) / ログ記録 (Rogu Kiroku) * **Security:** セキュリティ (Sekyuriti) / 安全性 (Anzensei) * **Context Management:** コンテキスト管理 (Kontekusuto Kanri) * **Request Routing:** リクエストルーティング (Rikuesuto Rūtingu) * **Service Discovery:** サービスディスカバリー (Sābisu Disukabarī) This example provides a starting point for building an MCP-like echo service in .NET Core. Remember to adapt it to your specific requirements and consider the key improvements and considerations mentioned above. Good luck!

Agent Analytics MCP Server

Agent Analytics MCP Server

Tracks and analyzes AI agent tool calls with event logging, dashboard, per-tool and per-agent analytics, and error monitoring.

Edgee MCP Server

Edgee MCP Server

MCP Server for the Edgee API, enabling organization management, project operations, component management, and user administration through the Model Context Protocol.

aptible-mcp

aptible-mcp

Enables interaction with the Aptible API for managing Aptible resources such as accounts, apps, and databases through natural language.

Banrisul MCP

Banrisul MCP

Connects Banrisul bank accounts to AI assistants via Open Finance Brazil, enabling read-only queries on balances, statements, credit cards, and investments.

Spira MCP

Spira MCP

Read-only MCP for retrieving daily Spira incident digests and filter options using the Inflectra Spira API.

Narad GitHub Agent

Narad GitHub Agent

Enables AI-powered GitHub interactions including repository analysis, code search, PR reviews, and more through the MCP protocol.

mcp-dart-kr

mcp-dart-kr

Enables AI agents to access Korea's DART financial data system for retrieving and analyzing corporate disclosures and financial information through natural language queries.

uniprot-mcp

uniprot-mcp

MCP server that exposes the UniProt REST API to LLM clients, enabling search and retrieval of protein data via tools like search_uniprotkb, get_entry, and map_ids.

Path of Exile 2 Build Optimizer MCP

Path of Exile 2 Build Optimizer MCP

Enables AI-powered Path of Exile 2 character optimization through natural language queries, providing intelligent build recommendations, gear upgrades, and passive tree optimization using the official PoE API and comprehensive game database.

ytmusic-mcp

ytmusic-mcp

Enables AI assistants to search YouTube Music, manage playlists, and retrieve listening history using the ytmusicapi library.

secretscanner

secretscanner

An MCP server for autonomous AI agents to scan and detect hardcoded secrets, API keys, and passwords in source code files.

nutanix-mcp

nutanix-mcp

A multitenant Streamable HTTP bridge over Nutanix's Prism Central v4 API MCP server, enabling per-tenant credential forwarding and read-only tool operations.

MCP Server Collection

MCP Server Collection

MCP サービス集約 (MCP sābisu shūgyō)

Board

Board

A kanban board MCP server that lets Claude Code manage tasks through a local web UI, including claiming, submitting, and querying tasks with automatic git branch and PR creation.

SEFAZ DF: IPTU (Emissão Guia)

SEFAZ DF: IPTU (Emissão Guia)

Enables users to query official SEFAZ DF IPTU (Distrito Federal property tax) information and issue tax payment guides directly from AI assistants like Claude and ChatGPT. A read-only MCP server with one tool, hosted for any MCP-enabled client, using a prepaid, pay-per-query model.

funding-rates-mcp

funding-rates-mcp

funding-rates-mcp

mcp-servers

mcp-servers

MCPサーバーでLLMにスーパーパワーを付与する

Ceph Command Knowledge Base MCP Server

Ceph Command Knowledge Base MCP Server

Enables AI agents to verify Ceph CLI commands, config parameters, and review test scripts using a pre-generated knowledge base.

MCP GraphQL Query Generator

MCP GraphQL Query Generator

Automatically discovers GraphQL APIs through introspection and generates table-formatted queries with pagination, filters, and sorting. Supports multiple authentication types and provides both CLI and REST API interfaces for seamless integration.

Hermes MCP Server

Hermes MCP Server

Enables AI clients to communicate with Hermes messaging middleware in real-time using MCP protocol, supporting conversations, messages, attachments, and permissions management.

Accounting MCP

Accounting MCP

A personal financial management tool that enables AI assistants to record transactions, check balances, and provide monthly financial summaries via the Model Context Protocol. It allows users to manage their expenses and income through natural language interactions using standardized MCP tools and resources.

swiss-culture-mcp

swiss-culture-mcp

MCP server providing access to Swiss cultural heritage data including ISOS townscapes, Living Traditions, cultural prizes, and press releases from the Federal Office of Culture, with no API key required.

mcp-i18n

mcp-i18n

MCP server for page-level i18n translation using Alibaba Cloud Qwen models, supporting incremental translation, glossary, and multiple target languages.

managed-agent-control-mcp

managed-agent-control-mcp

Start, observe, and interact with Claude Managed Agents from any MCP client — launch an agent, watch its events, reply, approve the tools it wants to run, and stop it. Runs over stdio, HTTP, or AWS Lambda with pluggable auth.

figma-local-bridge

figma-local-bridge

A local-only MCP bridge that connects an MCP client to an open Figma file via a Figma plugin, enabling direct document editing, inspection, export, and audit without using the Figma REST API.

mcp-server-intro

mcp-server-intro

MCP Domain Availability Server

MCP Domain Availability Server

Enables checking domain availability and pricing using the GoDaddy OTE API, supporting multiple TLD suffixes and both fast and full check modes.

ThinMCP

ThinMCP

A local MCP gateway that compresses multiple upstream servers into two tools, search and execute, to minimize model context usage. It provides a compact, code-driven interface for discovering and calling tools across various upstream sources on demand.

Notion MCP Server

Notion MCP Server

AI-friendly MCP server for Notion API, enabling agents to search, read, query, and update Notion pages and databases with compact responses.