发现优秀的 MCP 服务器

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

全部22,697
Python MCP Server Template

Python MCP Server Template

A standardized foundation for building Model Context Protocol servers that integrate with VS Code, using Python with stdio transport for seamless AI tool integration.

YouTube Media Downloader

YouTube Media Downloader

Enables comprehensive YouTube data access including video details, playlists, channels, comments, search, and subtitle operations through the YouTube Media Downloader API.

Solid Multi-Tenant DevOps MCP Server

Solid Multi-Tenant DevOps MCP Server

Enables AI-first DevOps management of multi-tenant Solid SaaS platforms through natural language conversation. Monitor thousands of tenant instances, track AI agent performance, handle errors, manage billing, and provision new tenants directly through Claude Desktop.

Li Data Scraper MCP Server

Li Data Scraper MCP Server

Enables access to LinkedIn data through the Li Data Scraper API, supporting profile enrichment, company details, people search, post interactions, and activity tracking.

Linkup Model Context Protocol

Linkup Model Context Protocol

好的,这是 Linkup MCP 服务器的 JavaScript 版本: ```javascript const WebSocket = require('ws'); // Configuration const PORT = 8080; const HEARTBEAT_INTERVAL = 30000; // 30 seconds // Data Structures const clients = new Map(); // Map of client IDs to WebSocket objects const rooms = new Map(); // Map of room IDs to sets of client IDs // Helper Functions /** * Generates a unique ID. Simple for this example, but consider a more robust solution for production. * @returns {string} A unique ID. */ function generateId() { return Math.random().toString(36).substring(2, 15) + Math.random().toString(36).substring(2, 15); } /** * Sends a message to a specific client. * @param {string} clientId The ID of the client to send the message to. * @param {object} message The message to send (will be JSON stringified). */ function sendMessage(clientId, message) { const client = clients.get(clientId); if (client && client.readyState === WebSocket.OPEN) { try { client.send(JSON.stringify(message)); } catch (error) { console.error(`Error sending message to client ${clientId}:`, error); } } else { console.warn(`Client ${clientId} not found or not connected.`); } } /** * Sends a message to all clients in a room. * @param {string} roomId The ID of the room. * @param {object} message The message to send (will be JSON stringified). * @param {string} [excludeClientId] Optional client ID to exclude from receiving the message. */ function broadcastToRoom(roomId, message, excludeClientId) { const room = rooms.get(roomId); if (room) { room.forEach(clientId => { if (clientId !== excludeClientId) { sendMessage(clientId, message); } }); } } /** * Handles client disconnection. * @param {string} clientId The ID of the disconnected client. */ function handleDisconnect(clientId) { console.log(`Client ${clientId} disconnected.`); // Remove client from clients map clients.delete(clientId); // Remove client from all rooms rooms.forEach((room, roomId) => { if (room.has(clientId)) { room.delete(clientId); if (room.size === 0) { rooms.delete(roomId); // Remove empty room console.log(`Room ${roomId} is now empty and has been removed.`); } else { // Notify other clients in the room about the departure broadcastToRoom(roomId, { type: 'clientLeft', clientId: clientId }, clientId); } } }); } // WebSocket Server Setup const wss = new WebSocket.Server({ port: PORT }); wss.on('connection', ws => { const clientId = generateId(); clients.set(clientId, ws); console.log(`Client ${clientId} connected.`); // Send the client their ID sendMessage(clientId, { type: 'clientId', clientId: clientId }); // Handle incoming messages ws.on('message', message => { try { const parsedMessage = JSON.parse(message); const type = parsedMessage.type; switch (type) { case 'createRoom': const roomId = generateId(); rooms.set(roomId, new Set([clientId])); sendMessage(clientId, { type: 'roomCreated', roomId: roomId }); console.log(`Client ${clientId} created room ${roomId}.`); break; case 'joinRoom': const roomIdToJoin = parsedMessage.roomId; if (rooms.has(roomIdToJoin)) { rooms.get(roomIdToJoin).add(clientId); sendMessage(clientId, { type: 'roomJoined', roomId: roomIdToJoin }); broadcastToRoom(roomIdToJoin, { type: 'clientJoined', clientId: clientId }, clientId); console.log(`Client ${clientId} joined room ${roomIdToJoin}.`); } else { sendMessage(clientId, { type: 'error', message: `Room ${roomIdToJoin} not found.` }); } break; case 'leaveRoom': const roomIdToLeave = parsedMessage.roomId; const roomToLeave = rooms.get(roomIdToLeave); if (roomToLeave && roomToLeave.has(clientId)) { roomToLeave.delete(clientId); sendMessage(clientId, { type: 'roomLeft', roomId: roomIdToLeave }); broadcastToRoom(roomIdToLeave, { type: 'clientLeft', clientId: clientId }, clientId); console.log(`Client ${clientId} left room ${roomIdToLeave}.`); if (roomToLeave.size === 0) { rooms.delete(roomIdToLeave); console.log(`Room ${roomIdToLeave} is now empty and has been removed.`); } } else { sendMessage(clientId, { type: 'error', message: `Client is not in room ${roomIdToLeave}.` }); } break; case 'message': const roomIdForMessage = parsedMessage.roomId; const messageContent = parsedMessage.content; broadcastToRoom(roomIdForMessage, { type: 'message', clientId: clientId, content: messageContent }, clientId); console.log(`Client ${clientId} sent message to room ${roomIdForMessage}: ${messageContent}`); break; case 'ping': // Respond to ping to keep the connection alive sendMessage(clientId, { type: 'pong' }); break; default: console.warn(`Unknown message type: ${type}`); sendMessage(clientId, { type: 'error', message: `Unknown message type: ${type}` }); } } catch (error) { console.error('Error parsing message:', error); sendMessage(clientId, { type: 'error', message: 'Invalid message format.' }); } }); // Handle client disconnection ws.on('close', () => { handleDisconnect(clientId); }); ws.on('error', error => { console.error(`WebSocket error for client ${clientId}:`, error); handleDisconnect(clientId); }); // Send a ping every HEARTBEAT_INTERVAL to keep the connection alive ws.isAlive = true; ws.on('pong', () => { ws.isAlive = true; }); }); // Heartbeat to check for dead connections setInterval(() => { wss.clients.forEach(ws => { if (ws.isAlive === false) { console.log("Terminating connection due to inactivity."); return ws.terminate(); } ws.isAlive = false; ws.ping(() => {}); }); }, HEARTBEAT_INTERVAL); console.log(`WebSocket server started on port ${PORT}`); ``` **Explanation and Key Improvements:** * **Dependencies:** Uses the `ws` package for WebSocket functionality. You'll need to install it: `npm install ws` * **Configuration:** `PORT` and `HEARTBEAT_INTERVAL` are configurable at the top. * **Data Structures:** * `clients`: A `Map` that stores client IDs as keys and their corresponding WebSocket objects as values. This allows you to easily look up a client's WebSocket connection by its ID. * `rooms`: A `Map` that stores room IDs as keys and `Set`s of client IDs as values. Using a `Set` ensures that each client ID appears only once in a room. * **`generateId()`:** A simple function to generate unique client and room IDs. **Important:** For production, use a more robust UUID generation library (e.g., `uuid`). The current implementation is sufficient for basic testing but is not guaranteed to be collision-free in a high-volume environment. * **`sendMessage(clientId, message)`:** A helper function to send a JSON-stringified message to a specific client. Includes error handling to catch potential issues during sending. Also checks if the client is still connected before attempting to send. * **`broadcastToRoom(roomId, message, excludeClientId)`:** A helper function to send a JSON-stringified message to all clients in a room, optionally excluding a specific client. * **`handleDisconnect(clientId)`:** Handles client disconnections gracefully. It removes the client from the `clients` map and from any rooms they were in. It also notifies other clients in the room that the client has left. Critically, it also removes empty rooms. * **WebSocket Server (`wss`)**: * **`connection` event:** Handles new WebSocket connections. * Generates a unique client ID. * Stores the client's WebSocket object in the `clients` map. * Sends the client their ID. * Sets up message handling, close handling, and error handling for the client. * **`message` event:** Handles incoming messages from clients. * Parses the message as JSON. * Uses a `switch` statement to handle different message types: * `createRoom`: Creates a new room and adds the client to it. * `joinRoom`: Adds the client to an existing room. * `leaveRoom`: Removes the client from a room. * `message`: Broadcasts a message to all other clients in the room. * `ping`: Responds to a ping message (for heartbeat). * Includes error handling for JSON parsing and unknown message types. * **`close` event:** Handles client disconnections. * **`error` event:** Handles WebSocket errors. * **Heartbeat (Ping/Pong):** Implements a heartbeat mechanism to detect and close dead connections. This is crucial for maintaining a stable connection with clients, especially in environments with unreliable networks. * A `setInterval` function sends a `ping` message to each client every `HEARTBEAT_INTERVAL`. * The `ws.isAlive` flag is set to `false` before sending the ping. * If the client responds with a `pong` message, the `ws.isAlive` flag is set back to `true`. * If the client doesn't respond within the interval, the connection is terminated. * **Error Handling:** Includes `try...catch` blocks to handle potential errors during message parsing and sending. Also logs errors to the console for debugging. * **Clear Logging:** Logs important events to the console, such as client connections, disconnections, room creation, joining, and leaving. * **Message Types:** Uses a consistent message format with a `type` field to identify the type of message. This makes it easier to handle different types of messages on both the server and the client. **How to Run:** 1. **Save:** Save the code as a `.js` file (e.g., `linkup_server.js`). 2. **Install `ws`:** `npm install ws` 3. **Run:** `node linkup_server.js` **Client-Side Example (Conceptual):** ```javascript // Client-side JavaScript (Conceptual - adapt to your framework) const ws = new WebSocket('ws://localhost:8080'); ws.onopen = () => { console.log('Connected to WebSocket server'); }; ws.onmessage = event => { const message = JSON.parse(event.data); console.log('Received message:', message); switch (message.type) { case 'clientId': console.log('My client ID is:', message.clientId); myClientId = message.clientId; // Store the client ID break; // Handle other message types (roomCreated, roomJoined, message, etc.) } }; ws.onclose = () => { console.log('Disconnected from WebSocket server'); }; ws.onerror = error => { console.error('WebSocket error:', error); }; function sendMessage(type, data) { ws.send(JSON.stringify({ type: type, ...data })); } // Example usage: // To create a room: // sendMessage('createRoom'); // To join a room: // sendMessage('joinRoom', { roomId: 'someRoomId' }); // To send a message to a room: // sendMessage('message', { roomId: 'someRoomId', content: 'Hello, everyone!' }); ``` **Important Considerations for Production:** * **Security:** * **HTTPS:** Use HTTPS (WSS) to encrypt the WebSocket connection. This is essential for protecting sensitive data. * **Authentication:** Implement authentication to verify the identity of clients. This can be done using various methods, such as JWTs or OAuth. * **Authorization:** Implement authorization to control what clients are allowed to do. For example, you might want to restrict access to certain rooms or features based on the client's role. * **Input Validation:** Validate all input from clients to prevent injection attacks. * **Scalability:** * **Load Balancing:** Use a load balancer to distribute traffic across multiple server instances. * **Horizontal Scaling:** Design the server to be horizontally scalable, so you can easily add more instances as needed. * **Message Broker:** Consider using a message broker (e.g., RabbitMQ, Kafka) to handle message distribution, especially if you need to support a large number of concurrent connections. * **Reliability:** * **Monitoring:** Implement monitoring to track the health and performance of the server. * **Logging:** Log all important events to a file or database for debugging and auditing. * **Error Handling:** Implement robust error handling to prevent crashes and ensure that the server can recover from errors gracefully. * **Heartbeats:** The heartbeat mechanism is crucial for detecting and closing dead connections. * **UUIDs:** Use a proper UUID library for generating unique IDs. * **Frameworks:** Consider using a WebSocket framework like Socket.IO or Primus. These frameworks provide higher-level abstractions and features that can simplify development and improve performance. However, for a basic MCP server, the `ws` library is often sufficient. This improved version provides a more robust and complete foundation for building a Linkup MCP server in JavaScript. Remember to adapt the code to your specific needs and requirements. Good luck!

