发现优秀的 MCP 服务器

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

开发者工具3,065
Jira JQL Tool for Claude

Jira JQL Tool for Claude

简单实用的MCP工具 (Jiǎndān shíyòng de MCP gōngjù)

build-simple-mcp

build-simple-mcp

Okay, here's a breakdown of how to build a simple Minecraft Protocol (MCP) server in Python. This will be a very basic server, focusing on the handshake and status phases. It won't handle actual gameplay. It's designed to be a starting point for learning the protocol. **Important Considerations:** * **Complexity:** The Minecraft Protocol is complex. This example simplifies things significantly. A full-fledged server requires handling many more packets, game logic, and world data. * **Security:** This example is *not* secure. It doesn't include encryption or authentication. Do not expose this to the internet without adding proper security measures. * **Libraries:** We'll use the `struct` module for packing and unpacking data, and `socket` for network communication. No external libraries are strictly required for this basic example, but libraries like `nbt` (for handling NBT data) and `cryptography` (for encryption) would be essential for a more complete server. * **Minecraft Version:** The Minecraft protocol changes with each version. This example is based on a relatively recent version (e.g., 1.19+), but you'll need to adjust the protocol version and packet IDs if you're targeting a different version. Refer to the Minecraft Protocol documentation for your target version. [https://wiki.vg/Protocol](https://wiki.vg/Protocol) is an excellent resource. **Python Code (Simple MCP Server):** ```python import socket import struct import json # Configuration HOST = 'localhost' # Listen on all interfaces PORT = 25565 PROTOCOL_VERSION = 762 # Example: Minecraft 1.19.2 SERVER_VERSION_NAME = "My Simple Server" MAX_PLAYERS = 20 MOTD = "§aA Simple Minecraft Server\n§bWelcome!" # Supports Minecraft color codes def create_varint(data): """Encodes an integer as a Minecraft VarInt.""" out = bytearray() while True: byte = data & 0x7F data >>= 7 if data != 0: byte |= 0x80 out.append(byte) if data == 0: break return bytes(out) def read_varint(sock): """Reads a Minecraft VarInt from the socket.""" result = 0 shift = 0 while True: byte = sock.recv(1)[0] result |= (byte & 0x7F) << shift shift += 7 if not byte & 0x80: break if shift > 35: raise ValueError("VarInt is too big") # Prevent infinite loop return result def create_string(data): """Creates a Minecraft string (VarInt length + UTF-8 encoded string).""" encoded_string = data.encode('utf-8') length = create_varint(len(encoded_string)) return length + encoded_string def create_packet(packet_id, data): """Creates a Minecraft packet (VarInt length + VarInt packet ID + data).""" packet_id_bytes = create_varint(packet_id) packet_data = packet_id_bytes + data packet_length = create_varint(len(packet_data)) return packet_length + packet_data def handle_handshake(sock): """Handles the Handshake phase.""" protocol_version = read_varint(sock) server_address_length = read_varint(sock) server_address = sock.recv(server_address_length).decode('utf-8') server_port = struct.unpack('>H', sock.recv(2))[0] # Unpack unsigned short (big endian) next_state = read_varint(sock) print(f"Handshake: Protocol {protocol_version}, Address {server_address}:{server_port}, Next State {next_state}") return next_state def handle_status_request(sock): """Handles the Status Request and Response.""" # Status Request (empty packet) packet_length = read_varint(sock) packet_id = read_varint(sock) if packet_id != 0x00: print(f"Unexpected packet ID in status request: {packet_id}") return # Create Status Response status = { "version": { "name": SERVER_VERSION_NAME, "protocol": PROTOCOL_VERSION }, "players": { "max": MAX_PLAYERS, "online": 0, "sample": [] # Can add player samples here }, "description": { "text": MOTD } } status_json = json.dumps(status, ensure_ascii=False).encode('utf-8') # Ensure proper UTF-8 encoding status_string = create_string(status_json.decode('utf-8')) # Decode back to string for create_string status_packet = create_packet(0x00, status_string) sock.sendall(status_packet) def handle_ping(sock): """Handles the Ping Request and Response.""" # Ping Request (payload) packet_length = read_varint(sock) packet_id = read_varint(sock) payload = sock.recv(8) # 8-byte payload if packet_id != 0x01: print(f"Unexpected packet ID in ping request: {packet_id}") return # Create Ping Response (same payload) ping_packet = create_packet(0x01, payload) sock.sendall(ping_packet) def handle_client(sock, address): """Handles a single client connection.""" print(f"Accepted connection from {address}") try: # Handshake next_state = handle_handshake(sock) if next_state == 1: # Status handle_status_request(sock) handle_ping(sock) # Client expects a ping after status elif next_state == 2: # Login (not implemented in this example) print("Login requested, but not implemented.") # In a real server, you'd handle login here else: print(f"Unknown next state: {next_state}") except Exception as e: print(f"Error handling client: {e}") finally: sock.close() print(f"Connection from {address} closed.") def main(): """Main server loop.""" server_socket = socket.socket(socket.AF_INET, socket.SOCK_STREAM) server_socket.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1) # Allow address reuse server_socket.bind((HOST, PORT)) server_socket.listen(5) # Listen for up to 5 incoming connections print(f"Server listening on {HOST}:{PORT}") try: while True: client_socket, client_address = server_socket.accept() handle_client(client_socket, client_address) except KeyboardInterrupt: print("Server shutting down...") finally: server_socket.close() if __name__ == "__main__": main() ``` **Explanation:** 1. **Imports:** Imports necessary modules (`socket`, `struct`, `json`). 2. **Configuration:** Sets server parameters like host, port, protocol version, MOTD, etc. Adjust these to your liking. The `PROTOCOL_VERSION` is *critical* and must match the Minecraft client version you're using. 3. **`create_varint(data)`:** Encodes an integer into a Minecraft VarInt. VarInts are used for variable-length integer representation in the protocol. 4. **`read_varint(sock)`:** Reads a VarInt from the socket. 5. **`create_string(data)`:** Creates a Minecraft string, which is a VarInt representing the string length followed by the UTF-8 encoded string. 6. **`create_packet(packet_id, data)`:** Creates a complete Minecraft packet. A packet consists of a VarInt representing the packet length, a VarInt representing the packet ID, and the packet data. 7. **`handle_handshake(sock)`:** Handles the Handshake phase. This is the first phase of the protocol. The client sends a handshake packet containing the protocol version, server address, port, and the "next state" (1 for Status, 2 for Login). 8. **`handle_status_request(sock)`:** Handles the Status Request and Response. The client sends an empty status request packet. The server responds with a JSON string containing server information (version, player count, MOTD). 9. **`handle_ping(sock)`:** Handles the Ping Request and Response. The client sends a ping packet with a payload. The server responds with a pong packet containing the same payload. This is used to measure latency. 10. **`handle_client(sock, address)`:** Handles a single client connection. It calls the appropriate handler functions based on the "next state" received in the handshake. 11. **`main()`:** The main server loop. It creates a socket, binds it to the specified host and port, listens for incoming connections, and spawns a new thread (or process, in a more robust implementation) to handle each client. **How to Run:** 1. **Save:** Save the code as a Python file (e.g., `mcp_server.py`). 2. **Run:** Execute the script from your terminal: `python mcp_server.py` 3. **Connect:** Start your Minecraft client. In the multiplayer menu, add a server with the address `localhost:25565` (or the host and port you configured). *Make sure the Minecraft client version matches the `PROTOCOL_VERSION` in the code.* 4. **Observe:** You should see the server in the server list. When you hover over it, you should see the MOTD. You won't be able to join the server because the login phase is not implemented. The server's console output will show the handshake and status requests. **Chinese Translation of Key Concepts:** * **Minecraft Protocol (MCP):** Minecraft 协议 (Minecraft Xiéyì) * **Handshake:** 握手 (Wòshǒu) * **Status:** 状态 (Zhuàngtài) * **Login:** 登录 (Dēnglù) * **Packet:** 数据包 (Shùjù bāo) * **VarInt:** 变长整数 (Biàn cháng zhěngshù) * **MOTD (Message of the Day):** 每日消息 (Měi rì xiāoxī) / 服务器标语 (Fúwùqì biāoyǔ) * **Protocol Version:** 协议版本 (Xiéyì bǎnběn) * **Server Address:** 服务器地址 (Fúwùqì dìzhǐ) * **Port:** 端口 (Duānkǒu) * **Payload:** 载荷 (Zàihè) **Further Development:** * **Login Phase:** Implement the login phase to handle player authentication. This involves encryption and communication with Mojang's authentication servers. * **Gameplay:** Implement the gameplay loop, including handling player movement, chunk loading, entity management, and game logic. * **World Generation:** Generate or load a Minecraft world. You'll need to use an NBT library to read and write world data. * **Multi-threading/Asynchronous I/O:** Use threads or asynchronous I/O to handle multiple clients concurrently. * **Error Handling:** Add more robust error handling to gracefully handle unexpected events. * **Security:** Implement encryption and authentication to protect the server from attacks. This example provides a basic foundation. Building a complete Minecraft server is a significant undertaking. Good luck!

