发现优秀的 MCP 服务器
通过 MCP 服务器扩展您的代理能力,拥有 13,698 个能力。
Git Prompts MCP Server
镜子 (jìng zi)
Rundeck MCP 服務器
kmcp
🚀 用于 Kubernetes 的 MCP 服务器。
mcp-server-harvest-time-tracking
一个 Harvest 的模型上下文协议 (MCP) 服务器实现,能够与 MCP 客户端无缝集成。该项目提供了一种通过模型上下文协议与 Harvest 交互的标准化方式。本质上,它是 Harvest API 的一个 MCP 格式的封装器。
IMAP MCP Server
MCP 服务器提供基本的 IMAP 工具
![JSON MCP Server (@gongrzhe/[email protected])](https://cdn.himcp.cn/app/mcp-servers/icons/default.png)
JSON MCP Server (@gongrzhe/[email protected])
镜子 (jìng zi)
Advanced PocketBase MCP Server
镜子 (jìng zi)
nUniversal-Robots-MCP
优傲机器人 MCP 服务器 (Yōu ào jīqìrén MCP fúwùqì)
mcp-serverman: A MCP Server Configuration Manager
一个用于管理 MCP 服务器 JSON 配置文件的 CLI/MCP 服务器工具,具有版本控制、配置文件和多客户端支持。
BasicMcpServer
mcp-scratchpad
MCP客户端/服务器的草稿存储库。
JupyterMCP - Jupyter Notebook Model Context Protocol Integration
Jupyter Notebook 的模型上下文协议 (MCP)
frontapp-mcp-server
前端应用的 MCP 服务器
Repository Analyzer MCP Server
一个模型上下文协议(MCP)服务器,用于分析代码仓库,并提供针对 Nostr 协议和 NDK 的专用工具。
Welcome-MCP-Server-Testing
MCP服务器功能的测试存储库
Appwrite MCP server
MCP 连接 LLM 到 Appwrite (MCP liánjiē LLM dào Appwrite)
Playwright MCP Server
Playwright MCP 服务器项目 (Playwright MCP fúwùqì xiàngmù)
MCPSharp
MCPSharp 是一个 .NET 库,它可以帮助你构建模型上下文协议 (MCP) 的服务器和客户端。MCP 是 AI 助手和模型使用的标准化 API 协议。
MCP Server Demo with Goose
Instagram MCP Server
镜子 (jìng zi)
MCP Server using Spring Boot Java
使用 Spring Boot Java 的 MCP 服务器
Mixpanel MCP Server
Remote MCP Server on Cloudflare
MCP Proxy POC
Patronus MCP Server
Remote MCP Server on Cloudflare
MCP 만들면서 원리 파헤쳐보기
Okay, here's a breakdown of the server and client implementation for a system conceptually similar to the MCP (Master Control Program) from the movie Tron, along with considerations for a modern implementation. Keep in mind that a real-world MCP would be incredibly complex, so this is a simplified, illustrative example. **Conceptual Overview** The MCP, in essence, is a central control system. In a modern context, we can think of it as a distributed system with the following key components: * **Server (MCP Core):** The central authority. It manages resources, schedules tasks, enforces security policies, and monitors the overall system health. * **Clients (Programs/Processes):** These are the individual applications or processes that interact with the MCP to request resources, execute tasks, and report their status. * **Communication Protocol:** A well-defined protocol for clients and the server to exchange information. **Implementation Considerations** * **Language Choice:** Python is a good choice for prototyping and scripting due to its readability and extensive libraries. For performance-critical components, consider languages like Go, Rust, or C++. * **Communication:** gRPC, ZeroMQ, or even a simple TCP socket-based protocol can be used for communication between the server and clients. gRPC is a modern, high-performance RPC framework that's well-suited for this kind of system. * **Security:** Authentication and authorization are crucial. Use strong authentication mechanisms (e.g., TLS certificates, API keys) and implement role-based access control (RBAC) to restrict access to sensitive resources. * **Resource Management:** The MCP needs to track available resources (CPU, memory, disk space, network bandwidth) and allocate them to clients based on their needs and priorities. * **Task Scheduling:** A scheduler determines the order in which tasks are executed. Prioritization, deadlines, and dependencies should be considered. * **Monitoring and Logging:** Comprehensive monitoring and logging are essential for detecting errors, performance bottlenecks, and security breaches. * **Fault Tolerance:** The MCP should be designed to be fault-tolerant. Consider using techniques like redundancy, replication, and failover to ensure that the system remains operational even if some components fail. **Simplified Python Example (Illustrative)** This is a very basic example to demonstrate the core concepts. It's not production-ready. ```python # server.py (MCP Core) import socket import threading import json import time HOST = '127.0.0.1' PORT = 65432 # Resource Management (very basic) available_cpu = 100 resource_lock = threading.Lock() def handle_client(conn, addr): print(f"Connected by {addr}") while True: try: data = conn.recv(1024).decode() if not data: break try: request = json.loads(data) print(f"Received request: {request}") if request['action'] == 'request_cpu': cpu_units = request['cpu_units'] with resource_lock: global available_cpu if available_cpu >= cpu_units: available_cpu -= cpu_units response = {'status': 'granted', 'cpu_units': cpu_units} print(f"Granted {cpu_units} CPU units. Remaining: {available_cpu}") else: response = {'status': 'denied', 'reason': 'Insufficient CPU'} conn.sendall(json.dumps(response).encode()) elif request['action'] == 'report_status': status = request['status'] print(f"Client reported status: {status}") conn.sendall(json.dumps({'status': 'received'}).encode()) elif request['action'] == 'release_cpu': cpu_units = request['cpu_units'] with resource_lock: available_cpu += cpu_units response = {'status': 'released', 'cpu_units': cpu_units} print(f"Released {cpu_units} CPU units. Remaining: {available_cpu}") conn.sendall(json.dumps(response).encode()) else: response = {'status': 'error', 'message': 'Invalid action'} conn.sendall(json.dumps(response).encode()) except json.JSONDecodeError: response = {'status': 'error', 'message': 'Invalid JSON'} conn.sendall(json.dumps(response).encode()) except ConnectionResetError: print(f"Connection reset by {addr}") break except Exception as e: print(f"Error handling client: {e}") break print(f"Closing connection with {addr}") conn.close() def main(): with socket.socket(socket.AF_INET, socket.SOCK_STREAM) as s: s.bind((HOST, PORT)) s.listen() print(f"MCP Server listening on {HOST}:{PORT}") while True: conn, addr = s.accept() thread = threading.Thread(target=handle_client, args=(conn, addr)) thread.start() if __name__ == "__main__": main() ``` ```python # client.py (Program/Process) import socket import json import time HOST = '127.0.0.1' PORT = 65432 def request_cpu(conn, cpu_units): request = {'action': 'request_cpu', 'cpu_units': cpu_units} conn.sendall(json.dumps(request).encode()) response = json.loads(conn.recv(1024).decode()) return response def report_status(conn, status): request = {'action': 'report_status', 'status': status} conn.sendall(json.dumps(request).encode()) response = json.loads(conn.recv(1024).decode()) return response def release_cpu(conn, cpu_units): request = {'action': 'release_cpu', 'cpu_units': cpu_units} conn.sendall(json.dumps(request).encode()) response = json.loads(conn.recv(1024).decode()) return response def main(): with socket.socket(socket.AF_INET, socket.SOCK_STREAM) as s: s.connect((HOST, PORT)) # Request CPU cpu_request_response = request_cpu(s, 20) print(f"CPU Request Response: {cpu_request_response}") if cpu_request_response['status'] == 'granted': # Report status status_response = report_status(s, 'Running task...') print(f"Status Response: {status_response}") time.sleep(5) # Simulate work # Release CPU cpu_release_response = release_cpu(s, 20) print(f"CPU Release Response: {cpu_release_response}") else: print("CPU request denied.") report_status(s, "Exiting") if __name__ == "__main__": main() ``` **How to Run:** 1. Save the code as `server.py` and `client.py`. 2. Run the server: `python server.py` 3. Run the client: `python client.py` (You can run multiple clients in separate terminals). **Explanation:** * **Server (server.py):** * Listens for incoming connections on a specified port. * Handles each client connection in a separate thread. * Receives JSON-encoded requests from clients. * Implements basic CPU resource management (request, release). * Responds to clients with JSON-encoded responses. * **Client (client.py):** * Connects to the server. * Sends JSON-encoded requests to the server (request CPU, report status, release CPU). * Receives JSON-encoded responses from the server. * Simulates a simple task that requests CPU, reports its status, and releases the CPU. **Improvements and Next Steps:** * **Error Handling:** Add more robust error handling to both the server and client. * **Authentication/Authorization:** Implement a proper authentication and authorization system. * **Resource Management:** Expand the resource management to include memory, disk space, and other resources. Implement a more sophisticated resource allocation algorithm. * **Task Scheduling:** Implement a task scheduler that can prioritize tasks, handle dependencies, and enforce deadlines. * **Monitoring:** Integrate monitoring tools to track system health and performance. * **Logging:** Use a logging library (e.g., `logging` in Python) to record events and errors. * **Concurrency:** Use asynchronous programming (e.g., `asyncio` in Python) for better concurrency and scalability. * **gRPC:** Migrate to gRPC for a more efficient and robust communication protocol. Define a gRPC service definition (a `.proto` file) that specifies the available RPC calls. * **Database:** Use a database to store information about users, resources, tasks, and system state. * **Distributed System:** Design the MCP as a distributed system with multiple server nodes for fault tolerance and scalability. Consider using a distributed consensus algorithm (e.g., Raft or Paxos) to ensure consistency across the nodes. **Translation to Chinese** Here's a translation of the conceptual overview and the improvements/next steps into Chinese: **概念概述 (Gài niàn ǒugài - Conceptual Overview)** MCP 本质上是一个中央控制系统。 在现代背景下,我们可以将其视为一个分布式系统,具有以下关键组件: * **服务器 (MCP 核心):** 中央权威。 它管理资源、调度任务、执行安全策略并监控整个系统健康状况。 * **客户端 (程序/进程):** 这些是与 MCP 交互以请求资源、执行任务和报告其状态的各个应用程序或进程。 * **通信协议:** 客户端和服务器交换信息的明确定义的协议。 **改进和下一步 (Gǎi jìn hé xià yī bù - Improvements and Next Steps)** * **错误处理 (Cuòwù chǔlǐ):** 向服务器和客户端添加更强大的错误处理。 * **身份验证/授权 (Shēnfèn yànzhèng/shòuquán):** 实施适当的身份验证和授权系统。 * **资源管理 (Zīyuán guǎnlǐ):** 扩展资源管理以包括内存、磁盘空间和其他资源。 实施更复杂的资源分配算法。 * **任务调度 (Rènwù diàodù):** 实施一个任务调度程序,可以优先处理任务、处理依赖关系并强制执行截止日期。 * **监控 (Jiānkòng):** 集成监控工具以跟踪系统健康状况和性能。 * **日志记录 (Rìzhì jìlù):** 使用日志记录库(例如 Python 中的 `logging`)来记录事件和错误。 * **并发 (Bìngfā):** 使用异步编程(例如 Python 中的 `asyncio`)以获得更好的并发性和可伸缩性。 * **gRPC:** 迁移到 gRPC 以获得更高效和强大的通信协议。 定义一个 gRPC 服务定义(一个 `.proto` 文件),指定可用的 RPC 调用。 * **数据库 (Shùjùkù):** 使用数据库来存储有关用户、资源、任务和系统状态的信息。 * **分布式系统 (Fēn bù shì xìtǒng):** 将 MCP 设计为具有多个服务器节点的分布式系统,以实现容错和可伸缩性。 考虑使用分布式共识算法(例如 Raft 或 Paxos)来确保节点之间的一致性。 This provides a starting point for building a system inspired by the MCP. Remember to prioritize security, scalability, and fault tolerance as you develop your implementation. Good luck!
eBay MCP Server
mcp-servers-latest
最新可用的 Minecraft 服务器。
GitHub MCP Server Integration