MCP-Todoist Integration

MCP-Todoist Integration

用于自然语言任务管理的 Todoist 集成的 MCP 服务器

Remote MCP Server Authless

Remote MCP Server Authless

A serverless deployment for Model Context Protocol server on Cloudflare Workers without authentication requirements, enabling users to create custom AI tools accessible via Cloudflare AI Playground or Claude Desktop.

Honeybadger MCP Server

Honeybadger MCP Server

Enables AI agents to interact with the Honeybadger error monitoring service to list, filter, and analyze fault data. It provides tools for fetching error lists and retrieving detailed fault information from Honeybadger projects.

OCI MCP Server

OCI MCP Server

Enables interaction with Oracle Cloud Infrastructure services through a unified interface. Supports comprehensive OCI resource management including compute instances, storage, networking, databases, and monitoring through natural language commands in VS Code.

Grocery Search MCP Server

Grocery Search MCP Server

Provides grocery price and nutritional information search capabilities, allowing AI agents to search for food products, compare prices, and analyze nutritional content across different grocery stores.

Lizeur

Lizeur

Enables AI assistants to extract and read content from PDF documents using Mistral AI's OCR capabilities. Provides intelligent caching and returns clean markdown text for easy integration with AI workflows.

Remote MCP Server (Authless)

Remote MCP Server (Authless)

