发现优秀的 MCP 服务器
通过 MCP 服务器扩展您的代理能力,拥有 86,267 个能力。
mcp-init
Okay, here's a basic outline and code snippets for creating a new MCP (Minecraft Protocol) server in TypeScript, with some "batteries included" features like basic logging, player management, and simple command handling. This is a starting point; a full MCP server is a complex project. **Conceptual Outline** 1. **Project Setup:** Initialize a TypeScript project with necessary dependencies. 2. **Networking:** Set up a TCP server to listen for incoming Minecraft client connections. 3. **Protocol Handling:** Implement the Minecraft protocol (handshaking, status, login, play). This is the most complex part. We'll use a library to help. 4. **Player Management:** Track connected players, their usernames, UUIDs, and game state. 5. **Command Handling:** Parse and execute simple commands entered by players. 6. **World Simulation (Optional):** A very basic world representation (e.g., a flat plane) to allow players to move around. 7. **Logging:** Implement a basic logging system for debugging and monitoring. **Code Snippets (TypeScript)** **1. Project Setup** ```bash mkdir mcp-server cd mcp-server npm init -y npm install typescript ts-node ws uuid node-nbt --save # Core dependencies npm install @types/node @types/ws @types/uuid --save-dev # Type definitions tsc --init # Initialize TypeScript config ``` **`tsconfig.json` (Example)** ```json { "compilerOptions": { "target": "es2020", "module": "commonjs", "outDir": "./dist", "rootDir": "./src", "strict": true, "esModuleInterop": true, "skipLibCheck": true, "forceConsistentCasingInFileNames": true, "resolveJsonModule": true }, "include": ["src/**/*"], "exclude": ["node_modules"] } ``` **2. `src/index.ts` (Main Server File)** ```typescript import { WebSocketServer, WebSocket } from 'ws'; import { v4 as uuidv4 } from 'uuid'; import * as nbt from 'node-nbt'; // Basic Logging const log = (message: string) => { console.log(`[${new Date().toISOString()}] ${message}`); }; // Player Interface interface Player { id: string; username: string; socket: WebSocket; x: number; y: number; z: number; } // Server Configuration const SERVER_PORT = 25565; const SERVER_MOTD = "My Awesome MCP Server"; const MAX_PLAYERS = 10; // Global Server State const players: { [id: string]: Player } = {}; // Function to handle incoming messages from clients const handleClientMessage = (ws: WebSocket, message: string) => { try { const data = JSON.parse(message); // Assuming JSON format for simplicity if (data.type === 'chat') { const playerId = Object.keys(players).find(key => players[key].socket === ws); if (playerId) { const player = players[playerId]; const chatMessage = `<${player.username}> ${data.message}`; log(chatMessage); broadcast(chatMessage); // Broadcast to all players } } else if (data.type === 'position') { const playerId = Object.keys(players).find(key => players[key].socket === ws); if (playerId) { const player = players[playerId]; player.x = data.x; player.y = data.y; player.z = data.z; // Broadcast position update (optional) // broadcastPosition(player); } } else { log(`Unknown message type: ${data.type}`); } } catch (error) { log(`Error parsing message: ${error}`); } }; // Function to broadcast a message to all connected clients const broadcast = (message: string) => { for (const playerId in players) { if (players.hasOwnProperty(playerId)) { const player = players[playerId]; player.socket.send(JSON.stringify({ type: 'chat', message: message })); } } }; // Function to handle new client connections const handleNewConnection = (ws: WebSocket) => { const playerId = uuidv4(); let username = `Player${Object.keys(players).length + 1}`; // Default username log(`New connection from ${ws._socket.remoteAddress}, assigning ID: ${playerId}`); // Add the player to the players object players[playerId] = { id: playerId, username: username, socket: ws, x: 0, y: 0, z: 0, }; // Send a welcome message to the new player ws.send(JSON.stringify({ type: 'welcome', message: `Welcome to the server, ${username}!` })); // Notify other players about the new player (optional) broadcast(`${username} has joined the server.`); // Set up event listeners for the new connection ws.on('message', (message) => { handleClientMessage(ws, message.toString()); }); ws.on('close', () => { log(`Connection closed for player ${playerId}`); delete players[playerId]; broadcast(`${username} has left the server.`); }); ws.on('error', (error) => { log(`Error on connection ${playerId}: ${error}`); delete players[playerId]; }); }; // Create a WebSocket server const wss = new WebSocketServer({ port: SERVER_PORT }); wss.on('connection', handleNewConnection); wss.on('listening', () => { log(`Server listening on port ${SERVER_PORT}`); }); wss.on('error', (error) => { log(`Server error: ${error}`); }); // Start the server log(`Starting MCP server...`); ``` **3. Building and Running** ```bash npm run build # Transpile TypeScript to JavaScript (check your package.json for the build script) node dist/index.js # Run the server ``` **Explanation and "Batteries Included" Features:** * **`ws` Library:** Uses the `ws` library for WebSocket communication, which is a common choice for real-time applications. This handles the low-level socket management. * **`uuid` Library:** Generates unique player IDs using the `uuid` library. * **`node-nbt` Library:** This is included for handling NBT (Named Binary Tag) data, which is used for storing world data, player data, and other Minecraft-related information. You'll need this for more advanced features. * **Logging:** A simple `log` function provides basic timestamped logging to the console. * **Player Management:** The `players` object stores information about connected players (ID, username, socket, position). * **Chat:** Basic chat functionality is implemented. Players can send messages, and the server broadcasts them to all other players. * **Position Updates:** The server can receive position updates from clients, although the example doesn't do anything with them beyond storing them. * **Error Handling:** Basic error handling is included for connection errors and message parsing errors. **Important Considerations and Next Steps:** * **Minecraft Protocol:** This example *does not* implement the full Minecraft protocol. You'll need to handle the handshake, status, login, and play states correctly. Libraries like `prismarine-protocol` (Node.js) can help with this, but they are complex. The example uses a simplified JSON-based communication for demonstration. * **Security:** This is a very basic example and has no security measures. You'll need to implement proper authentication, authorization, and input validation to prevent malicious clients from exploiting the server. * **World Generation:** The example doesn't have any world generation. You'll need to implement a world generator to create a playable environment. Consider using libraries for procedural generation. * **Game Logic:** You'll need to implement the game logic for your server, such as handling player movement, interactions with the world, and other game events. * **Performance:** For a large number of players, you'll need to optimize the server's performance. Consider using techniques like multithreading or clustering. * **Data Storage:** You'll need to store world data, player data, and other server data in a persistent storage system, such as a database or file system. * **Command System:** Expand the command handling to support more complex commands and permissions. **Example Client (Simple WebSocket Client)** You'll need a client to connect to your server. Here's a very basic HTML/JavaScript example: ```html <!DOCTYPE html> <html> <head> <title>MCP Client</title> </head> <body> <h1>MCP Client</h1> <input type="text" id="messageInput" placeholder="Enter message"> <button onclick="sendMessage()">Send</button> <div id="chatLog"></div> <script> const ws = new WebSocket('ws://localhost:25565'); // Replace with your server address ws.onopen = () => { console.log('Connected to server'); }; ws.onmessage = (event) => { const data = JSON.parse(event.data); const chatLog = document.getElementById('chatLog'); if (data.type === 'chat') { chatLog.innerHTML += `<p>${data.message}</p>`; } else if (data.type === 'welcome') { chatLog.innerHTML += `<p>${data.message}</p>`; } else { console.log('Received:', data); } }; ws.onclose = () => { console.log('Disconnected from server'); }; ws.onerror = (error) => { console.error('WebSocket error:', error); }; function sendMessage() { const messageInput = document.getElementById('messageInput'); const message = messageInput.value; ws.send(JSON.stringify({ type: 'chat', message: message })); messageInput.value = ''; } </script> </body> </html> ``` Save this as `index.html` and open it in your browser. You should be able to connect to the server and send chat messages. **In summary, this is a very basic starting point. Building a full MCP server is a significant undertaking that requires a deep understanding of the Minecraft protocol and server-side development concepts.** Use this as a foundation and build upon it, researching the Minecraft protocol and using appropriate libraries to handle the complexities. Good luck!
SEFAZ PB: IPVA
MCP server for querying IPVA (vehicle tax) information from the official SEFAZ PB (Paraíba state) source, read-only, with prepaid per-query pricing.
Amazon Seller MCP Server - DataDoe
Hosted Amazon Seller Central & Vendor Central MCP server. Connect Claude, ChatGPT, Cursor, Codex, Gemini, and GitHub Copilot to live Amazon SP-API and Amazon Ads API data.
myscheme
Enables searching live myScheme.gov.in schemes by eligibility, keyword, and detail lookup through MCP tools.
AIStor MCP server
镜子 (jìng zi)
mcp-typebot
Enables natural language management of Typebot bots: create, update, publish, list results, and start chat sessions via Claude Desktop.
GitHub MCP Server
GitHub MCP 服务器 (GitHub MCP fúwùqì)
Gospel Library MCP
Enables access to LDS Gospel Library content and scriptures through the Model Context Protocol. Provides tools for searching and retrieving religious texts and study materials from the Church of Jesus Christ of Latter-day Saints.
cpp-debug-mcp
Provides GDB and clangd-based tools for debugging C++ programs, enabling step execution, variable inspection, diagnostics, and combined runtime-static analysis.
MCP Dev Server UI
Dorar.net Hadith MCP
An MCP server that enables searching and researching Hadith through Dorar.net inside Claude Desktop, providing authentic search results, grading, and commentary.
pi-delegate
Enables Claude Code to delegate coding implementation and testing to a local pi agent via MCP tools, including dispatching task books, monitoring status, steering or aborting runs mid-execution, and retrieving results and transcripts.
whoop-chatgpt-app
MCP server that connects WHOOP health tracker data to ChatGPT, enabling read-only search, fetch, summary, and a React dashboard widget for recovery, sleep, strain, and workouts.
PostgreSQL Query MCP Server
一个安全的模型上下文协议(Model Context Protocol)服务器,允许 Claude 对 PostgreSQL 数据库执行只读 SQL 查询,从而实现与数据库数据的自然语言交互。
MCP MeloTTS Audio Generator
Enables AI assistants to convert text to high-quality speech audio using MeloTTS. Automatically splits long texts into segments, generates WAV files, and merges them using ffmpeg with support for multiple languages and customizable speech parameters.
Premiere Pro MCP Server
Enables Claude to drive Adobe Premiere Pro directly through natural-language requests, supporting import, timeline editing, markers, effects, transitions, and export.
Blink MCP Server
Enables AI assistants to interact with the Blink Bitcoin and Lightning Network API for managing wallets, payments, invoices, and L402 services.
MindMesh MCP Server
具有场相干性的 Claude 3.7 Swarm:一个模型上下文协议 (MCP) 服务器,它协调多个专门的 Claude 3.7 Sonnet 实例,形成一个受量子启发的集群。它在模式识别、信息论和推理专家之间创建一种场相干效应,从而从集成智能中产生最佳相干响应。
HoShy
A free MCP server that lets Claude search Rakuten products, compare prices, and book business hotels using natural language, with no API keys required.
shadowprice
Inject real-time leaked B2B SaaS pricing, historical discounts, and aggressive negotiation playbooks directly into AI agents.
colabfit-mcp
An MCP server for discovering ColabFit materials science datasets and training MACE interatomic potentials on local hardware, enabling AI assistants to search, download, train, and validate models.
Fuzzy-Semantic-Audit-MCP
A high-precision logical vulnerability auditing tool that uses MCP and CodeGraph for automated 0-day discovery and verification in multi-language codebases.
GNews API MCP Server
Provides access to the GNews API for searching news articles and getting top headlines, with support for advanced query syntax, filtering, and pagination.
EvidenceGene Court
Adversarial autonomous DFIR. A court of AI agents — Prosecutor, Defender, Arbiter — investigates disk and memory evidence through a typed, read-only MCP server.
Verodat MCP Layer Architecture Diagram
Verodat MCP 服务器实现 (Verodat MCP fúwùqì shíxiàn)
agentic-firmenbuch
Enables AI agents to query Austria's entire company register (Firmenbuch) in plain language, providing official master data, annual accounts, and key ratios from a multi-tenant MCP server.
Monad MCP Server
Listens to Monad testnet for new blocks and provides a REST API to query the latest block number and transaction count.
Embedded xLink MCP
MCP server for embedded debugging based on probe-rs, providing 22 tools for ARM Cortex-M and RISC-V microcontrollers, including connection, memory operations, breakpoints, flash programming, and RTT communication.
io.github.atomno-mcp/mcp-pharma
Russian drug reference for AI agents: check ГРЛС registration, get a drug card, look up ЖНВЛП price caps, check recalls, and link the official instruction straight from the state registers.
zerodust
Sweep an AI agent's native gas balance to exactly zero on 25+ EVM chains via EIP-7702 sponsored execution, a relayer pays the gas and is reimbursed from the sweep, so nothing is left stranded.