发现优秀的 MCP 服务器

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

全部86,267
ArXiv MCP Server

ArXiv MCP Server

Provides arXiv paper search, download, Chinese translation, and WeChat article generation, supporting custom LLM APIs.

Browseagent MCP

Browseagent MCP

Enables AI agents to control web browsers through the Model Context Protocol, supporting navigation, clicking, typing, and screenshots.

minecraft-mcp-server

minecraft-mcp-server

An MCP server that connects an AI assistant to a Minecraft server via a Mineflayer bot, supporting creative and survival modes with distinct toolsets.

oanda-mcp

oanda-mcp

MCP server for the Oanda v20 REST API enabling forex/CFD trading account management, market data retrieval, and order/trade operations with a read-first design and practice environment by default.

hermes-pen-bridge

hermes-pen-bridge

A hybrid MCP server that proxies Pencil's native design tools and adds utilities for .pen file management, enabling design token extraction, layer trees, diffs, and batch export.

MCP Middleware Adapter for Express Servers

MCP Middleware Adapter for Express Servers

Okay, here's a breakdown of how to run multiple Minecraft Protocol (MCP) clients on a NodeJS Express server, acting as an adapter or middleware. This is a complex topic, so I'll break it down into key concepts and provide code snippets to illustrate the ideas. **Core Concepts** 1. **Minecraft Protocol (MCP) Clients:** These are libraries (like `minecraft-protocol` or `prismarine-proxy`) that handle the low-level communication with Minecraft servers. You'll need to choose one and understand its API. 2. **NodeJS Express Server:** This provides the HTTP endpoint(s) that your users/applications will interact with. It acts as the intermediary between the outside world and your Minecraft clients. 3. **Client Management:** You need a way to keep track of each MCP client instance. A simple object or array can work, but for more complex scenarios, consider a more robust data structure. 4. **Proxying/Adapting:** The Express server will receive requests, determine which MCP client should handle the request, and then forward the request (or a modified version of it) to the appropriate Minecraft server. The response from the Minecraft server is then sent back to the original requester. 5. **Authentication/Authorization:** Crucially important. You need to ensure that only authorized users can control specific Minecraft clients. This might involve API keys, user accounts, or other authentication mechanisms. 6. **Error Handling:** Robust error handling is essential. Minecraft servers can be unreliable, and network issues can occur. Your Express server needs to gracefully handle these errors and provide informative feedback to the user. **Example Structure (Conceptual)** ``` / ├── server.js // Main Express server file ├── mcp_manager.js // Manages MCP client instances ├── routes/ │ └── minecraft.js // Routes for interacting with Minecraft clients └── config.js // Configuration settings ``` **1. Project Setup** ```bash mkdir minecraft-proxy cd minecraft-proxy npm init -y npm install express minecraft-protocol // Or prismarine-proxy, etc. ``` **2. `config.js` (Configuration)** ```javascript module.exports = { minecraftServers: [ { id: 'server1', host: 'minecraft.example.com', port: 25565 }, { id: 'server2', host: 'another.minecraft.net', port: 25565 } ], apiKeys: { 'user1': 'some-secret-key', 'user2': 'another-secret-key' } }; ``` **3. `mcp_manager.js` (MCP Client Management)** ```javascript const mc = require('minecraft-protocol'); const config = require('./config'); class MCPManager { constructor() { this.clients = {}; // Store MCP client instances } createClient(serverId, username, password) { const serverConfig = config.minecraftServers.find(s => s.id === serverId); if (!serverConfig) { throw new Error(`Server with ID ${serverId} not found.`); } const client = mc.createClient({ host: serverConfig.host, port: serverConfig.port, username: username, password: password // Handle authentication appropriately }); this.clients[serverId] = client; client.on('connect', () => { console.log(`Connected to ${serverId}`); }); client.on('disconnect', (packet) => { console.log(`Disconnected from ${serverId}: ${packet.reason}`); delete this.clients[serverId]; // Remove client on disconnect }); client.on('error', (err) => { console.error(`Error on ${serverId}: ${err}`); delete this.clients[serverId]; // Remove client on error }); return client; } getClient(serverId) { return this.clients[serverId]; } removeClient(serverId) { if (this.clients[serverId]) { this.clients[serverId].end(); // Disconnect the client delete this.clients[serverId]; } } } module.exports = new MCPManager(); ``` **4. `routes/minecraft.js` (Express Routes)** ```javascript const express = require('express'); const router = express.Router(); const mcpManager = require('../mcp_manager'); const config = require('../config'); // Middleware to authenticate API key const authenticate = (req, res, next) => { const apiKey = req.headers['x-api-key']; const userId = req.query.userId; // Or get from body, params, etc. if (!apiKey || !userId || config.apiKeys[userId] !== apiKey) { return res.status(401).json({ error: 'Unauthorized' }); } req.userId = userId; // Store user ID for later use next(); }; // Route to create a Minecraft client router.post('/client/:serverId', authenticate, (req, res) => { const serverId = req.params.serverId; const username = req.body.username; const password = req.body.password; try { const client = mcpManager.createClient(serverId, username, password); res.status(201).json({ message: `Client created for ${serverId}` }); } catch (error) { console.error(error); res.status(500).json({ error: error.message }); } }); // Route to send a chat message router.post('/client/:serverId/chat', authenticate, (req, res) => { const serverId = req.params.serverId; const message = req.body.message; const client = mcpManager.getClient(serverId); if (!client) { return res.status(404).json({ error: `Client for ${serverId} not found` }); } client.write('chat', { message: message }); res.json({ message: 'Chat message sent' }); }); // Route to disconnect a client router.delete('/client/:serverId', authenticate, (req, res) => { const serverId = req.params.serverId; mcpManager.removeClient(serverId); res.json({ message: `Client for ${serverId} disconnected` }); }); module.exports = router; ``` **5. `server.js` (Main Express Server)** ```javascript const express = require('express'); const app = express(); const minecraftRoutes = require('./routes/minecraft'); const port = 3000; app.use(express.json()); // Parse JSON request bodies app.use('/minecraft', minecraftRoutes); app.listen(port, () => { console.log(`Server listening on port ${port}`); }); ``` **Explanation and Key Points** * **`config.js`:** Stores configuration data like Minecraft server details and API keys. **Never hardcode sensitive information directly into your code.** * **`mcp_manager.js`:** * Manages the creation, retrieval, and removal of MCP client instances. * Uses a `clients` object to store the clients, keyed by `serverId`. * Handles connection, disconnection, and error events for each client. This is crucial for maintaining a stable system. * **`routes/minecraft.js`:** * Defines the Express routes for interacting with the Minecraft clients. * **`authenticate` middleware:** This is a *critical* security measure. It checks for a valid API key before allowing access to the routes. Adapt this to your authentication needs. * `/client/:serverId`: Creates a new MCP client for the specified server. * `/client/:serverId/chat`: Sends a chat message to the specified server. * `/client/:serverId`: Disconnects the client for the specified server. * **`server.js`:** * Sets up the Express server and mounts the `minecraftRoutes`. * Includes `express.json()` middleware to parse JSON request bodies. **How to Run** 1. Save all the files. 2. Open a terminal in the project directory. 3. Run `node server.js`. **Example API Usage (using `curl`)** * **Create a client:** ```bash curl -X POST -H "Content-Type: application/json" -H "X-API-Key: some-secret-key" -d '{"username": "MyBot", "password": "MyPassword"}' "http://localhost:3000/minecraft/client/server1?userId=user1" ``` * **Send a chat message:** ```bash curl -X POST -H "Content-Type: application/json" -H "X-API-Key: some-secret-key" -d '{"message": "Hello, world!"}' "http://localhost:3000/minecraft/client/server1/chat?userId=user1" ``` * **Disconnect a client:** ```bash curl -X DELETE -H "X-API-Key: some-secret-key" "http://localhost:3000/minecraft/client/server1?userId=user1" ``` **Important Considerations and Enhancements** * **Error Handling:** The example includes basic error handling, but you should add more robust error handling throughout the code. Use `try...catch` blocks, log errors, and provide informative error messages to the user. * **Authentication:** The API key authentication is a simple example. For production environments, use a more secure authentication method like JWT (JSON Web Tokens) or OAuth 2.0. * **Rate Limiting:** Implement rate limiting to prevent abuse of your API. This can be done using middleware like `express-rate-limit`. * **Logging:** Use a logging library (like `winston` or `morgan`) to log requests, errors, and other important events. This will help you debug and monitor your application. * **Scalability:** For high-traffic applications, consider using a message queue (like RabbitMQ or Kafka) to handle requests asynchronously. This will prevent your Express server from becoming overloaded. You could also use a load balancer to distribute traffic across multiple instances of your Express server. * **Minecraft Protocol Library:** The example uses `minecraft-protocol`. You can also use `prismarine-proxy` or other libraries. Choose the library that best suits your needs. `prismarine-proxy` is often used for more advanced proxying scenarios. * **Data Validation:** Validate the data that you receive from the user (e.g., username, password, message). This will help prevent errors and security vulnerabilities. Use a library like `joi` or `express-validator`. * **Minecraft Server Version Compatibility:** Minecraft protocols change with each version. Make sure your chosen library supports the Minecraft server versions you want to connect to. You might need to handle different protocol versions. * **Proxying vs. Adapting:** * **Proxying:** Simply forwards the raw Minecraft protocol packets between the client and the server. This is more efficient but requires more knowledge of the Minecraft protocol. `prismarine-proxy` is well-suited for this. * **Adapting:** Translates the requests into a different format (e.g., HTTP) and then converts them back into Minecraft protocol packets. This is easier to implement but can be less efficient. The example above is more of an adapter. * **Command Handling:** Instead of just sending chat messages, you can implement a more sophisticated command handling system. This would allow users to execute commands on the Minecraft server through your API. * **WebSockets:** Consider using WebSockets for real-time communication between the client and the Minecraft server. This would allow you to send updates to the client as they happen (e.g., player positions, chat messages). **Example using `prismarine-proxy` (Conceptual)** ```javascript const prismarineProxy = require('prismarine-proxy'); const express = require('express'); const app = express(); app.get('/proxy/:host/:port', (req, res) => { const host = req.params.host; const port = parseInt(req.params.port); prismarineProxy.createProxy({ host: host, port: port, // Options for the proxy (e.g., custom login handling) }); res.send(`Proxy created for ${host}:${port}`); }); app.listen(3000, () => { console.log('Proxy server listening on port 3000'); }); ``` This `prismarine-proxy` example is *very* basic. You'd need to add authentication, client management, and more sophisticated handling of the proxy events. `prismarine-proxy` gives you more control over the raw Minecraft protocol packets. **In summary, building a robust Minecraft proxy/adapter requires careful planning, security considerations, and a good understanding of the Minecraft protocol. Start with a simple example and gradually add features as needed.**