Enables deployment of MCP servers on Cloudflare Workers without authentication requirements. Provides a template for creating custom tools that can be accessed remotely via Claude Desktop or the Cloudflare AI Playground.

Knowledge Base MCP Server

Knowledge Base MCP Server

镜子 (jìng zi)

Google-Flights-MCP-Server

Google-Flights-MCP-Server

这个 MCP 服务器允许 AI 助手使用 Google Flights 在线搜索航班信息。它可以查找特定日期的航班,也可以搜索一系列日期以查找所有选项或仅查找最便宜的选项。

🚀 MCP-AI: Self-Learning API-to-cURL Model

🚀 MCP-AI: Self-Learning API-to-cURL Model

Filesystem MCP Server

Filesystem MCP Server

一个模型上下文协议服务器,为人工智能代理提供对本地文件系统操作的安全访问,从而可以通过标准化的接口读取、写入和管理文件。

Web3 Research MCP

Web3 Research MCP

加密货币深度研究 - 免费且完全本地化

MCPheonix

MCPheonix

使用 Elixir 的 Phoenix 框架实现的简化版模型上下文协议 (MCP) 服务器。

Enact Protocol MCP

Enact Protocol MCP

用于执行协议的 MCP 服务器 (Yòng yú zhíxíng xiéyì de MCP fúwùqì)

