发现优秀的 MCP 服务器
通过 MCP 服务器扩展您的代理能力,拥有 23,420 个能力。
Interzoid Global Time API Server
An MCP server that allows users to get global time information via Interzoid's GetGlobalTime API, enabling access to time data across different regions through natural language.
Webscraper MCP
MCP 服务器,通过向 LLM 提供 URL 来转录网页,供 LLM 使用。 (MCP fúwùqì, tōngguò xiàng LLM tígōng URL lái zhuǎnlù wǎngyè, gōng LLM shǐyòng.)
Google Drive MCP Server
Enables AI agents to efficiently access and process Google Drive documents by converting them to markdown and offering selective content extraction. Features intelligent caching, advanced search capabilities, and respect for Drive permissions to optimize context window usage.
Hyperbolic GPU MCP Server
Enables interaction with Hyperbolic's GPU cloud, allowing users to view available GPUs, rent instances, establish SSH connections, and run GPU-powered workloads through natural language commands.
Christensen MCP Server
A strategic advisory agent that applies Clayton Christensen's frameworks, such as Jobs-to-Be-Done and Disruption Theory, to analyze business decisions. It enables users to evaluate organizational capabilities, explore historical case studies, and receive theory-grounded strategic insights.
LocalMCP
An advanced MCP-based AI agent system with intelligent tool orchestration, multi-LLM support, and enterprise-grade reliability features like semantic routing and circuit breakers.
MarecoX MCP Servers
CSharpMCP
一个基于 Roslyn 的 mcp 服务器,用于动态执行 C# 代码片段。 Or, a slightly more formal translation: 一个基于 Roslyn 的 MCP 服务器,用于动态执行 C# 代码片段。
CEDAR MCP Server
Enables interaction with the CEDAR (Center for Expanded Data Annotation and Retrieval) metadata repository to fetch templates and retrieve template instances. Supports querying structured metadata and biomedical data annotations through the CEDAR platform.
MCP SSE Sample
好的,这是 MCP 服务器的 SSE(Server-Sent Events)实现的示例,包含代码和解释: **概念解释** * **SSE (Server-Sent Events):** 一种服务器向客户端推送数据的单向通信协议。客户端通过 HTTP 连接到服务器,服务器可以随时向客户端发送更新,而无需客户端发起新的请求。这非常适合实时更新,例如股票行情、新闻提要、聊天应用等。 * **MCP Server:** 我假设你指的是一个基于 Minecraft 协议 (MCP) 的服务器。虽然 MCP 本身不直接涉及 SSE,但你可以将 SSE 集成到你的服务器中,以向连接的客户端发送游戏状态或其他信息。 **示例代码 (Python + Flask)** 这个例子使用 Python 和 Flask 框架来创建一个简单的 SSE 服务器。 ```python from flask import Flask, Response, render_template import time import random app = Flask(__name__) # 模拟游戏状态数据 game_state = { "player_count": 0, "server_load": 0.0, "latest_news": "Server is online!" } def update_game_state(): """模拟更新游戏状态""" global game_state game_state["player_count"] = random.randint(0, 100) game_state["server_load"] = round(random.uniform(0.0, 1.0), 2) game_state["latest_news"] = f"Player joined! (Current: {game_state['player_count']})" def event_stream(): """生成 SSE 事件流""" while True: update_game_state() yield f"data: {game_state}\n\n" # 构建 SSE 格式的数据 time.sleep(1) # 每秒更新一次 @app.route('/') def index(): return render_template('index.html') # 渲染一个简单的 HTML 页面 @app.route('/stream') def stream(): return Response(event_stream(), mimetype="text/event-stream") if __name__ == '__main__': app.run(debug=True) ``` **解释:** 1. **导入必要的库:** * `flask`: 用于创建 Web 应用。 * `Response`: 用于构建 SSE 响应。 * `time`: 用于控制更新频率。 * `random`: 用于模拟游戏状态变化。 2. **`game_state` 字典:** * 存储模拟的游戏状态数据。你可以根据你的 MCP 服务器的需求修改这些数据。 3. **`update_game_state()` 函数:** * 模拟更新游戏状态。 在实际应用中,你需要从你的 MCP 服务器获取真实的数据。 4. **`event_stream()` 函数:** * **关键部分:** 这是一个生成器函数,它无限循环并产生 SSE 事件。 * `yield f"data: {game_state}\n\n"`: 这行代码构建了 SSE 格式的数据。 * `data:` 是 SSE 协议要求的字段,表示要发送的数据。 * `{game_state}`: 将 `game_state` 字典转换为字符串。 **重要:** 你可能需要使用 `json.dumps(game_state)` 将字典转换为 JSON 字符串,以便客户端更容易解析。 * `\n\n`: 两个换行符表示一个 SSE 事件的结束。 * `time.sleep(1)`: 暂停 1 秒,控制更新频率。 5. **`@app.route('/stream')` 路由:** * 当客户端访问 `/stream` 路径时,这个路由会被调用。 * `Response(event_stream(), mimetype="text/event-stream")`: 创建一个 `Response` 对象,将 `event_stream()` 生成器作为数据源,并将 `mimetype` 设置为 `text/event-stream`。 **`text/event-stream` 是 SSE 协议要求的 MIME 类型。** 6. **`index()` 函数和 `index.html` (可选):** * 提供一个简单的 HTML 页面,用于测试 SSE 连接。 **客户端代码 (JavaScript)** ```html <!DOCTYPE html> <html> <head> <title>SSE Example</title> </head> <body> <h1>Game State</h1> <div id="game-state"></div> <script> var eventSource = new EventSource('/stream'); // 连接到 SSE 端点 eventSource.onmessage = function(event) { var gameState = JSON.parse(event.data); // 解析 JSON 数据 document.getElementById('game-state').innerText = JSON.stringify(gameState, null, 2); // 显示格式化的 JSON }; eventSource.onerror = function(error) { console.error("SSE error:", error); }; </script> </body> </html> ``` **解释:** 1. **`new EventSource('/stream')`:** 创建一个 `EventSource` 对象,连接到服务器的 `/stream` 端点。 2. **`eventSource.onmessage`:** 定义一个事件处理函数,当服务器发送新数据时,这个函数会被调用。 * `event.data`: 包含服务器发送的数据。 * `JSON.parse(event.data)`: 将 JSON 字符串解析为 JavaScript 对象。 * `document.getElementById('game-state').innerText = JSON.stringify(gameState, null, 2)`: 将游戏状态数据显示在页面上。 `JSON.stringify(gameState, null, 2)` 用于格式化 JSON 输出,使其更易于阅读。 3. **`eventSource.onerror`:** 定义一个错误处理函数,当发生错误时,这个函数会被调用。 **如何运行:** 1. **安装 Flask:** `pip install flask` 2. **保存代码:** 将 Python 代码保存为 `app.py`,将 HTML 代码保存为 `templates/index.html` (需要在 `app.py` 所在的目录下创建一个名为 `templates` 的文件夹)。 3. **运行服务器:** `python app.py` 4. **在浏览器中打开:** `http://127.0.0.1:5000/` **重要注意事项:** * **JSON 序列化:** 在实际应用中,强烈建议使用 `json.dumps()` 将 Python 字典转换为 JSON 字符串,以便客户端更容易解析。 修改 `event_stream()` 函数如下: ```python import json def event_stream(): while True: update_game_state() yield f"data: {json.dumps(game_state)}\n\n" time.sleep(1) ``` * **错误处理:** 在客户端和服务器端添加适当的错误处理代码。 * **数据格式:** 根据你的 MCP 服务器的需求,调整 `game_state` 字典中的数据。 * **身份验证:** 如果需要,可以添加身份验证机制来保护 SSE 端点。 * **性能:** 对于高并发的场景,可能需要考虑使用更高效的异步框架,例如 `asyncio` 和 `aiohttp`。 * **MCP 集成:** 将 `update_game_state()` 函数修改为从你的 MCP 服务器获取真实的游戏状态数据。 这可能需要你使用 MCP 协议库来与服务器通信。 **总结:** 这个例子提供了一个基本的 SSE 实现,你可以根据你的 MCP 服务器的需求进行修改和扩展。 记住要使用 JSON 序列化,添加错误处理,并根据你的数据格式进行调整。 希望这个例子能帮助你理解如何在 MCP 服务器中实现 SSE。 **中文总结:** 这个例子展示了如何使用 Python 和 Flask 创建一个简单的服务器推送事件 (SSE) 服务器。 服务器模拟游戏状态数据,并通过 `/stream` 端点以 SSE 格式发送给客户端。 客户端使用 JavaScript 的 `EventSource` API 连接到服务器,接收并显示游戏状态数据。 关键点包括:使用 `text/event-stream` 作为 MIME 类型,使用 `data:` 字段格式化 SSE 数据,以及使用 `json.dumps()` 将 Python 字典转换为 JSON 字符串。 你需要根据你的 MCP 服务器的实际情况修改代码,例如从 MCP 服务器获取真实数据,并添加错误处理和身份验证。
GST Insights API MCP Server
Provides tools to retrieve and validate Goods and Services Tax (GST) details using GST numbers, PAN cards, or company names. It enables users to check registration status, filing history, and business addresses directly through the GST Insights API.
echo-mcp-server
Authorized Buyers Marketplace API MCP Server
A Multi-Agent Conversation Protocol Server that provides programmatic access to the Google Authorized Buyers Marketplace API, allowing agents to interact with the digital advertising marketplace through natural language.
MCP Server Make
一个模型上下文协议服务器,它使大型语言模型(LLM)能够安全地执行 Makefile 中的 make 目标,从而允许 AI 助手通过自然语言交互来运行测试、格式化代码和自动化各种开发任务。
MCP Server
Provides custom tools for news search, user profile management, and mathematical operations through the Model Context Protocol.
Playwright MCP Server
A Model Context Protocol server that enables AI assistants to interact with web pages through browser automation, supporting web scraping, form filling, navigation, and other browser-based tasks using Playwright.
MCP Servers (OnePiece & Geolocalizar)
A collection of two MCP servers that enable querying One Piece anime characters and geolocating public IP addresses.
MCPML Browser Recorder
浏览会话记录器 MCP 服务器 (由 MCPML 和 playwright 驱动)
md-mermaid-to-pdf-mcp
Converts Markdown files and raw content into professionally styled PDFs with full support for Mermaid diagrams and syntax highlighting. It offers customizable page formats, margins, and modern typography for high-quality document generation.
Date MCP Server
Provides AI assistants with real-time date, time, and timezone information, enabling them to access current temporal data, format dates, calculate day of week, and work with different timezones.
NestJS MCP Server Module
一个 NestJS 模块,允许将服务暴露为 MCP (Meta-Control Protocol) 服务器,并使用服务器发送事件 (Server-Sent Events, SSE) 传输,从而方便客户端进行工具发现和执行。
Archive Agent
Archive Agent is an open-source semantic file tracker with OCR + AI search (RAG) and MCP capability.
Bun Database MCP Server
A high-performance MCP server that enables AI assistants to safely interact with MySQL databases through secure CRUD operations, schema inspection, and parameterized queries with built-in SQL injection prevention.
YouTube MCP Server
一个模型上下文协议服务器,无需使用官方 YouTube API 即可搜索 YouTube 视频、检索和存储视频字幕,并对视频内容执行语义搜索。
MCP Qdrant Server with OpenAI Embeddings
这个服务器使用 Qdrant 向量数据库和 OpenAI 嵌入,实现了语义搜索功能,允许用户查询集合、列出可用集合以及查看集合信息。
MCP Server
MCP 服务器通过提供用户友好的 API 来创建自定义工具和高效地管理服务器工作流程,从而简化了模型上下文协议的实施。
dbt-docs-mcp
用于与 dbt Docs 交互的 MCP (模型上下文协议) 服务器
miEAA3 MCP Server
Integrates the miEAA 3.x bioinformatics platform with Claude Desktop, enabling microRNA enrichment analysis, identifier conversion between miRBase versions, and miRNA-precursor transformations through natural language.
SQL Analysis MCP Server
An MCP server designed for SQL analysis that demonstrates sampling capabilities by interacting with SQL files in a local directory. It provides a framework for testing client-side sampling while managing SQL-based contexts.
Browser-use MCP Client
浏览器使用的MCP客户端