发现优秀的 MCP 服务器

通过 MCP 服务器扩展您的代理能力,拥有 86,267 个能力。

全部86,267
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 isn't a widely standardized protocol, I'll make some assumptions about its structure. I'll assume it's a text-based protocol where messages are delimited by a newline character (`\n`). You'll likely need to adapt this to your specific MCP definition. **Conceptual Overview** 1. **Server Setup:** Create a TCP listener to accept incoming connections. 2. **Connection Handling:** For each connection, create a new thread or task to handle it concurrently. 3. **Receive Data:** Read data from the client socket. 4. **Parse MCP Message:** Parse the received data according to your MCP specification. In this simple echo example, we'll just treat the entire line as the message. 5. **Echo Response:** Send the received message back to the client. 6. **Close Connection:** Close the socket when the client disconnects or an error occurs. **Code Example (.NET Core)** ```csharp using System; using System.Net; using System.Net.Sockets; using System.Text; using System.Threading.Tasks; namespace McpEchoServer { class Program { private static int _port = 12345; // Change this to your desired port private static IPAddress _ipAddress = IPAddress.Any; // Listen on all interfaces static async Task Main(string[] args) { TcpListener listener = null; try { listener = new TcpListener(_ipAddress, _port); listener.Start(); Console.WriteLine($"MCP Echo Server started on {_ipAddress}:{_port}"); while (true) { TcpClient client = await listener.AcceptTcpClientAsync(); Console.WriteLine($"Accepted new client: {client.Client.RemoteEndPoint}"); _ = HandleClientAsync(client); // Fire and forget - handle client in a separate task } } catch (Exception e) { Console.WriteLine($"An error occurred: {e}"); } finally { listener?.Stop(); } Console.WriteLine("Server stopped."); } static async Task HandleClientAsync(TcpClient client) { try { using (NetworkStream stream = client.GetStream()) using (var reader = new System.IO.StreamReader(stream, Encoding.UTF8)) using (var writer = new System.IO.StreamWriter(stream, Encoding.UTF8) { AutoFlush = true }) // AutoFlush ensures data is sent immediately { string message; while ((message = await reader.ReadLineAsync()) != null) { Console.WriteLine($"Received: {message} from {client.Client.RemoteEndPoint}"); // Echo the message back await writer.WriteLineAsync(message); Console.WriteLine($"Sent: {message} to {client.Client.RemoteEndPoint}"); } Console.WriteLine($"Client disconnected: {client.Client.RemoteEndPoint}"); } } catch (Exception e) { Console.WriteLine($"Error handling client {client.Client.RemoteEndPoint}: {e}"); } finally { client.Close(); } } } } ``` **How to Use:** 1. **Create a new .NET Core Console Application:** In Visual Studio or using the .NET CLI (`dotnet new console`). 2. **Replace the `Program.cs` content:** Paste the code above into your `Program.cs` file. 3. **Adjust the Port:** Change the `_port` variable to the port you want the server to listen on. 4. **Run the Server:** Build and run the application. You should see the "MCP Echo Server started" message. **Client Example (Simple Telnet or Netcat)** You can test this server using a simple Telnet client or Netcat. * **Telnet:** Open a command prompt or terminal and type: `telnet localhost 12345` (replace `12345` with your port). Then type some text and press Enter. You should see the same text echoed back. * **Netcat (nc):** `nc localhost 12345`. Type some text and press Enter. **Explanation:** * **`TcpListener`:** Listens for incoming TCP connections on the specified IP address and port. * **`AcceptTcpClientAsync()`:** Asynchronously accepts a pending connection request. This returns a `TcpClient` object representing the connected client. * **`HandleClientAsync()`:** This `async` method handles the communication with a single client. It's launched as a separate task using `_ = HandleClientAsync(client);` so that the server can handle multiple clients concurrently. * **`NetworkStream`:** Provides access to the underlying network stream of the `TcpClient`. * **`StreamReader` and `StreamWriter`:** Used for reading and writing text data to the stream. `StreamReader.ReadLineAsync()` reads a line of text from the stream asynchronously. `StreamWriter.WriteLineAsync()` writes a line of text to the stream asynchronously. `AutoFlush = true` ensures that data is sent immediately. * **`Encoding.UTF8`:** Specifies the character encoding to use for reading and writing text. * **`client.Close()`:** Closes the connection to the client. * **Error Handling:** The `try...catch...finally` blocks provide basic error handling. **Important Considerations and Improvements:** * **MCP Specification:** This example assumes a very simple MCP protocol. You'll need to adapt the parsing and message handling logic to match your actual MCP specification. This might involve parsing headers, message types, data lengths, etc. * **Error Handling:** The error handling is basic. You should add more robust error handling to catch exceptions and handle them gracefully. Consider logging errors. * **Threading/Task Management:** The `_ = HandleClientAsync(client);` approach is a simple way to launch a task, but for a production server, you might want to use a more sophisticated task management strategy (e.g., using a `TaskScheduler` or a thread pool) to control the number of concurrent tasks. * **Security:** This example is not secure. If you're transmitting sensitive data, you should use TLS/SSL to encrypt the connection. * **Message Framing:** If your MCP protocol doesn't use newline characters as delimiters, you'll need to implement a different message framing mechanism (e.g., using a fixed-length header that specifies the message length). * **Asynchronous Operations:** The use of `async` and `await` makes the server more scalable by allowing it to handle multiple clients concurrently without blocking threads. * **Logging:** Implement a logging mechanism to record server events, errors, and client interactions. This is crucial for debugging and monitoring. * **Configuration:** Externalize configuration settings (e.g., port number, IP address) into a configuration file. **Chinese Translation of Key Concepts:** * **Model Context Protocol (MCP):** 模型上下文协议 (Móxíng shàngxiàwén xiéyì) * **Echo Service:** 回显服务 (Huíxiǎn fúwù) * **.NET Core:** .NET Core * **TCP Listener:** TCP 监听器 (TCP jiāntīng qì) * **Socket:** 套接字 (Tàojiēzì) * **Network Stream:** 网络流 (Wǎngluò liú) * **Asynchronous:** 异步 (Yìbù) * **Thread:** 线程 (Xiànchéng) * **Task:** 任务 (Rènwù) * **Client:** 客户端 (Kèhùduān) * **Server:** 服务器 (Fúwùqì) * **Port:** 端口 (Duānkǒu) * **IP Address:** IP 地址 (IP dìzhǐ) * **Encoding:** 编码 (Biānmǎ) * **Message:** 消息 (Xiāoxī) * **Delimiter:** 分隔符 (Fēngéfú) This comprehensive example should give you a good starting point for building your MCP echo server in .NET Core. Remember to adapt the code to your specific MCP protocol requirements. Good luck!