OmniMCP

OmniMCP

Turns any website into a rich set of MCP tools for scraping, crawling, structured data extraction, and automatic API mounting via OpenAPI specs.

Publee MCP Server

Publee MCP Server

Enables AI tools to publish HTML pages and get shareable URLs instantly, with optional account features for persistence, in-place updates, and visibility control.

mcpCreatioServer

mcpCreatioServer

A Node.js MCP server that enables LLM tools to list and read local guide and prompt files for Creatio development, facilitating seamless communication between AI assistants and Creatio-specific documentation.

markapatent-mcp

markapatent-mcp

Enables searching Turkish patent, trademark, and industrial design data via the TÜRKPATENT database using the MCP protocol.

MCP Server

MCP Server

This MCP server provides access to resources and prompts from GitHub repositories or the local filesystem, enabling teams to share coding standards, documentation, and reusable prompts with AI tools like Claude.

mcp-server-notify

mcp-server-notify

一个轻量级的桌面通知工具,支持 MCP 协议集成和命令行直接调用,让 Agent 能够智能发送系统通知。

mcp-server-saxo

mcp-server-saxo

Enables interaction with Saxo Bank OpenAPI for trading, portfolio management, market data, and account operations through natural language.

youtube-mcp

youtube-mcp

A local MCP server for extracting YouTube video transcripts, metadata, and performing visual analysis using Gemini Vision or local Whisper models. It enables users to process video content through various tools for subtitle retrieval and frame analysis.

