Discover Awesome MCP Servers

Extend your agent with 26,794 capabilities via MCP servers.

All26,794
MCP Bundler Service

MCP Bundler Service

一个微服务,用于从 GitHub 仓库打包 MCP 服务器,并准备好进行部署。

mcp-server-yahoo-finance MCP server

mcp-server-yahoo-finance MCP server

镜子 (jìng zi)

MCP Test Client

MCP Test Client

MCP 测试客户端是一个用于模型上下文协议 (MCP) 服务器的 TypeScript 测试实用程序。

Minimal MCP Server

Minimal MCP Server

好的,以下是一个 Model Context Protocol (MCP) 服务器的最小实现,用 Python 编写,并使用 `asyncio` 库进行异步操作。 这个例子展示了如何监听连接,接收消息,并发送简单的响应。 ```python import asyncio import json async def handle_client(reader, writer): """处理单个客户端连接.""" addr = writer.get_extra_info('peername') print(f"连接来自 {addr}") try: while True: data = await reader.read(1024) # 读取最多 1024 字节 if not data: break message = data.decode() print(f"接收到消息: {message}") try: # 尝试解析 JSON request = json.loads(message) # 在这里添加你的 MCP 逻辑 # 例如,根据请求类型执行不同的操作 if "method" in request: method = request["method"] if method == "ping": response = {"result": "pong"} elif method == "get_model_info": response = {"result": {"model_name": "MyModel", "version": "1.0"}} # 示例模型信息 else: response = {"error": "Unknown method"} else: response = {"error": "Invalid request"} response_json = json.dumps(response) writer.write(response_json.encode()) await writer.drain() # 刷新缓冲区 print(f"发送响应: {response_json}") except json.JSONDecodeError: print("接收到无效的 JSON") writer.write(b'{"error": "Invalid JSON"}') await writer.drain() except ConnectionError as e: print(f"连接错误: {e}") finally: print(f"关闭连接 {addr}") writer.close() await writer.wait_closed() async def main(): """启动服务器.""" server = await asyncio.start_server( handle_client, '127.0.0.1', 8888) # 监听本地地址 127.0.0.1 端口 8888 addr = server.sockets[0].getsockname() print(f'服务于 {addr}') async with server: await server.serve_forever() if __name__ == "__main__": asyncio.run(main()) ``` **代码解释:** 1. **`handle_client(reader, writer)` 函数:** - 这是处理每个客户端连接的主要函数。 - `reader` 和 `writer` 是 `asyncio.StreamReader` 和 `asyncio.StreamWriter` 对象,用于读取和写入数据。 - `writer.get_extra_info('peername')` 获取客户端的地址。 - `reader.read(1024)` 从客户端读取最多 1024 字节的数据。 - `data.decode()` 将接收到的字节数据解码为字符串。 - `json.loads(message)` 尝试将接收到的消息解析为 JSON 对象。 - **MCP 逻辑:** 这是代码的核心部分,你需要根据 MCP 协议的要求实现你的逻辑。 在这个例子中,它检查请求中是否存在 "method" 字段,并根据方法名称返回不同的响应。 `ping` 方法返回 `pong`,`get_model_info` 返回一个示例模型信息。 - `json.dumps(response)` 将响应转换为 JSON 字符串。 - `writer.write(response_json.encode())` 将 JSON 字符串编码为字节数据并发送给客户端。 - `await writer.drain()` 刷新缓冲区,确保数据被发送。 - `writer.close()` 关闭连接。 - `await writer.wait_closed()` 等待连接完全关闭。 - 异常处理:包括 `json.JSONDecodeError` 处理无效的 JSON,以及 `ConnectionError` 处理连接错误。 2. **`main()` 函数:** - `asyncio.start_server(handle_client, '127.0.0.1', 8888)` 启动一个 TCP 服务器,监听本地地址 127.0.0.1 的 8888 端口。 `handle_client` 函数将处理每个新的客户端连接。 - `server.serve_forever()` 运行服务器,直到手动停止。 3. **`if __name__ == "__main__":` 块:** - 确保 `asyncio.run(main())` 只在脚本直接运行时执行,而不是作为模块导入时执行。 **如何运行:** 1. **保存代码:** 将代码保存为 `mcp_server.py`。 2. **运行脚本:** 在终端中运行 `python mcp_server.py`。 **如何测试:** 你可以使用 `telnet` 或 `netcat` 等工具来连接服务器并发送 MCP 请求。 例如: ```bash telnet 127.0.0.1 8888 ``` 然后,你可以发送一个 JSON 请求,例如: ```json {"method": "ping"} ``` 服务器应该返回: ```json {"result": "pong"} ``` 或者发送: ```json {"method": "get_model_info"} ``` 服务器应该返回: ```json {"result": {"model_name": "MyModel", "version": "1.0"}} ``` **重要注意事项:** * **错误处理:** 这个例子只包含基本的错误处理。 在实际应用中,你需要添加更完善的错误处理机制,例如记录错误日志,返回更详细的错误信息给客户端。 * **安全性:** 这个例子没有考虑安全性。 在生产环境中,你需要采取安全措施,例如身份验证、授权、加密等。 * **MCP 协议:** 这个例子只是一个框架。 你需要根据 MCP 协议的规范来实现你的 MCP 逻辑。 这包括定义消息格式、方法名称、参数、返回值等。 * **异步编程:** `asyncio` 是一个强大的异步编程库。 如果你不熟悉 `asyncio`,建议先学习一下 `async` 和 `await` 的用法。 * **依赖:** 这个例子只依赖于 Python 的标准库 `asyncio` 和 `json`,不需要安装额外的依赖。 * **扩展性:** 这个例子是一个最小实现。 你可以根据需要扩展它,例如添加多线程支持、使用更高效的序列化方法、支持更多的 MCP 方法等。 **下一步:** 1. **定义你的 MCP 协议:** 明确你的 MCP 协议的规范,包括消息格式、方法名称、参数、返回值等。 2. **实现你的 MCP 逻辑:** 根据你的 MCP 协议,实现 `handle_client` 函数中的 MCP 逻辑。 3. **添加错误处理:** 添加更完善的错误处理机制。 4. **考虑安全性:** 采取安全措施,例如身份验证、授权、加密等。 5. **测试和调试:** 充分测试和调试你的服务器。 这个最小实现为你提供了一个起点。 你可以根据你的具体需求来扩展和修改它。