Obsidian Agent Bridge

Obsidian Agent Bridge

A secure MCP server that connects ChatGPT/Codex to a local Obsidian Vault, enabling controlled knowledge retrieval, note maintenance, and daily ingest while enforcing path policies, concurrency checks, and audit.

certified-mcp

certified-mcp

An MCP server that provides tools for certificate verification, equivalence proving, and pre-registration sealing, enabling AI agents to re-derive verdicts from artifacts rather than trust assertions.

OPNsense MCP Server

OPNsense MCP Server

OPNsense MCP Server

gdevelop-mcp-server

gdevelop-mcp-server

Provides a local control plane for GDevelop game projects, enabling Codex to open projects, build previews, and serve them over HTTP for debugging.

ContextBridge

ContextBridge

Local-first code retrieval for AI agents — cuts codebase context from thousands of tokens to a few hundred, with zero hallucinated file paths.

API MCP Server

API MCP Server

A Model Context Protocol server that provides basic tools for arithmetic operations (addition) and dynamic greeting resources, demonstrating MCP integration patterns for other projects and clients.

React Patterns MCP Server

React Patterns MCP Server

Provides React design and rendering patterns from patterns.dev as MCP tools and resources for Claude Code.

visual-browser-agent

visual-browser-agent

Enables AI coding agents to see and interact with real Chrome pages through structured DOM inspection, targeted screenshots, recordings, and human-in-the-loop approvals across major coding-agent hosts.

