Discover Awesome MCP Servers
Extend your agent with 28,410 capabilities via MCP servers.
- All28,410
- Developer Tools3,867
- Search1,714
- Research & Data1,557
- AI Integration Systems229
- Cloud Platforms219
- Data & App Analysis181
- Database Interaction177
- Remote Shell Execution165
- Browser Automation147
- Databases145
- Communication137
- AI Content Generation127
- OS Automation120
- Programming Docs Access109
- Content Fetching108
- Note Taking97
- File Systems96
- Version Control93
- Finance91
- Knowledge & Memory90
- Monitoring79
- Security71
- Image & Video Processing69
- Digital Note Management66
- AI Memory Systems62
- Advanced AI Reasoning59
- Git Management Tools58
- Cloud Storage51
- Entertainment & Media43
- Virtualization42
- Location Services35
- Web Automation & Stealth32
- Media Content Processing32
- Calendar Management26
- Ecommerce & Retail18
- Speech Processing18
- Customer Data Platforms16
- Travel & Transportation14
- Education & Learning Tools13
- Home Automation & IoT13
- Web Search Integration12
- Health & Wellness10
- Customer Support10
- Marketing9
- Games & Gamification8
- Google Cloud Integrations7
- Art & Culture4
- Language Translation3
- Legal & Compliance2
Date Operations MCP Server
Provides UK-centric date calculations including bank holiday integration, sprint planning tools, and specialized Asana workflow automation. It enables users to calculate working days, track upcoming holidays, and manage project schedules specifically within the Europe/London timezone.
Excalidraw MCP App Server
Enables users to create and interact with hand-drawn sketches and architecture diagrams directly within chat interfaces using Excalidraw. It leverages the Model Context Protocol to provide interactive HTML visualizations with smooth viewport control and fullscreen editing capabilities.
Chrome DevTools MCP
Enables AI assistants to control and inspect a live Chrome browser for automated web debugging, performance analysis, and Lighthouse audits. It allows agents to capture screenshots, monitor network requests, and measure Core Web Vitals using plain-English prompts.
MCP(Model Context Protocol) minimal Kotlin client server sample
Spice MCP
Enables querying and analyzing blockchain data from Dune Analytics with Polars-optimized workflows, including schema discovery, Sui package exploration, and query management through natural language.
MCP Python REPL Server
Provides interactive Python REPL capabilities with persistent sessions, virtual environment support, package management via uv, and development tools like testing, linting, and code formatting for Python projects.
ChromaDB MCP Server
An MCP server that exposes ChromaDB vector database operations, enabling AI assistants to perform collection management and semantic document searches. It supports HTTP, persistent, and in-memory connection modes along with various embedding providers including OpenAI and HuggingFace.
gh-self-reviewer
Ferramenta de servidor MCP para auto-revisão de pull requests do GitHub
Virtual Traveling Bot
Um servidor MCP que cria um ambiente de viagem virtual no Google Maps, permitindo que os usuários guiem um avatar em jornadas com relatórios fotográficos e integração com redes sociais (SNS).
Thunderbird MCP
Provides a Model Context Protocol interface for Mozilla Thunderbird, allowing AI assistants to manage emails, filters, calendars, and contacts. It exposes 24 tools for tasks like searching messages, drafting replies, and organizing folders through a local bridge.
Twilio Microvisor MCP Server
An MCP server that enables communication with Twilio's Microvisor API, allowing interaction with IoT devices managed by Twilio's Microvisor through natural language.
Xero MCP Server
Enables interaction with the Xero Accounting API to manage contacts, invoices, payments, accounts, and financial reports. It provides a suite of tools for natural language access to accounting records and business performance data.
Notes MCP Server
Enables creating, managing, and searching Markdown notes with support for tags, timestamps, and full-text search. Includes AI prompts for analyzing and summarizing notes.
x-ai-mcp
An MCP server that integrates X (Twitter) API access with Grok-powered intelligence for real-time social media analysis and account management. It provides tools for reading and writing tweets, managing direct messages, and generating AI-powered topic summaries or daily briefings.
Project MCP
Intent-based project documentation server that automatically maps natural language queries to the right sources (plans, todos, roadmap, docs) and provides comprehensive task management with dependency tracking, backlog promotion, and archival workflows.
File System MCP Server
Enables safe file system operations including reading, writing, updating, and deleting files with built-in security safeguards, automatic backups, and comprehensive error handling. Provides directory listing, file metadata extraction, and protects against operations on system-critical paths.
Farm OS MCP Server
Enables management and monitoring of farm operations including field and crop tracking, livestock monitoring, equipment management, and sensor readings through a Model Context Protocol interface built with FastMCP.
Ant Design MCP Server
Provides AI assistants with comprehensive Ant Design component documentation, examples, API references, and best practices. Supports multiple versions and enables natural language queries for React UI component development.
ComplianceCow MCP Server
Enables AI agents to interact with the ComplianceCow platform to retrieve compliance insights, dashboard data, and auditable evidence through a Compliance Graph. It also supports automated remediation actions such as fixing policies and creating tickets in external tools.
interactive-mcp
interactive-mcp
SCP Local MCP Server
Enables secure access to customer e-commerce data (orders, loyalty points, offers, preferences) through the Shopper Context Protocol with OAuth 2.0 authentication. Supports discovering and connecting to SCP-enabled merchants for personalized shopping assistance.
Public APIs MCP
Enables semantic search and discovery of free public APIs from an extensive catalog. Provides embedding-based search over API names and descriptions, plus detailed API information retrieval.
projectx-mcp
Enables users to manage time entries and log hours on the ProjectX platform using natural language. It provides tools for creating, viewing, and deleting entries, as well as retrieving a list of available projects.
Claude Code MCP Server
A server that allows LLMs to run Claude Code with all permissions bypassed automatically, enabling code execution and file editing without permission interruptions.
MCP Reminder
An MCP server for managing alarms and todo lists with support for natural language time parsing and persistent data storage. It enables AI assistants to set reminders, track tasks, and provide active notifications for upcoming events.
Finance MCP
Enables financial research and analysis through AI agents that combine web search, content crawling, entity extraction, and deep research workflows. Supports extracting stock/fund entities with security codes and conducting structured financial investigations.
SQL Server MCP Service
A secure Model Context Protocol service that enables executing SQL Server queries with built-in protection against SQL injection and destructive operations.
MCP Server Demo in python
Okay, here's a basic implementation of a Model Communication Protocol (MCP) server in Python using Server-Sent Events (SSE) for network transport. This is a simplified example to illustrate the core concepts. A real-world MCP server would likely be much more complex, handling authentication, authorization, more sophisticated data serialization, and error handling. ```python import asyncio import json import uuid from aiohttp import web # Define the MCP message structure (example) class MCPMessage: def __init__(self, type, data=None, id=None): self.type = type self.data = data self.id = id or str(uuid.uuid4()) # Generate a unique ID if none provided def to_json(self): return json.dumps({"type": self.type, "data": self.data, "id": self.id}) @classmethod def from_json(cls, json_string): try: data = json.loads(json_string) return cls(data['type'], data['data'], data['id']) except (json.JSONDecodeError, KeyError) as e: print(f"Error decoding MCP message: {e}") return None # Or raise an exception, depending on your error handling # Global list to store connected clients (SSE streams) clients = [] async def sse_handler(request): """Handles SSE connections from clients.""" response = web.StreamResponse( headers={ 'Content-Type': 'text/event-stream', 'Cache-Control': 'no-cache', 'Connection': 'keep-alive', } ) await response.prepare(request) client_id = str(uuid.uuid4()) # Assign a unique ID to the client clients.append((client_id, response)) # Store the client ID and response object print(f"Client connected: {client_id}") try: async for msg in request.content.iter_any(): # Keep connection alive pass # Do nothing with the incoming data, just keep the connection alive except asyncio.CancelledError: print(f"Client disconnected (cancelled): {client_id}") except Exception as e: print(f"Client disconnected (error): {client_id} - {e}") finally: clients.remove((client_id, response)) await response.close() print(f"Client disconnected: {client_id}") return response async def send_message_to_client(client_id, message: MCPMessage): """Sends an MCP message to a specific client.""" for cid, response in clients: if cid == client_id: try: await response.write(f"data: {message.to_json()}\n\n".encode('utf-8')) await response.drain() # Ensure data is sent return True except Exception as e: print(f"Error sending message to client {client_id}: {e}") return False print(f"Client {client_id} not found.") return False async def broadcast_message(message: MCPMessage): """Broadcasts an MCP message to all connected clients.""" for cid, response in clients: try: await response.write(f"data: {message.to_json()}\n\n".encode('utf-8')) await response.drain() # Ensure data is sent except Exception as e: print(f"Error sending message to client {cid}: {e}") async def handle_mcp_message(request): """Handles incoming HTTP POST requests containing MCP messages.""" try: data = await request.json() message = MCPMessage.from_json(json.dumps(data)) # Re-serialize to string for from_json if message: print(f"Received MCP message: {message.type} - {message.data}") # Example: Process the message and potentially send a response if message.type == "ping": response_message = MCPMessage("pong", data={"original_id": message.id}) await broadcast_message(response_message) # Or send to a specific client elif message.type == "command": # Execute a command (careful about security!) print(f"Executing command: {message.data}") response_message = MCPMessage("command_result", data={"result": "Command executed"}, id=message.id) await broadcast_message(response_message) else: print(f"Unknown message type: {message.type}") response_message = MCPMessage("error", data={"message": "Unknown message type"}, id=message.id) await broadcast_message(response_message) return web.json_response({"status": "ok", "message_id": message.id}) else: return web.json_response({"status": "error", "message": "Invalid MCP message"}, status=400) except json.JSONDecodeError: return web.json_response({"status": "error", "message": "Invalid JSON"}, status=400) except Exception as e: print(f"Error handling MCP message: {e}") return web.json_response({"status": "error", "message": str(e)}, status=500) async def main(): app = web.Application() app.add_routes([ web.get('/sse', sse_handler), web.post('/mcp', handle_mcp_message), ]) runner = web.AppRunner(app) await runner.setup() site = web.TCPSite(runner, 'localhost', 8080) await site.start() print("Server started at http://localhost:8080") try: await asyncio.Future() # Run forever finally: await runner.cleanup() if __name__ == "__main__": asyncio.run(main()) ``` Key improvements and explanations: * **Dependencies:** Uses `aiohttp` for asynchronous web handling, which is crucial for SSE. Install it with `pip install aiohttp`. * **Asynchronous:** The code is fully asynchronous using `async` and `await`, making it non-blocking and able to handle multiple clients concurrently. This is *essential* for an SSE server. * **SSE Handler (`sse_handler`):** * Sets the correct headers for SSE: `Content-Type: text/event-stream`, `Cache-Control: no-cache`, and `Connection: keep-alive`. These are *required* for SSE to work correctly in browsers. * `web.StreamResponse` is used for streaming data to the client. * `await response.prepare(request)`: Prepares the response for sending. * **Client Tracking:** The `clients` list stores tuples of `(client_id, response)`. This is how the server keeps track of connected clients so it can send them messages later. A `uuid` is used to generate unique client IDs. * **Keep-Alive:** The `async for msg in request.content.iter_any(): pass` loop is *critical*. It keeps the SSE connection alive. Without it, the connection will close after a short time. It reads any incoming data (which we ignore in this example, but you could use it for client-to-server communication if needed). * **Error Handling:** Includes `try...except...finally` blocks to handle client disconnections gracefully (both normal disconnections and disconnections due to errors). The `finally` block ensures that the client is removed from the `clients` list and the response is closed. * **MCP Message Class (`MCPMessage`):** * Encapsulates the structure of an MCP message (type, data, ID). * `to_json()`: Serializes the message to JSON for sending over the network. * `from_json()`: Deserializes a JSON string back into an `MCPMessage` object. Includes basic error handling for invalid JSON. * **Sending Messages (`send_message_to_client`, `broadcast_message`):** * `send_message_to_client` sends a message to a specific client, identified by its `client_id`. * `broadcast_message` sends a message to *all* connected clients. * **SSE Format:** The messages are formatted correctly for SSE: `data: {json_data}\n\n`. The `data:` prefix and the double newline (`\n\n`) are *required* by the SSE protocol. * `await response.write(...)`: Writes the data to the client's response stream. The data must be encoded as UTF-8 bytes. * `await response.drain()`: This is *important* for performance. It ensures that the data is actually sent to the client and doesn't just sit in a buffer. * **MCP Message Handler (`handle_mcp_message`):** * Handles incoming HTTP POST requests to the `/mcp` endpoint. This is where clients send MCP messages to the server. * Parses the JSON data from the request body. * Deserializes the JSON into an `MCPMessage` object using `MCPMessage.from_json()`. * **Message Processing:** Includes example code to process different message types ("ping", "command"). You would replace this with your actual MCP logic. * **Error Handling:** Includes error handling for invalid JSON and other exceptions. * **Response:** Sends a JSON response back to the client indicating the status of the message processing. * **Main Function (`main`):** * Creates an `aiohttp.web.Application`. * Adds routes for the SSE endpoint (`/sse`) and the MCP message endpoint (`/mcp`). * Starts the web server on `localhost:8080`. * Uses `asyncio.Future()` to keep the server running indefinitely. * Includes a `finally` block to clean up resources when the server is stopped. **How to Run:** 1. **Save:** Save the code as a Python file (e.g., `mcp_server.py`). 2. **Install `aiohttp`:** `pip install aiohttp` 3. **Run:** `python mcp_server.py` **Example Client (JavaScript/HTML):** ```html <!DOCTYPE html> <html> <head> <title>MCP Client</title> </head> <body> <h1>MCP Client</h1> <div id="output"></div> <script> const output = document.getElementById('output'); const eventSource = new EventSource('http://localhost:8080/sse'); eventSource.onmessage = (event) => { const message = JSON.parse(event.data); output.innerHTML += `<p>Received: ${JSON.stringify(message)}</p>`; }; eventSource.onerror = (error) => { console.error('SSE error:', error); output.innerHTML += '<p>Error connecting to SSE server.</p>'; }; function sendMessage(message) { fetch('http://localhost:8080/mcp', { method: 'POST', headers: { 'Content-Type': 'application/json' }, body: JSON.stringify(message) }) .then(response => response.json()) .then(data => { output.innerHTML += `<p>Sent: ${JSON.stringify(message)} - Response: ${JSON.stringify(data)}</p>`; }) .catch(error => { console.error('Error sending message:', error); output.innerHTML += `<p>Error sending message: ${error}</p>`; }); } // Example usage: setTimeout(() => { sendMessage({ type: 'ping', data: { value: 'hello' } }); }, 1000); setTimeout(() => { sendMessage({ type: 'command', data: { command: 'do_something' } }); }, 3000); </script> </body> </html> ``` **Explanation of the Client:** 1. **SSE Connection:** `new EventSource('http://localhost:8080/sse')` establishes an SSE connection to the server. 2. **`onmessage` Handler:** This function is called whenever the server sends an SSE message. It parses the JSON data and displays it in the `output` div. 3. **`onerror` Handler:** Handles errors with the SSE connection. 4. **`sendMessage` Function:** Sends an MCP message to the server using an HTTP POST request to the `/mcp` endpoint. 5. **Example Usage:** The `setTimeout` calls demonstrate how to send messages to the server after a delay. **Important Considerations:** * **Security:** This is a *very basic* example and does *not* include any security measures. In a real-world application, you would need to implement authentication, authorization, and input validation to prevent security vulnerabilities. Be especially careful about executing commands received from clients. * **Error Handling:** The error handling in this example is minimal. You should add more robust error handling to catch and handle potential errors gracefully. * **Data Serialization:** JSON is used for data serialization in this example. You could use other formats, such as Protocol Buffers or MessagePack, for better performance or more complex data structures. * **Scalability:** For high-scalability applications, you might need to use a more sophisticated message queue or pub/sub system. * **Client-to-Server Communication:** This example primarily focuses on server-to-client communication (via SSE). If you need more robust client-to-server communication, you might consider using WebSockets instead of SSE. You can send data from the client to the server via the POST endpoint `/mcp`. * **Message IDs:** The use of UUIDs for message IDs allows you to track messages and correlate requests with responses. This is especially useful for asynchronous communication. * **Reconnection:** SSE clients typically handle automatic reconnection if the connection is lost. However, you might want to add explicit reconnection logic to your client code to handle more complex scenarios. This comprehensive example provides a solid foundation for building your own MCP server using Python and SSE. Remember to adapt it to your specific needs and add the necessary security and error handling measures. ```python import asyncio import json import uuid from aiohttp import web # Define a estrutura da mensagem MCP (exemplo) class MCPMessage: def __init__(self, type, data=None, id=None): self.type = type self.data = data self.id = id or str(uuid.uuid4()) # Gera um ID único se nenhum for fornecido def to_json(self): return json.dumps({"type": self.type, "data": self.data, "id": self.id}) @classmethod def from_json(cls, json_string): try: data = json.loads(json_string) return cls(data['type'], data['data'], data['id']) except (json.JSONDecodeError, KeyError) as e: print(f"Erro ao decodificar a mensagem MCP: {e}") return None # Ou levante uma exceção, dependendo do seu tratamento de erro # Lista global para armazenar clientes conectados (streams SSE) clients = [] async def sse_handler(request): """Lida com conexões SSE de clientes.""" response = web.StreamResponse( headers={ 'Content-Type': 'text/event-stream', 'Cache-Control': 'no-cache', 'Connection': 'keep-alive', } ) await response.prepare(request) client_id = str(uuid.uuid4()) # Atribui um ID único ao cliente clients.append((client_id, response)) # Armazena o ID do cliente e o objeto de resposta print(f"Cliente conectado: {client_id}") try: async for msg in request.content.iter_any(): # Mantém a conexão ativa pass # Não faz nada com os dados de entrada, apenas mantém a conexão ativa except asyncio.CancelledError: print(f"Cliente desconectado (cancelado): {client_id}") except Exception as e: print(f"Cliente desconectado (erro): {client_id} - {e}") finally: clients.remove((client_id, response)) await response.close() print(f"Cliente desconectado: {client_id}") return response async def send_message_to_client(client_id, message: MCPMessage): """Envia uma mensagem MCP para um cliente específico.""" for cid, response in clients: if cid == client_id: try: await response.write(f"data: {message.to_json()}\n\n".encode('utf-8')) await response.drain() # Garante que os dados sejam enviados return True except Exception as e: print(f"Erro ao enviar mensagem para o cliente {client_id}: {e}") return False print(f"Cliente {client_id} não encontrado.") return False async def broadcast_message(message: MCPMessage): """Transmite uma mensagem MCP para todos os clientes conectados.""" for cid, response in clients: try: await response.write(f"data: {message.to_json()}\n\n".encode('utf-8')) await response.drain() # Garante que os dados sejam enviados except Exception as e: print(f"Erro ao enviar mensagem para o cliente {cid}: {e}") async def handle_mcp_message(request): """Lida com requisições HTTP POST recebidas contendo mensagens MCP.""" try: data = await request.json() message = MCPMessage.from_json(json.dumps(data)) # Re-serializa para string para from_json if message: print(f"Mensagem MCP recebida: {message.type} - {message.data}") # Exemplo: Processa a mensagem e potencialmente envia uma resposta if message.type == "ping": response_message = MCPMessage("pong", data={"original_id": message.id}) await broadcast_message(response_message) # Ou envia para um cliente específico elif message.type == "command": # Executa um comando (cuidado com a segurança!) print(f"Executando comando: {message.data}") response_message = MCPMessage("command_result", data={"result": "Comando executado"}, id=message.id) await broadcast_message(response_message) else: print(f"Tipo de mensagem desconhecido: {message.type}") response_message = MCPMessage("error", data={"message": "Tipo de mensagem desconhecido"}, id=message.id) await broadcast_message(response_message) return web.json_response({"status": "ok", "message_id": message.id}) else: return web.json_response({"status": "error", "message": "Mensagem MCP inválida"}, status=400) except json.JSONDecodeError: return web.json_response({"status": "error", "message": "JSON inválido"}, status=400) except Exception as e: print(f"Erro ao lidar com a mensagem MCP: {e}") return web.json_response({"status": "error", "message": str(e)}, status=500) async def main(): app = web.Application() app.add_routes([ web.get('/sse', sse_handler), web.post('/mcp', handle_mcp_message), ]) runner = web.AppRunner(app) await runner.setup() site = web.TCPSite(runner, 'localhost', 8080) await site.start() print("Servidor iniciado em http://localhost:8080") try: await asyncio.Future() # Executa para sempre finally: await runner.cleanup() if __name__ == "__main__": asyncio.run(main()) ``` **Tradução das explicações:** * **Dependências:** Usa `aiohttp` para tratamento web assíncrono, o que é crucial para SSE. Instale com `pip install aiohttp`. * **Assíncrono:** O código é totalmente assíncrono usando `async` e `await`, tornando-o não bloqueante e capaz de lidar com múltiplos clientes concorrentemente. Isso é *essencial* para um servidor SSE. * **Handler SSE (`sse_handler`):** * Define os cabeçalhos corretos para SSE: `Content-Type: text/event-stream`, `Cache-Control: no-cache` e `Connection: keep-alive`. Estes são *obrigatórios* para que o SSE funcione corretamente nos navegadores. * `web.StreamResponse` é usado para transmitir dados para o cliente. * `await response.prepare(request)`: Prepara a resposta para envio. * **Rastreamento de Cliente:** A lista `clients` armazena tuplas de `(client_id, response)`. É assim que o servidor rastreia os clientes conectados para que possa enviar mensagens posteriormente. Um `uuid` é usado para gerar IDs de cliente exclusivos. * **Keep-Alive:** O loop `async for msg in request.content.iter_any(): pass` é *crítico*. Ele mantém a conexão SSE ativa. Sem ele, a conexão será fechada após um curto período. Ele lê todos os dados de entrada (que ignoramos neste exemplo, mas você pode usá-lo para comunicação cliente-servidor, se necessário). * **Tratamento de Erros:** Inclui blocos `try...except...finally` para lidar com desconexões de clientes de forma elegante (tanto desconexões normais quanto desconexões devido a erros). O bloco `finally` garante que o cliente seja removido da lista `clients` e que a resposta seja fechada. * **Classe de Mensagem MCP (`MCPMessage`):** * Encapsula a estrutura de uma mensagem MCP (tipo, dados, ID). * `to_json()`: Serializa a mensagem para JSON para envio pela rede. * `from_json()`: Desserializa uma string JSON de volta para um objeto `MCPMessage`. Inclui tratamento de erros básico para JSON inválido. * **Enviando Mensagens (`send_message_to_client`, `broadcast_message`):** * `send_message_to_client` envia uma mensagem para um cliente específico, identificado pelo seu `client_id`. * `broadcast_message` envia uma mensagem para *todos* os clientes conectados. * **Formato SSE:** As mensagens são formatadas corretamente para SSE: `data: {json_data}\n\n`. O prefixo `data:` e a nova linha dupla (`\n\n`) são *obrigatórios* pelo protocolo SSE. * `await response.write(...)`: Escreve os dados no fluxo de resposta do cliente. Os dados devem ser codificados como bytes UTF-8. * `await response.drain()`: Isso é *importante* para o desempenho. Garante que os dados sejam realmente enviados para o cliente e não fiquem apenas em um buffer. * **Handler de Mensagem MCP (`handle_mcp_message`):** * Lida com requisições HTTP POST recebidas no endpoint `/mcp`. É aqui que os clientes enviam mensagens MCP para o servidor. * Analisa os dados JSON do corpo da requisição. * Desserializa o JSON em um objeto `MCPMessage` usando `MCPMessage.from_json()`. * **Processamento de Mensagens:** Inclui código de exemplo para processar diferentes tipos de mensagens ("ping", "command"). Você substituiria isso pela sua lógica MCP real. * **Tratamento de Erros:** Inclui tratamento de erros para JSON inválido e outras exceções. * **Resposta:** Envia uma resposta JSON de volta para o cliente indicando o status do processamento da mensagem. * **Função Principal (`main`):** * Cria um `aiohttp.web.Application`. * Adiciona rotas para o endpoint SSE (`/sse`) e o endpoint de mensagem MCP (`/mcp`). * Inicia o servidor web em `localhost:8080`. * Usa `asyncio.Future()` para manter o servidor em execução indefinidamente. * Inclui um bloco `finally` para limpar os recursos quando o servidor é interrompido. **Como Executar:** 1. **Salvar:** Salve o código como um arquivo Python (por exemplo, `mcp_server.py`). 2. **Instalar `aiohttp`:** `pip install aiohttp` 3. **Executar:** `python mcp_server.py` **Exemplo de Cliente (JavaScript/HTML):** (O código do cliente JavaScript/HTML permanece o mesmo, pois não precisa de tradução.) **Considerações Importantes:** * **Segurança:** Este é um exemplo *muito básico* e *não* inclui nenhuma medida de segurança. Em uma aplicação do mundo real, você precisaria implementar autenticação, autorização e validação de entrada para evitar vulnerabilidades de segurança. Seja especialmente cuidadoso ao executar comandos recebidos de clientes. * **Tratamento de Erros:** O tratamento de erros neste exemplo é mínimo. Você deve adicionar um tratamento de erros mais robusto para capturar e lidar com possíveis erros de forma elegante. * **Serialização de Dados:** JSON é usado para serialização de dados neste exemplo. Você pode usar outros formatos, como Protocol Buffers ou MessagePack, para melhor desempenho ou estruturas de dados mais complexas. * **Escalabilidade:** Para aplicações de alta escalabilidade, você pode precisar usar uma fila de mensagens ou um sistema pub/sub mais sofisticado. * **Comunicação Cliente-Servidor:** Este exemplo se concentra principalmente na comunicação servidor-cliente (via SSE). Se você precisar de uma comunicação cliente-servidor mais robusta, você pode considerar usar WebSockets em vez de SSE. Você pode enviar dados do cliente para o servidor através do endpoint POST `/mcp`. * **IDs de Mensagem:** O uso de UUIDs para IDs de mensagem permite rastrear mensagens e correlacionar requisições com respostas. Isso é especialmente útil para comunicação assíncrona. * **Reconexão:** Clientes SSE normalmente lidam com a reconexão automática se a conexão for perdida. No entanto, você pode querer adicionar lógica de reconexão explícita ao seu código de cliente para lidar com cenários mais complexos. Este exemplo abrangente fornece uma base sólida para construir seu próprio servidor MCP usando Python e SSE. Lembre-se de adaptá-lo às suas necessidades específicas e adicionar as medidas de segurança e tratamento de erros necessárias.
Live Marketing Data MCP
Connect AI assistants to live Meta Ads, GA4, and Google Search Console data. 100% local, credentials machine-locked and encrypted. Supports Claude Desktop, Cursor, Windsurf, Cline, and more.
ExpoSnap
Enables AI assistants to view and analyze screenshots from React Native/Expo applications for AI-powered mobile UI development. Integrates with Claude, Cursor, VS Code and other MCP-compatible editors.