MCP Servers Multi-Agent AI Infrastructure

MCP Servers Multi-Agent AI Infrastructure

gorse

gorse

Data On Tap Inc. 是一家在加拿大运营网络 302 100 的完整 MVNO(移动虚拟网络运营商)。这是 DOT 的代码仓库。它包括高级安全和身份验证、各种连接工具、智能功能(包括智能网络预留)、eSIM/iSIM、引导无线连接、D2C 卫星、构建框架和概念,以及 OpenAPI 3.1 和 MCP 服务器。

ws-mcp

ws-mcp

Database Analyzer MCP Server

Database Analyzer MCP Server

Local iMessage RAG MCP Server

Local iMessage RAG MCP Server

来自 Anthropic MCP 黑客马拉松 (纽约) 的 iMessage RAG MCP 服务器

worker17

worker17

一个 MCP 服务器,用于监控员工生产力并在必要时解雇他们。

Quarkus Model Context Protocol (MCP) Server

Quarkus Model Context Protocol (MCP) Server

这个扩展程序使开发者能够轻松地实现 MCP 服务器的各项功能。

TypeScript MCP Server

TypeScript MCP Server

MCP (Model Context Protocol)

MCP (Model Context Protocol)

一个用于人工智能的简单模型上下文服务器

MSSQL MCP Server

MSSQL MCP Server

镜子 (jìng zi)

@enemyrr/mcp-mysql-server

@enemyrr/mcp-mysql-server

镜子 (jìng zi)

MCP Actions Adapter

MCP Actions Adapter

一个简单的适配器,用于将 MCP 服务器转换为与 GPT actions 兼容的 API。

Eka MCP Server

Eka MCP Server

Eka MCP 服务器 (Eka MCP fúwùqì)

T2_C2

T2_C2

