Discover Awesome MCP Servers

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

All17,119
MCP Server for Windsurf/Roocode

MCP Server for Windsurf/Roocode

用于 Windsurf 集成的模型上下文协议 (MCP) 服务器,具备图像生成和网页抓取功能。

go-mcp-mysql

go-mcp-mysql

零负担、即时可用的模型上下文协议 (MCP) 服务器,用于与 MySQL 交互和自动化。无需 Node.js 或 Python 环境。

A-MEM MCP Server

A-MEM MCP Server

用于 Agentic Memory (A-MEM) 系统的内存控制协议 (MCP) 服务器 - 一个为 LLM 代理设计的灵活、动态的内存系统

LottieFiles MCP Server

LottieFiles MCP Server

镜子 (jìng zi)

MCP Shell Server

MCP Shell Server

镜子 (jìng zi)

SerpApi MCP Server - Python

SerpApi MCP Server - Python

Lark MCP Server

Lark MCP Server

Remote MCP Server on Cloudflare

Remote MCP Server on Cloudflare

Mcp Base

Mcp Base

寻找最佳 MCP 服务器的目录

Minesweeper MCP Server 🚀

Minesweeper MCP Server 🚀

一个用于玩扫雷的 MCP 服务器

Sshclient

Sshclient

Template for Bun MCP Server

Template for Bun MCP Server