Screenshot Website Fast

Screenshot Website Fast

Captures high-quality screenshots and screencasts of web pages, automatically tiling full pages into 1072x1072 chunks optimized for Claude Vision API and other AI vision models.

agent-rules-mcp

agent-rules-mcp

MCP server that enables your agents to use coding rules from any or your GitHub repository. Instead of workspace rules files, you can now prompt agents to access the your coding rules from any repository.

CockroachDB MCP Server by CData

CockroachDB MCP Server by CData

CockroachDB MCP Server by CData

Google Contacts MCP Server

Google Contacts MCP Server

Enables AI assistants to access and search Google Contacts through per-user OAuth authentication on serverless AWS Lambda. Provides read-only access to personal contacts with zero data storage and real-time API queries.

SMU Schedule MCP Server

SMU Schedule MCP Server

Enables management of Sangmyung University academic information including schedules, meals, notices, and exam details. Provides tools to query, search, add, and delete university data through a MySQL database connection.

MCP SQL Server

MCP SQL Server

A Model Context Protocol server that provides AI assistants with comprehensive access to SQL databases, enabling schema inspection, query execution, and database operations with enterprise-grade security.

mcp-starter

mcp-starter

mcp-starter is a secure, starter framework for building MCP servers with JWT-based authentication, multi-tenant enforcement, and schema validation. Built with Node.js and Docker

mcp-netcoredbg

mcp-netcoredbg

An MCP server that enables AI agents to debug .NET applications using netcoredbg. It supports core debugging tasks like setting breakpoints, stepping through code, and inspecting variables or stack traces.

CLI Agent MCP

CLI Agent MCP

Provides unified access to multiple CLI AI agents (Codex, Gemini, Claude, and OpenCode) through a single MCP interface with real-time task monitoring, enabling specialized code analysis, UI design, implementation, and prototyping workflows.

Guía de Instalación de Supabase MCP Server

Guía de Instalación de Supabase MCP Server

好的,请提供您想翻译成中文的英文文本。我会将 "Guía detallada de instalación para Supabase MCP Server" 翻译成中文,并等待您提供更多文本。 翻译如下: **Supabase MCP 服务器详细安装指南** 请提供您想翻译的英文文本,我会尽力为您提供准确的翻译。

MCP Server Cookiecutter Template

MCP Server Cookiecutter Template

创建一个你自己的 Minecraft 服务器的简单易管理的方法: (Chuàngjiàn yī gè nǐ zìjǐ de Minecraft fúwùqì de jiǎndān yì guǎnlǐ de fāngfǎ:)