Nota Fiscal

Nota Fiscal

Emita e gerencie notas fiscais de serviço (NFS-e) conversando com o agente, hospedado pela plataforma, sem precisar de conta na nfe.io.

Rembg MCP Server

Rembg MCP Server

Enables AI-powered background removal from images using multiple specialized models including u2net, birefnet, and isnet. Supports both single image processing and batch folder operations with advanced options like alpha matting and mask-only output.

statelessagent

statelessagent

I gave Claude a mass grave of 200 markdown files and now it remembers my entire project between sessions. No cloud, no API keys, one 10mb Go binary, and private. Stateless Agent Memory Engine is your synapse to the CLI.

PromptShield MCP

PromptShield MCP

A Model Context Protocol server that lets AI agents and runtime firewalls call PromptShield-style safety checks for text, chat messages, prompts, tool inputs, and generated outputs.

Azure Dev Server

Azure Dev Server

A remote MCP server that provides full filesystem and shell access to a cloud-hosted environment via HTTPS, enabling Claude Desktop to read, write, edit, search files, and execute commands on a remote Azure machine.

mindreader-mcp

mindreader-mcp

Connects MindReader knowledge graph to MCP clients, enabling AI assistants with persistent memory and entity/relationship management.

claude-tmux-bridge

claude-tmux-bridge