Please be more specific. "Server code for MCP" is too vague. MCP could refer to many things. To give you relevant information, I need to know which MCP you're referring to. For example, are you looking for: * **Minecraft Protocol (MCP):** If you're referring to the protocol used for Minecraft servers, I can provide information about how to implement a server that uses the Minecraft protocol. This is a complex topic, and I'd need to know which version of Minecraft you're targeting (e.g., 1.19.4, 1.20.1, etc.) and what language you want to use (e.g., Java, Python, C++). I can also provide links to existing libraries that handle the protocol. * **Minecraft Coder Pack (MCP):** If you're referring to the tool used to decompile, deobfuscate, and recompile Minecraft code, I can explain how it works and where to find it. However, I cannot provide the actual decompiled Minecraft code, as that would likely violate copyright. * **A specific application or system named MCP:** If you're referring to a specific application or system that uses the acronym MCP, please provide more context. What does the MCP do? Who developed it? Once you provide more details, I can give you a more helpful and accurate response. In the meantime, here's a general example of a very basic (and incomplete) Minecraft server in Python, just to illustrate the concept: ```python # This is a VERY basic example and not a functional Minecraft server. # It's just to illustrate the concept. You'll need a proper Minecraft # protocol implementation to build a real server. import socket HOST = '127.0.0.1' # Standard loopback interface address (localhost) PORT = 25565 # Port to listen on (non-privileged ports are > 1023) with socket.socket(socket.AF_INET, socket.SOCK_STREAM) as s: s.bind((HOST, PORT)) s.listen() print(f"Listening on {HOST}:{PORT}") conn, addr = s.accept() with conn: print(f"Connected by {addr}") while True: data = conn.recv(1024) if not data: break print(f"Received: {data}") # Here you would need to parse the Minecraft protocol data # and respond accordingly. This is where a library like # `mcproto` or similar would be essential. response = b"Hello, client!" # Example response conn.sendall(response) ``` **Important Considerations for a Real Minecraft Server:** * **Minecraft Protocol:** The Minecraft protocol is complex and binary. You'll need to understand how to encode and decode packets. * **Libraries:** Use a library to handle the protocol. Don't try to implement it from scratch unless you have a very good reason. * **Performance:** Minecraft servers need to handle many connections and process data quickly. Choose a language and libraries that are performant. * **Security:** Protect your server from attacks. * **World Generation:** You'll need to generate and manage the game world. * **Player Management:** Handle player authentication, inventory, and other player-related data. Please provide more information about what you're trying to do, and I can give you more specific guidance. --- **Translation to Chinese:** 请更具体地说明。“MCP的服务器代码”太笼统了。 MCP可能指代很多东西。 为了给您提供相关信息,我需要知道您指的是哪个MCP。 例如,您是否在寻找: * **Minecraft协议(MCP):** 如果您指的是用于Minecraft服务器的协议,我可以提供有关如何实现使用Minecraft协议的服务器的信息。 这是一个复杂的主题,我需要知道您要针对哪个版本的Minecraft(例如,1.19.4、1.20.1等)以及您想使用哪种语言(例如,Java,Python,C ++)。 我还可以提供指向现有库的链接,这些库可以处理该协议。 * **Minecraft Coder Pack(MCP):** 如果您指的是用于反编译,反混淆和重新编译Minecraft代码的工具,我可以解释它的工作原理以及在哪里可以找到它。 但是,我无法提供实际的反编译Minecraft代码,因为这可能会侵犯版权。 * **名为MCP的特定应用程序或系统:** 如果您指的是使用首字母缩写词MCP的特定应用程序或系统,请提供更多上下文。 MCP做什么? 谁开发的? 一旦您提供更多详细信息,我就可以给您更有效和准确的答复。 同时,这是一个非常基本的(且不完整的)Python中的Minecraft服务器示例,仅用于说明概念: ```python # 这是一个非常基本的例子,而不是一个功能齐全的Minecraft服务器。 # 这只是为了说明概念。 您需要一个适当的Minecraft协议实现来构建一个真正的服务器。 import socket HOST = '127.0.0.1' # 标准环回接口地址(localhost) PORT = 25565 # 要监听的端口(非特权端口> 1023) with socket.socket(socket.AF_INET, socket.SOCK_STREAM) as s: s.bind((HOST, PORT)) s.listen() print(f"Listening on {HOST}:{PORT}") conn, addr = s.accept() with conn: print(f"Connected by {addr}") while True: data = conn.recv(1024) if not data: break print(f"Received: {data}") # 在这里,您需要解析Minecraft协议数据 # 并做出相应的回应。 在这里,像`mcproto`这样的库 # 或类似的东西将是必不可少的。 response = b"Hello, client!" # 示例响应 conn.sendall(response) ``` **实际Minecraft服务器的重要注意事项:** * **Minecraft协议:** Minecraft协议复杂且是二进制的。 您需要了解如何编码和解码数据包。 * **库:** 使用库来处理协议。 除非您有充分的理由,否则不要尝试从头开始实现它。 * **性能:** Minecraft服务器需要处理许多连接并快速处理数据。 选择一种性能良好的语言和库。 * **安全性:** 保护您的服务器免受攻击。 * **世界生成:** 您需要生成和管理游戏世界。 * **玩家管理:** 处理玩家身份验证,库存和其他与玩家相关的数据。 请提供有关您要执行的操作的更多信息,我可以为您提供更具体的指导。