Plane MCP Server

Plane MCP Server

镜子 (jìng zi)

nyaypalak-core

nyaypalak-core

为 Naypalak 准备的 MCP 服务器

FastMCP

FastMCP

一个用于构建 MCP 服务器的 TypeScript 框架。

E-Book MCP Server with PDF Conversion

E-Book MCP Server with PDF Conversion

一个简单的 MCP 服务器,可以将 HTML 文档转换为 PDF。 (Or, a slightly more formal version:) 一个简单的 MCP 服务器,用于将 HTML 文档转换成 PDF 文件。

MCPE Alpha Server for Pterodactyl

MCPE Alpha Server for Pterodactyl

镜子 (jìng zi)

MCP Testing

MCP Testing

用于测试 MCP 服务器工具和功能 的代码仓库

MyMCP Prompt

MyMCP Prompt

MyMCP Prompt 是一个工具,用于从自然语言描述生成模型上下文协议 (MCP) 服务器。这个 MVP 使用 Google Gemini API 将用户描述转换为功能性的 Python MCP 服务器,并带有相应的 JSON 配置。

🚀 MCP-AWS: AI Agent for AWS EC2 Management

🚀 MCP-AWS: AI Agent for AWS EC2 Management

POC:使用 OpenAI Agents SDK 的 MCP 服务器