@avidian/mcp-jira

@avidian/mcp-jira

MCP server for Jira Cloud — gives AI agents full context and control over Jira issues, projects, sprints, and workflows.

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.

websupport-mcp

websupport-mcp

An MCP server wrapping the Websupport REST API to expose DNS, FTP, hosting, databases, mailboxes, VPS, and invoice operations as MCP tools with HMAC-SHA1 authentication.

MUXI Framework

MUXI Framework

一个可扩展的 AI 代理框架 (Yī gè kě kuòzhǎn de AI dàilǐ kuàngjià)

Ableton MCP

Ableton MCP

Enables full control of Ableton Live from AI assistants, including transport, tracks, clips, devices, and scene management through 143 tools.

Spectre

Spectre

Enables AI agents to search, read user profiles, timelines, media, follow threads, track trends, and manage accounts on X/Twitter via GraphQL, without browser automation or paid API keys.

SkillPort

SkillPort

A management toolkit for AI agent skills that provides an MCP server for search-first skill discovery and on-demand loading. It enables users to validate, organize, and serve standardized skills to MCP-compatible clients like Cursor and GitHub Copilot.

PCSX2 MCP

PCSX2 MCP

A Windows-focused MCP server for controlling and debugging PCSX2 via GDB, offering emulator control, memory inspection, debugger operations, savestates, cheats, screenshots, process management, and log access.

Azure DevOps MCP Server

Azure DevOps MCP Server

Enables AI assistants to interact with Azure DevOps repositories and pull requests, including listing PRs, fetching diffs, adding comments, and performing automated code reviews.

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.

OpenXNet MCP Server

OpenXNet MCP Server

Provides an isolated MCP gateway for SynapXnet AIOps, DataOps, and MLOps evidence-to-remediation workflows, with OAuth validation, scoped tool discovery, persistent approvals, and audit tracking.

Whois MCP

Whois MCP

一个模型上下文协议(Model Context Protocol)服务器,允许人工智能代理执行 WHOIS 查询,使用户可以直接向 AI 询问域名可用性、所有权、注册详情和其他域名信息。

UniFi MCP

UniFi MCP

An MCP server that enables AI assistants to manage UniFi network infrastructure, including cloud management, local network devices, and Protect cameras, through natural language.

exo

exo

Read-only MCP server exposing a filtered copy of your personal context record as one SQL surface, so assistants can query your data without the vendor owning it.

GA4 MCP Server

GA4 MCP Server

Enables interaction with Google Analytics 4 data through the Google Analytics Data API. Built using Google ADK UI and deployed on Google Cloud Platform with proper service account authentication for GA4 data access.

n8n-MCP

n8n-MCP

An MCP server that empowers AI assistants to build, validate, and manage n8n workflows by providing structured access to documentation for over 1,200 nodes and thousands of templates. It enables deep integration with n8n instances for automated workflow orchestration and management through natural language.

PostMCP

PostMCP

An MCP server for managing AI-generated social news posts in Firebase Firestore, enabling CRUD operations on posts with categories and tags.

mcp-server-web3

mcp-server-web3

基于 Anthropic 的 MCP 的 Web3 函数插件服务器。

Nara Market FastMCP Server

Nara Market FastMCP Server

Provides access to South Korean government procurement (G2B) and Nara Market shopping mall data, enabling users to search bid announcements, procurement statistics, product catalogs, and contract information through 15 specialized tools.

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.

magic-api-mcp-server

magic-api-mcp-server

Enables AI assistants to interact with Magic-API development environment, supporting script syntax query, API management, debugging, and knowledge search for efficient development.