Okay, here's a template structure and some example code for a Bun + Minecraft Protocol (MCP) server project, along with explanations to get you started. This focuses on the core structure and handling basic connections. You'll need to adapt it based on the specific features you want to implement. **Project Structure:** ``` bun-mcp-server/ ├── src/ │ ├── index.ts # Main entry point │ ├── server.ts # Server logic (listening, connection handling) │ ├── protocol.ts # MCP packet handling (encoding/decoding) │ ├── player.ts # Player object/class │ ├── config.ts # Configuration loading │ └── utils.ts # Utility functions ├── package.json ├── bun.lockb ├── .gitignore └── README.md ``` **1. `package.json`:** ```json { "name": "bun-mcp-server", "version": "0.0.1", "description": "A Minecraft Protocol server written in Bun", "main": "src/index.ts", "scripts": { "start": "bun run src/index.ts", "dev": "bun run --watch src/index.ts" }, "dependencies": { // Add any dependencies here, e.g., for logging, configuration, etc. }, "devDependencies": { "@types/node": "^20.0.0" // Important for Node.js compatibility }, "type": "module" } ``` **Explanation:** * `name`, `version`, `description`: Standard package metadata. * `main`: Specifies the entry point of your application. * `scripts`: Defines commands for running and developing your server. `bun run src/index.ts` starts the server. `bun run --watch src/index.ts` starts the server in watch mode, automatically restarting when files change. * `dependencies`: List any external libraries your project uses. You'll likely need libraries for more advanced features (e.g., logging, configuration parsing). * `devDependencies`: Development-time dependencies, like TypeScript type definitions. `@types/node` is crucial for compatibility with Node.js APIs that Bun supports. * `type": "module"`: This is *essential* for using ES modules (import/export syntax) in Bun. **2. `src/index.ts` (Main Entry Point):** ```typescript import { startServer } from './server'; import { loadConfig } from './config'; async function main() { try { const config = await loadConfig(); // Load configuration console.log("Configuration loaded:", config); startServer(config); // Start the server } catch (error) { console.error("Error starting server:", error); } } main(); ``` **Explanation:** * This is the starting point of your application. * It imports the `startServer` function from `server.ts` and `loadConfig` from `config.ts`. * It calls `loadConfig` to load the server configuration. * It calls `startServer` to start the server, passing the configuration. * It includes error handling to catch any errors that occur during startup. **3. `src/server.ts` (Server Logic):** ```typescript import { listen } from 'bun'; import { handleConnection } from './protocol'; import { ServerConfig } from './config'; export function startServer(config: ServerConfig) { console.log(`Starting server on ${config.host}:${config.port}`); Bun.serve({ fetch(req, server) { if (server.upgrade(req)) { // handle WebSocket request return undefined; } return new Response("Upgrade failed :(", { status: 500 }); }, websocket: { open(ws) { console.log("Client connected"); handleConnection(ws); // Handle the new connection }, message(ws, message) { // Handle WebSocket message console.log(`Received message: ${message}`); }, close(ws, code, message) { console.log(`Client disconnected with code ${code} and message ${message}`); }, error(ws, error) { console.error("WebSocket error:", error); }, }, port: config.port, hostname: config.host, }); console.log("Server started"); } ``` **Explanation:** * This file contains the core server logic. * `startServer` function takes a `config` object (defined in `config.ts`). * It uses `Bun.serve` to create an HTTP server that listens for incoming connections. * The `fetch` function handles HTTP requests and upgrades them to WebSockets. * The `websocket` object defines the WebSocket event handlers: * `open`: Called when a new WebSocket connection is established. It calls `handleConnection` to process the connection. * `message`: Called when a WebSocket message is received. This is where you'll handle incoming MCP packets. * `close`: Called when a WebSocket connection is closed. * `error`: Called when a WebSocket error occurs. * The server listens on the port and hostname specified in the configuration. **4. `src/protocol.ts` (MCP Packet Handling):** ```typescript import { WebSocket } from 'bun'; import { Player } from './player'; export function handleConnection(ws: WebSocket) { console.log("Handling new connection..."); const player = new Player(ws); // Create a new player object ws.addEventListener("message", (event) => { const message = event.data; if (typeof message === "string") { console.log(`Received text message: ${message}`); } else if (message instanceof ArrayBuffer) { // Handle binary data (MCP packets) const buffer = new Uint8Array(message); console.log(`Received binary message: ${buffer}`); // TODO: Decode the MCP packet and process it // Example: // const packetId = buffer[0]; // switch (packetId) { // case 0x00: // Handshake // handleHandshake(buffer, player); // break; // // ... other packet types // default: // console.warn(`Unknown packet ID: ${packetId}`); // } } else { console.log(`Received unknown message type: ${typeof message}`); } }); ws.addEventListener("close", () => { console.log("Connection closed"); // Clean up player data }); ws.addEventListener("error", (error) => { console.error("WebSocket error:", error); }); } // Example Handshake handler (replace with actual MCP logic) function handleHandshake(buffer: Uint8Array, player: Player) { // TODO: Implement handshake logic based on the MCP protocol console.log("Handling handshake packet"); // Example: Read protocol version, server address, and next state from the buffer // const protocolVersion = buffer.readInt32BE(1); // Example: Read from offset 1 // ... } ``` **Explanation:** * This file handles the Minecraft Protocol (MCP) logic. * `handleConnection` is called when a new WebSocket connection is established. * It creates a `Player` object to represent the connected player. * It sets up event listeners for the WebSocket: * `message`: This is the most important part. It receives incoming messages from the client. You'll need to: * Check if the message is a string or an `ArrayBuffer`. MCP packets are binary data (ArrayBuffer). * Decode the MCP packet. This involves reading the packet ID and any data associated with the packet. * Process the packet based on its ID. This might involve updating the player's state, sending data to other players, etc. * `close`: Called when the connection is closed. You'll need to clean up any player data. * `error`: Called when an error occurs. * The `handleHandshake` function is a placeholder. You'll need to implement the actual handshake logic based on the MCP protocol. The handshake is the first packet sent by the client and is used to establish the connection. **5. `src/player.ts` (Player Class):** ```typescript import { WebSocket } from 'bun'; export class Player { socket: WebSocket; username: string | null = null; // Add other player properties here (e.g., position, health, inventory) constructor(socket: WebSocket) { this.socket = socket; } send(data: Uint8Array) { if (this.socket.readyState === WebSocket.OPEN) { this.socket.send(data); } else { console.warn("Socket is not open, cannot send data"); } } // Add methods for updating player state, sending packets, etc. } ``` **Explanation:** * This file defines the `Player` class, which represents a connected player. * It stores the player's WebSocket connection, username, and other properties. * The `send` method sends data to the player's client. * You'll need to add methods for updating the player's state, sending packets, and handling other player-related logic. **6. `src/config.ts` (Configuration):** ```typescript import { readFile } from 'node:fs/promises'; // Use Node.js fs/promises for file reading export interface ServerConfig { host: string; port: number; motd: string; // Message of the Day maxPlayers: number; } const defaultConfig: ServerConfig = { host: '0.0.0.0', port: 25565, motd: 'A Bun Minecraft Server', maxPlayers: 20, }; export async function loadConfig(): Promise<ServerConfig> { try { // Attempt to load from config.json const configFile = await readFile('config.json', 'utf-8'); const parsedConfig = JSON.parse(configFile) as Partial<ServerConfig>; // Merge with defaults, overriding with values from config.json return { ...defaultConfig, ...parsedConfig }; } catch (error) { console.warn("Failed to load config.json, using default configuration:", error); return defaultConfig; } } ``` **Explanation:** * This file handles loading the server configuration. * The `ServerConfig` interface defines the structure of the configuration object. * `defaultConfig` provides default values for the configuration. * `loadConfig` attempts to load the configuration from a `config.json` file. If the file doesn't exist or is invalid, it uses the default configuration. * It uses `node:fs/promises` to read the file asynchronously. This is important for performance. **7. `config.json` (Example Configuration File):** ```json { "port": 25566, "motd": "My Awesome Bun Server!" } ``` **8. `src/utils.ts` (Utility Functions):** ```typescript // Example utility function (add more as needed) export function hexEncode(data: Uint8Array): string { return Array.from(data) .map(byte => byte.toString(16).padStart(2, '0')) .join(''); } ``` **9. `.gitignore`:** ``` node_modules bun.lockb ``` **Key Concepts and Next Steps:** 1. **Minecraft Protocol (MCP):** This is the most important part. You *must* understand the MCP to build a functional server. Refer to the official Minecraft Protocol documentation (search for "Minecraft Protocol" or "wiki.vg/Protocol"). Pay close attention to: * **Packet IDs:** Each packet has a unique ID that identifies its type. * **Data Types:** The MCP uses specific data types (e.g., VarInt, VarLong, strings, integers, booleans). You'll need to read and write these data types correctly. * **Packet Structure:** Each packet has a specific structure, with fields in a defined order. * **State Machine:** The protocol operates in different states (Handshaking, Status, Login, Play). You need to handle packets differently depending on the current state. 2. **Binary Data Handling:** MCP packets are binary data. You'll need to use `Uint8Array` and `DataView` to read and write data to the buffers. 3. **VarInt and VarLong:** These are variable-length integers used in the MCP. You'll need to implement functions to read and write them. 4. **Asynchronous Operations:** Bun is designed for asynchronous operations. Use `async/await` and Promises to handle network I/O efficiently. 5. **Error Handling:** Implement robust error handling to catch and log errors. 6. **Logging:** Use a logging library to log important events and errors. 7. **Configuration:** Use a configuration file to store server settings (e.g., port, MOTD, max players). 8. **Player Management:** Keep track of connected players and their state. 9. **World Management:** Implement world loading, saving, and generation. 10. **Game Logic:** Implement the game logic (e.g., player movement, block placement, entity spawning). **Example: Reading a VarInt (Important for MCP):** ```typescript function readVarInt(buffer: Uint8Array, offset: number): { value: number, bytesRead: number } { let result = 0; let shift = 0; let bytesRead = 0; while (true) { const byte = buffer[offset + bytesRead]; bytesRead++; if (byte === undefined) { throw new Error("Incomplete VarInt"); } result |= (byte & 0x7F) << shift; shift += 7; if (!(byte & 0x80)) { return { value: result, bytesRead: bytesRead }; } if (shift > 35) { throw new Error("VarInt is too big"); } } } ``` **Example: Writing a VarInt:** ```typescript function writeVarInt(value: number): Uint8Array { const buffer: number[] = []; while (true) { const byte = value & 0x7F; value >>>= 7; if (value !== 0) { buffer.push(byte | 0x80); } else { buffer.push(byte); break; } } return new Uint8Array(buffer); } ``` **How to Run:** 1. **Install Bun:** Follow the instructions on the official Bun website ([https://bun.sh/](https://bun.sh/)). 2. **Create the Project:** Create the directory structure and files as described above. 3. **Install Dependencies:** Run `bun install` in the project directory. 4. **Start the Server:** Run `bun run start` or `bun run dev` in the project directory. **Important Considerations for Bun:** * **Node.js Compatibility:** Bun aims to be compatible with Node.js APIs, but there may be differences. Test your code thoroughly. * **WebSockets:** Bun has excellent WebSocket support. * **Performance:** Bun is designed for performance. Take advantage of its features to optimize your server. This template provides a solid foundation for building a Bun + MCP server. Remember to consult the Minecraft Protocol documentation and adapt the code to your specific needs. Good luck! **Chinese Translation of Key Terms:** * **Minecraft Protocol (MCP):** Minecraft 协议 (Minecraft Xiéyì) * **Packet:** 数据包 (Shùjùbāo) * **Server:** 服务器 (Fúwùqì) * **Client:** 客户端 (Kèhùduān) * **WebSocket:** WebSocket (pronounced the same in Chinese) * **Handshake:** 握手 (Wòshǒu) * **VarInt:** 变长整数 (Biàncháng Zhěngshù) * **Configuration:** 配置 (Pèizhì) * **Player:** 玩家 (Wánjiā) * **World:** 世界 (Shìjiè) * **MOTD (Message of the Day):** 每日消息 (Měirì Xiāoxī) or 服务器标语 (Fúwùqì Biāoyǔ) * **ArrayBuffer:** 数组缓冲区 (Shùzǔ Huǎnchōngqū) * **Uint8Array:** 8位无符号整数数组 (8 Wèi Wúfúhào Zhěngshù Shùzǔ) This should give you a good start. Let me know if you have any more questions!

Flutter Inspector MCP Server for AI-Powered Development

Flutter Inspector MCP Server for AI-Powered Development

一个模型上下文协议服务器,用于连接 Flutter 应用程序和 AI 编码助手,例如 Cursor、Claude 和 Cline,从而实现对 Widget 树、导航和布局问题的 AI 驱动分析。

MCP server in Python

MCP server in Python

Okay, here's a translation of "Creating a barebones MCP server around python (plus uv), encapsulated in a nix flake": **Simplified Chinese:** 使用 Nix Flake 创建一个基于 Python (加上 uv) 的极简 MCP 服务器。 **Traditional Chinese:** 使用 Nix Flake 創建一個基於 Python (加上 uv) 的極簡 MCP 伺服器。 **Explanation of Choices:** * **"Creating a barebones MCP server"**: This is translated as "创建一个极简 MCP 服务器" (chuàngjiàn yī gè jíjiǎn MCP fúwùqì). * "Creating" -> "创建" (chuàngjiàn) - to create, to build * "barebones" -> "极简" (jíjiǎn) - extremely simple, minimal, barebones * "MCP server" -> "MCP 服务器" (MCP fúwùqì) - MCP server (transliterated and then added "server") * **"around python (plus uv)"**: This is translated as "基于 Python (加上 uv) 的" (jīyú Python (jiāshàng uv) de). * "around" -> "基于" (jīyú) - based on, built around * "python" -> "Python" (Python) - Python (transliterated) * "(plus uv)" -> "(加上 uv)" ((jiāshàng uv)) - (plus uv) - "加上" means "plus" or "adding". "uv" is kept as is, assuming it's a technical term. * "的" (de) - a possessive particle, making the phrase an adjective describing the server. * **"encapsulated in a nix flake"**: This is translated as "使用 Nix Flake" (shǐyòng Nix Flake). * "encapsulated in" -> "使用" (shǐyòng) - using, employing. While "encapsulated" could be translated more literally, in this context, "using Nix Flake" conveys the intended meaning of the Nix Flake providing the encapsulation. * "a nix flake" -> "Nix Flake" (Nix Flake) - Nix Flake (transliterated). **Why this translation is appropriate:** * **Technical Accuracy:** It uses the correct Chinese terms for technical concepts like "server" and transliterates "Python," "MCP," and "Nix Flake" appropriately. * **Conciseness:** It's a relatively short and direct translation, which is often preferred in technical contexts. * **Readability:** The sentence structure is natural and easy to understand for a Chinese speaker familiar with programming concepts. This translation should be suitable for most contexts where you need to communicate this idea in Chinese.

aivengers-mcp MCP server

aivengers-mcp MCP server

使用 AIvengers 智能工具的 MCP 服务器,具有动态工具搜索/调用功能。

100-tool-mcp-server-json-example

100-tool-mcp-server-json-example

Please provide the JSON content you would like me to translate. I need the actual JSON text to be able to translate it into Chinese.

dify-mcp-client

dify-mcp-client

MCP 客户端作为一个代理策略插件。Dify 不是 MCP 服务器,而是 MCP 主机。

Kafka MCP Server

Kafka MCP Server

镜子 (jìng zi)

Adaptive MCP Server

Adaptive MCP Server

Anti-Bullshit MCP Server

Anti-Bullshit MCP Server

镜子 (jìng zi)

MCPXcode

MCPXcode

Xcode 的 MCP 服务器

simple_mcp_server_with_langgraph

simple_mcp_server_with_langgraph

使用 Langgraph 的简单 MCP 服务器。

Reaper MCP Server

Reaper MCP Server

镜子 (jìng zi)

GitHub MCP Server with Organization Support

GitHub MCP Server with Organization Support

支持组织的 GitHub MCP 服务器

mcp-server-notifier

mcp-server-notifier

轻量级 Node.js 服务器,用于发送 Webhook 通知。非常适合在多项目中使用 AI 代理(例如 Cursor)的开发者,可在任务完成时发出警报,以便高效切换。功能包括 Webhook 警报、多项目开发、AI 集成,以及为开发工具和自动化提供的简易设置。

metoro-mcp-server

metoro-mcp-server

镜子 (jìng zi)

Unsplash MCP Server

Unsplash MCP Server

一个 Swift 版本的 hellokaton/unsplash-mcp-server,并添加了诸如 get_photo 和 random_photo 等额外功能。

mcp-taskwarrior

mcp-taskwarrior

Taskwarrior 的一个简单的 MCP 服务器

mcp_rs_testWhat is MCP RS Test?How to use MCP RS Test?Key features of MCP RS Test?Use cases of MCP RS Test?FAQ from MCP RS Test?

mcp_rs_testWhat is MCP RS Test?How to use MCP RS Test?Key features of MCP RS Test?Use cases of MCP RS Test?FAQ from MCP RS Test?

用 Rust 实现 MCP 服务器

AOAI Dalle3 MCP Server

AOAI Dalle3 MCP Server