ActionKit MCP Starter

ActionKit MCP Starter

Okay, here's a translation of "Starter code for a MCP server powered by ActionKit" into Chinese, along with a few options depending on the nuance you want to convey: **Option 1 (Most Literal):** * **基于 ActionKit 的 MCP 服务器的起始代码** * (Jīyú ActionKit de MCP fúwùqì de qǐshǐ dàimǎ) This is a direct translation. It's clear and understandable. **Option 2 (Slightly More Natural):** * **使用 ActionKit 构建的 MCP 服务器的初始代码** * (Shǐyòng ActionKit gòujiàn de MCP fúwùqì de chūshǐ dàimǎ) This emphasizes that ActionKit is used to *build* the server. "构建 (gòujiàn)" means "to build" or "to construct." **Option 3 (Focus on Getting Started):** * **用于 ActionKit 驱动的 MCP 服务器的入门代码** * (Yòng yú ActionKit qūdòng de MCP fúwùqì de rùmén dàimǎ) This emphasizes that the code is for *getting started* with an ActionKit-powered server. "入门 (rùmén)" means "entry-level" or "getting started." "驱动 (qūdòng)" means "driven by" or "powered by." **Option 4 (Concise and Common):** * **ActionKit MCP 服务器的初始代码** * (ActionKit MCP fúwùqì de chūshǐ dàimǎ) This is a more concise version, assuming the context makes it clear that the code is *for* the server. It's common to omit "基于" or "使用" in Chinese when it's implied. **Which option is best depends on the specific context:** * If you want to be very precise and literal, use Option 1. * If you want to emphasize the building aspect, use Option 2. * If you want to emphasize that it's for beginners, use Option 3. * If you want a concise and common phrasing, use Option 4. **Key Vocabulary:** * **起始代码 (qǐshǐ dàimǎ) / 初始代码 (chūshǐ dàimǎ):** Starter code, initial code * **MCP 服务器 (MCP fúwùqì):** MCP server * **基于 (jīyú):** Based on * **使用 (shǐyòng):** To use * **构建 (gòujiàn):** To build, to construct * **驱动 (qūdòng):** Driven by, powered by * **入门 (rùmén):** Entry-level, getting started I hope this helps! Let me know if you have any other questions.

xtrace-mcp

xtrace-mcp

Alpaca MCP Server

Alpaca MCP Server

镜子 (jìng zi)

Mcp Servers Collection

Mcp Servers Collection

已验证的 MCP 服务器和集成集合

Servidor MCP do Supabase

Servidor MCP do Supabase

Supabase 具有查询和插入数据功能的 MCP 服务器。

Wisdom MCP Gateway

Wisdom MCP Gateway

Enterpret Wisdom MCP SSE 服务器的 stdio 网关

Chrome MCP Server

Chrome MCP Server

用于 Chrome 扩展程序和 Claude AI 之间集成的 MCP 服务器

ディーゼロ開発環境用 MCPサーバー

ディーゼロ開発環境用 MCPサーバー

D-Zero 前端编码 MCP 服务器

Atlassian Jira MCP Server

Atlassian Jira MCP Server

用于 Atlassian Jira 的 Node.js/TypeScript MCP 服务器。为 AI 系统(LLM)配备工具,以列出/获取项目、搜索/获取问题(使用 JQL/ID)以及查看开发信息(提交、PR)。将 AI 功能直接连接到 Jira 项目管理和问题跟踪工作流程中。

mcp-server

mcp-server

镜子 (jìng zi)

📸 Smart Photo Journal MCP Server

📸 Smart Photo Journal MCP Server

镜子 (jìng zi)

Grasshopper MCP サーバー

Grasshopper MCP サーバー

用于 Rhinoceros/Grasshopper 集成的模型上下文协议 (MCP) 服务器实现,使 AI 模型能够与参数化设计工具交互。