An MCP server that connects Claude Desktop to an interactive Claude Code session running in a tmux terminal.

Access MCP Server by CData

Access MCP Server by CData

Access MCP Server by CData

Emoji AI MCP

Emoji AI MCP

Emoji AI - MCP server providing AI-powered tools and automation by MEOK AI Labs

WeKnora MCP Dispatch

WeKnora MCP Dispatch

Multi-user MCP gateway for WeKnora v0.7.1 that accepts per-request WeKnora API keys, enabling client-scoped access to spaces and knowledge bases through a single Streamable HTTP MCP endpoint.

Databricks MCP Server

Databricks MCP Server

Enables interaction with Databricks for running SQL queries, managing clusters, triggering jobs, running notebooks, exploring Unity Catalog metadata, managing secrets, and interacting with DBFS.

obsmcp

obsmcp

A local-first MCP server and continuity control plane that helps AI coding tools maintain project state, tasks, and context across sessions, models, and interruptions, with features like session tracking, token-efficient context assembly, and code understanding via Code Atlas.

@yawlabs/aws-mcp

@yawlabs/aws-mcp

A small AWS MCP for AI assistants: one server, one config entry, SSO re-auth baked in, generic CRUD over hundreds of resource types, live docs lookup, server-side scripting for batched workflows.

Dropbox MCP Server by CData

Dropbox MCP Server by CData

This read-only MCP Server allows you to connect to Dropbox data from Claude Desktop through CData JDBC Drivers. Free (beta) read/write servers available at https://www.cdata.com/solutions/mcp

endplay-dd-mcp-server

endplay-dd-mcp-server

Exposes endplay double-dummy calculations for chatbots/agents, providing full trick tables for bridge deals.

402-mcp

402-mcp

L402 + x402 client MCP. AI agents discover, pay for, and consume any payment-gated API autonomously. Supports Lightning (NWC), Cashu ecash, stablecoins, and human-in-the-loop payments.