Substack MCP Server

Substack MCP Server

This request is a bit ambiguous. To give you the best translation, I need to understand what you're asking for. Here are a few possible interpretations and their corresponding Chinese translations: **Interpretation 1: A server (likely a middleware component) that uses the MCP (Message Control Protocol) to facilitate communication between the Substack API and Claude (likely referring to the Claude AI model).** * **Chinese Translation:** 使用 MCP 协议连接 Substack API 和 Claude 的服务器 (shǐyòng MCP xiéyì liánjiē Substack API hé Claude de fúwùqì) * **Breakdown:** * 使用 (shǐyòng): Using * MCP 协议 (MCP xiéyì): MCP Protocol * 连接 (liánjiē): Connect / Link * Substack API 和 Claude (Substack API hé Claude): Substack API and Claude * 的 (de): 's (possessive particle) * 服务器 (fúwùqì): Server **Interpretation 2: A server that integrates the Substack API with Claude, and this server uses MCP for some internal communication or management.** * **Chinese Translation:** 集成 Substack API 和 Claude 的服务器,该服务器使用 MCP 进行内部通信或管理 (jíchéng Substack API hé Claude de fúwùqì, gāi fúwùqì shǐyòng MCP jìnxíng nèibù tōngxìn huò guǎnlǐ) * **Breakdown:** * 集成 (jíchéng): Integrate * Substack API 和 Claude (Substack API hé Claude): Substack API and Claude * 的 (de): 's (possessive particle) * 服务器 (fúwùqì): Server * 该服务器 (gāi fúwùqì): This server * 使用 (shǐyòng): Uses * MCP (MCP): MCP * 进行 (jìnxíng): For * 内部通信或管理 (nèibù tōngxìn huò guǎnlǐ): Internal communication or management **Interpretation 3: A request for information or resources about setting up an MCP server for the purpose of integrating Substack API with Claude.** * **Chinese Translation:** 关于设置 MCP 服务器以集成 Substack API 和 Claude 的信息或资源 (guānyú shèzhì MCP fúwùqì yǐ jíchéng Substack API hé Claude de xìnxī huò zīyuán) * **Breakdown:** * 关于 (guānyú): About * 设置 (shèzhì): Setting up * MCP 服务器 (MCP fúwùqì): MCP Server * 以 (yǐ): In order to / To * 集成 (jíchéng): Integrate * Substack API 和 Claude (Substack API hé Claude): Substack API and Claude * 的 (de): 's (possessive particle) * 信息或资源 (xìnxī huò zīyuán): Information or resources **Which interpretation is closest to what you meant? Providing more context will allow me to give you a more accurate and helpful translation.** For example, what is the purpose of the MCP server? What kind of integration are you trying to achieve?

AWS Service Reference MCP Server

AWS Service Reference MCP Server

用于访问 AWS 编程服务授权参考的 MCP 服务器

Clojars MCP Server

Clojars MCP Server

镜子 (jìng zi)

SparkMango

SparkMango

Sparkmango 允许代理从合约 ABI 生成和使用 MCP 服务器。

Test d'intégration MCP Server GitHub

Test d'intégration MCP Server GitHub

MCP 服务器 GitHub 集成测试参考

GalaConnect MCP Server

GalaConnect MCP Server

用于大型语言模型 (LLM) 的 Galachain MCP 服务器

Falkordb

Falkordb

MCP_Testing

MCP_Testing

使用 Rust 测试 MCP 服务器

bilibili_mcp_server_full

bilibili_mcp_server_full

易于安装的Bilibili MCP服务器

Genai Toolbox

Genai Toolbox

开源的 MCP 服务器,专注于为数据库提供简单、快速且安全的工具。

mcp-servers

mcp-servers

MCP 服务器示例

Supabase MCP Server

Supabase MCP Server

用 Python 创建的 Supabase MCP 服务器。

UV Documentation MCP Server

UV Documentation MCP Server

一个模型上下文协议 (MCP) 服务器,用于提供对 UV 包管理器文档的访问。

Arcanna MCP Server

Arcanna MCP Server

Gumroad MCP Server

Gumroad MCP Server

Gumroad API 的模型上下文协议 (MCP) 服务器实现

Atlassian Confluence MCP Server

Atlassian Confluence MCP Server

镜子 (jìng zi)

Remote MCP Server on Cloudflare

Remote MCP Server on Cloudflare

Azure DevOps MCP Server

Azure DevOps MCP Server

Azure DevOps MCP 服务器

MCP GitHub Server

MCP GitHub Server

MCP DevTools

MCP DevTools

MCP DevTools:一套模型上下文协议服务器,使 AI 助手能够与开发者工具和服务进行交互