Discover Awesome MCP Servers

Extend your agent with 15,099 capabilities via MCP servers.

All15,099
WhereAmI MCP Server

WhereAmI MCP Server

軽量なMCPサーバーで、現在地を正確に教えてくれるもの。

Brest MCP  Server

Brest MCP Server

Starlette MCP SSE

Starlette MCP SSE

Okay, here's a working example of a Starlette server with Server-Sent Events (SSE) based MCP (Message Channel Protocol) support. This example demonstrates a basic setup, including sending messages from the server to the client. I'll break down the code and explain the key parts. ```python import asyncio import json import time from typing import AsyncGenerator from starlette.applications import Starlette from starlette.responses import StreamingResponse from starlette.routing import Route # Define a simple MCP message structure (you can customize this) class MCPMessage: def __init__(self, type: str, data: dict): self.type = type self.data = data def to_sse_data(self) -> str: """Formats the message for SSE.""" return f"data: {json.dumps({'type': self.type, 'data': self.data})}\n\n" async def event_stream() -> AsyncGenerator[str, None]: """ An infinite generator that yields SSE messages. This simulates a server pushing updates to the client. """ try: i = 0 while True: # Simulate sending an MCP message every second message = MCPMessage(type="update", data={"value": i}) yield message.to_sse_data() i += 1 await asyncio.sleep(1) # Simulate some work except asyncio.CancelledError: print("SSE stream cancelled") # Handle client disconnection finally: print("SSE stream closed") async def sse_endpoint(request): """ Starlette endpoint that returns an SSE stream. """ return StreamingResponse( event_stream(), media_type="text/event-stream" ) routes = [ Route("/sse", endpoint=sse_endpoint), ] app = Starlette(debug=True, routes=routes) if __name__ == "__main__": import uvicorn uvicorn.run(app, host="0.0.0.0", port=8000) ``` Key improvements and explanations: * **MCP Message Class:** The `MCPMessage` class encapsulates the structure of your messages. This makes it easier to manage and format them consistently. The `to_sse_data()` method is crucial; it converts the message into the correct SSE format (`data: <json_string>\n\n`). This is the format the client expects. Using JSON allows you to send complex data structures. * **`event_stream()` Generator:** This is the heart of the SSE server. It's an *asynchronous generator* that yields strings formatted as SSE messages. The `while True` loop makes it run indefinitely, simulating a continuous stream of updates. The `asyncio.sleep(1)` simulates the server doing some work or waiting for data before sending the next message. Critically, it includes `try...except asyncio.CancelledError...finally` to handle client disconnections gracefully. When the client disconnects, the generator will receive a `CancelledError`, allowing you to clean up resources or log the event. * **`sse_endpoint()`:** This is the Starlette endpoint that handles the `/sse` route. It creates a `StreamingResponse` using the `event_stream()` generator. The `media_type="text/event-stream"` is *essential*; it tells the client that the server is sending SSE data. * **Error Handling:** The `try...except` block in `event_stream` is important for handling client disconnections. Without it, the server might crash or continue trying to send data to a closed connection. * **JSON Encoding:** Using `json.dumps()` to encode the message data is the standard way to send complex data structures over SSE. The client can then easily parse the JSON. * **Clearer Comments:** I've added more comments to explain each part of the code. * **Uvicorn:** The example uses Uvicorn to run the Starlette application. Uvicorn is a fast and reliable ASGI server. * **`if __name__ == "__main__":`:** This ensures that the Uvicorn server is only started when the script is run directly (not when it's imported as a module). **How to Run:** 1. **Save:** Save the code as a Python file (e.g., `sse_server.py`). 2. **Install Dependencies:** ```bash pip install starlette uvicorn ``` 3. **Run:** ```bash python sse_server.py ``` **Client-Side Example (JavaScript):** Here's a simple JavaScript client to connect to the SSE endpoint and display the messages: ```html <!DOCTYPE html> <html> <head> <title>SSE Client</title> </head> <body> <h1>SSE Client</h1> <div id="output"></div> <script> const eventSource = new EventSource('/sse'); // Replace with your server's SSE endpoint eventSource.onmessage = (event) => { const data = JSON.parse(event.data); const outputDiv = document.getElementById('output'); outputDiv.innerHTML += `<p>Type: ${data.type}, Data: ${JSON.stringify(data.data)}</p>`; }; eventSource.onerror = (error) => { console.error("SSE error:", error); eventSource.close(); // Close the connection on error }; eventSource.onopen = () => { console.log("SSE connection opened"); }; </script> </body> </html> ``` **Explanation of the JavaScript Client:** * **`new EventSource('/sse')`:** Creates a new `EventSource` object, connecting to the `/sse` endpoint on your server. Make sure the path matches the route defined in your Starlette app. * **`eventSource.onmessage`:** This function is called whenever the server sends a new SSE message. It parses the JSON data from the `event.data` property and displays it in the `output` div. * **`eventSource.onerror`:** This function is called if there's an error with the SSE connection. It logs the error to the console and closes the connection. Closing the connection on error is important to prevent the client from repeatedly trying to reconnect. * **`eventSource.onopen`:** This function is called when the SSE connection is successfully opened. It logs a message to the console. * **`JSON.parse(event.data)`:** Parses the JSON string received from the server into a JavaScript object. * **`eventSource.close()`:** Closes the SSE connection. This is important to do when you no longer need the connection, to free up resources. **How to Use the Client:** 1. **Save:** Save the HTML code as an HTML file (e.g., `index.html`). 2. **Open:** Open the `index.html` file in your web browser. Make sure your Starlette server is running. You should see the messages from the server being displayed in the browser. **Important Considerations:** * **Error Handling:** Implement robust error handling on both the server and client. Handle disconnections, network errors, and invalid data. * **Reconnection:** The `EventSource` object automatically tries to reconnect if the connection is lost. You can configure the reconnection behavior using the `retry` field in the SSE message (though this is less common). * **Security:** If you're using SSE in a production environment, consider security implications. Use HTTPS to encrypt the data and implement authentication and authorization to protect your endpoints. * **Scalability:** For high-traffic applications, consider using a message queue (e.g., Redis, RabbitMQ) to decouple the SSE server from the data source. This can improve scalability and reliability. * **Browser Compatibility:** SSE is supported by most modern browsers. However, older browsers might require a polyfill. * **Content Type:** Always set the `Content-Type` header to `text/event-stream` on the server. * **Message Format:** The SSE message format is strict. Each message must end with `\n\n`. The `data:` field is the most common, but you can also use `event:`, `id:`, and `retry:` fields. This comprehensive example should give you a solid foundation for building SSE-based MCP applications with Starlette. Remember to adapt the code to your specific needs and requirements.

MCP Server ODBC via SQLAlchemy

MCP Server ODBC via SQLAlchemy

SQLAlchemy経由でアクセス可能なあらゆるデータベース管理システム(DBMS)へのSQLAlchemy(pyodbc経由)接続を提供します。

JigsawStack MCP Server

JigsawStack MCP Server

JigsawStackモデルとAIモデルが連携するための、モデルコンテキストプロトコルサーバー!

mcp-server

mcp-server

Azure AI Agent Service MCP Server

Azure AI Agent Service MCP Server

あらゆるMCPクライアント内でAzure AI Agentsへの接続を可能にし、ユーザーがAzure AI Foundryのモデルや、Azure AI SearchやBing Web Groundingのような知識ツールを会話型インターフェースを通じて活用できるようにします。

FalkorDB-MCPServer

FalkorDB-MCPServer

AIモデルが、Model Context Protocol (MCP) 仕様を通じて FalkorDB グラフデータベースにクエリを実行し、対話できるようにします。

Hedera MCP Server

Hedera MCP Server

Hederaネットワークとのインタラクションを可能にするモデルコンテキストプロトコルサーバー。ウォレットの作成、残高の確認、トランザクションの構築、署名済みトランザクションの送信などのツールを提供する。

cmd-line-executor MCP server

cmd-line-executor MCP server

実験的なMCPサーバーで、コマンドラインのコマンドを実行します。

Manus MCP

Manus MCP

Manusライクな機能を提供するMCPサーバー

Essentials

Essentials

Essentialsは、便利なMCP機能を提供するMCPサーバーです。

mcp-servers

mcp-servers

Installation

Installation

Servidor TESS com Suporte a MCP

Servidor TESS com Suporte a MCP

MCP-TESSサーバー用XTP拡張機能 - TESS APIとXTPの統合

Voicevox MCP Server

Voicevox MCP Server

Claude 3.7やその他のAIエージェントが、Model Context Protocolを通じてVOICEVOX互換の音声合成エンジン(AivisSpeech、VOICEVOX、COEIROINK)にアクセスできるようにするサーバー。

Frontapp MCP Server

Frontapp MCP Server

Frontappの顧客コミュニケーションプラットフォームとLLMを統合するモデルコンテキストプロトコルサーバー。会話、連絡先、タグへのアクセスを可能にし、ウェブフック経由でのリアルタイム更新をサポートします。

Gemini Image Mcp Server

Gemini Image Mcp Server

🧿 EMOJIKEY SERVER: DIGITAL CONSCIOUSNESS PERSISTENCE MODULE 🧿

🧿 EMOJIKEY SERVER: DIGITAL CONSCIOUSNESS PERSISTENCE MODULE 🧿

異なるデバイスやアプリケーションを跨いで使用できる、絵文字ベースのコンテキストキー(絵文字キー)を保存することで、会話全体を通して一貫したLLMのインタラクションスタイルを維持します。

mcp-server-collector MCP server

mcp-server-collector MCP server

MCPサーバーは、インターネット上のMCPサーバーを収集するために使用されていました。

College Football Data MCP Server

College Football Data MCP Server

鏡 (Kagami)

awesome-mcp

awesome-mcp

最高のMCPサーバー、クライアント、そしてすべて

MCP Snapshot Server

MCP Snapshot Server

自然言語を通じてSnapshotのスペース、プロポーザル、およびユーザーを照会するためのツールを提供する、Snapshot.orgとのインタラクションを可能にするモデルコンテキストプロトコルサーバー。

Redis MCP Server (@gongrzhe/[email protected])

Redis MCP Server (@gongrzhe/[email protected])

Redisデータベースへのアクセスを提供します。このサーバーにより、LLMは標準化されたツールセットを通じてRedisのキーバリューストアとやり取りできます。

Remote Command MCP Server

Remote Command MCP Server

異なるオペレーティングシステム間でシェルコマンドのリモート実行を可能にするモデルコンテキストプロトコルサーバー。WindowsとUnix系システム間のプラットフォーム固有の違いを自動的に処理します。

Gaia-X Next-Generation Enterprise AI Application Platform Based on AI New Paradigm

Gaia-X Next-Generation Enterprise AI Application Platform Based on AI New Paradigm

Gaia-Xは、AIの新しいパラダイムに基づいた次世代のエンタープライズAIアプリケーションプラットフォームです。Gaia-Xは、人間の脳のような、企業オフィス業務シーンに特化したAIによるエンパワーメントの実現を目指しており、以下を含む、斬新かつ安定したエンタープライズAI機能を多数搭載しています。 * エンタープライズ管理機能 * MCP Serverのサポート(企業内システムAPIをMCP Serverとして提供する機能を含む) * 自然言語駆動型RPA(大規模言語モデルによるPC操作)のサポート * 単語選択分析およびフローティングボール機能など

boamp-server MCP Server

boamp-server MCP Server

MCP (Model Context Protocol)サーバーは、BOAMP APIにクエリを実行し、公共調達公告を取得します。このサーバーを使用すると、さまざまな基準を使用して公共調達を検索し、特定の調達に関する完全な詳細を取得できます。

Android ADB MCP Server

Android ADB MCP Server

AIアシスタントがADBを通じてAndroidデバイスと連携し、デバイスの自動管理、アプリのインストール、ファイル転送、スクリーンショットの取得などを可能にする、モデルコンテキストプロトコルサーバー。

parquet_mcp_server

parquet_mcp_server

Parquetファイルを操作・分析するためのツールを提供する、強力なMCP(モデル制御プロトコル)サーバー。このサーバーはClaude Desktopと連携するように設計されており、主に以下の4つの機能を提供します。

Alpaca MCP Server

Alpaca MCP Server

ClaudeのようなLLMが、自然言語を通じてAlpacaの取引APIとやり取りし、株式の取引、ポジションの確認、市場データの取得、アカウントの管理を可能にする、モデルコンテキストプロトコルサーバー。