发现优秀的 MCP 服务器
通过 MCP 服务器扩展您的代理能力,拥有 23,420 个能力。
Model Context Protocol Community
轻松运行、部署和连接到 MCP 服务器
MCP Terminal Tool Server
An MCP server that enables users to execute arbitrary shell commands on their local machine and receive the output. It provides a terminal tool for running system commands through MCP-compatible clients using the Python SDK.
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.**
SpiderFoot MCP Server
Enables interaction with SpiderFoot's OSINT scanning capabilities through Claude and other MCP-compatible tools. Supports comprehensive scan management, real-time monitoring, result retrieval, and export functionality for reconnaissance and investigation workflows.
MCP Deep Web Research Server
一个模型上下文协议服务器,使 Claude 能够执行高级网络研究,具备智能搜索队列、增强的内容提取和深度研究能力。
XHS-MCP
Enables content creators to manage, analyze, and publish Xiaohongshu (Little Red Book) content through browser automation, with built-in templates, data analytics, and scheduling capabilities accessible via CLI or AI assistants.
MCP Boilerplate
A minimal, production-ready MCP server with a simple addition calculator tool that demonstrates integration with the Model Context Protocol.
MCP HTTP Fetcher Server
Fetches web pages from HTTP/HTTPS URLs and converts them to Markdown format. Supports both SSE and Stdio protocols for web deployments, Kubernetes environments, and desktop clients.
MCP Workitem Server
A server that provides access to Alibaba Cloud workitem descriptions through MCP protocol, allowing agents to retrieve structured workitem data including text, images, and HTML content by ID.
Tiddly MCP
Connects AI agents to TiddlyWiki through the Model Context Protocol, enabling listing, searching, filtering, creating, updating, and deleting tiddlers. Defaults to read-only mode with optional write permissions.
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
Metabase MCP Server
Connects Metabase business intelligence platform to AI assistants, enabling users to query data, create dashboards and charts, manage databases, and interact with BI assets using natural language through the Model Context Protocol.
VeyraX MCP
Provides unified access to all tools integrated with the VeyraX platform through a single authentication. Eliminates the need for multiple logins by connecting once to access all your tools across any MCP-compatible environment.
LinkedIn Profile Analyzer MCP
Enables users to fetch, analyze, and manage LinkedIn posts data through tools that retrieve profiles, search posts by keywords, filter by date, and identify top-performing content based on engagement metrics.
Freepik FastMCP Toolkit
A Model Context Protocol (MCP) server that connects AI assistants directly with Freepik's APIs, allowing users to search, generate, and manage visual content without leaving their AI workflow.
IDA-MCP
Enables interaction with multiple IDA Pro instances through MCP, allowing users to list functions, search instances, and manage reverse engineering analysis across different binary files. Supports multi-instance coordination with automatic discovery and tool forwarding between IDA Pro sessions.
MCP Chess
一个用于下国际象棋的 MCP 服务器 (Yī gè yòng yú xià guójì xiàngqí de MCP fúwùqì) **Breakdown:** * **一个 (yī gè):** A * **用于 (yòng yú):** for * **下国际象棋 (xià guójì xiàngqí):** playing chess (literally "play international chess") * **的 (de):** a possessive particle, linking the preceding phrase to the following noun. * **MCP 服务器 (MCP fúwùqì):** MCP server
HexDocs MCP Server
Pure Storage Model Context Protocol Server
一个简单的 MCP 服务器,用于与 Pure Storage 阵列交互。 (Yī gè jiǎndān de MCP fúwùqì, yòng yú yǔ Pure Storage zhènliè jiāohù.)
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.
CtrlTest MCP Server
Enables control system analysis and testing through PID controller evaluation against second-order plants. Provides regression testing utilities with step response analysis, gust rejection metrics, and settling time calculations for control engineering applications.
Twitter Spaces MCP Server
Enables downloading and AI-powered transcription of Twitter Spaces audio recordings with multiple output formats including speaker diarization, time-coded text, and summaries.
むらっけ MPC Server
一个简易地再现了宝可梦特性“飘飘然”的 MPC Server
Dumpling AI MCP Server
Integrates with Dumpling AI to provide data scraping, content processing, knowledge management, and code execution capabilities through tools for web interactions, document handling, and AI services.
PipeCD Docs MCP Server
Enables searching and retrieving official PipeCD documentation through full-text search and document retrieval. Clones PipeCD docs from GitHub and indexes Markdown files for quick access to titles and content.
Manim MCP Server
Enables compilation and serving of Manim animations through natural language. Supports compiling Manim Python code into videos and downloading the generated animations with secure authentication.
Smart MCP
A global framework for creating reusable command shortcuts and slash commands that work across any directory. It enables systematic code refactoring, debugging, and auditing through a hierarchical configuration system with global defaults and project-specific overrides.
Next.js MCP Server
A sample MCP server implementation for Next.js projects that uses the Vercel MCP Adapter to handle protocol requests across different transport methods.
KVM MCP Server
A JSON-RPC server that simplifies managing KVM virtual machines by providing a centralized interface for VM lifecycle, networking, storage, and display management tasks.
Ideogram MCP Server
一个模型上下文协议(Model Context Protocol, MCP)服务器,它使用 Ideogram API 提供图像生成功能,允许用户通过文本提示和可自定义的参数来创建图像。