Discover Awesome MCP Servers

Extend your agent with 14,392 capabilities via MCP servers.

All14,392
spotify_mcp_server_claude

spotify_mcp_server_claude

a custom mcp server built using mcp framework

MCP Custom Servers Collection

MCP Custom Servers Collection

Collection of custom MCP servers for multiple installations

GitHub MCP Server for Cursor IDE

GitHub MCP Server for Cursor IDE

GitHub MCP server for Cursor IDE

MCP-Forge

MCP-Forge

Uma ferramenta de scaffolding útil para servidores MCP (Minecraft Coder Pack).

Effect CLI - Model Context Protocol

Effect CLI - Model Context Protocol

MCP Servers, exposed as a CLI tool

Weather MCP Server

Weather MCP Server

Um servidor de Protocolo de Contexto de Modelo (MCP) que fornece dados de previsão do tempo da API de Clima do Governo do Canadá. Obtenha previsões precisas de 5 dias para qualquer local no Canadá por latitude e longitude. Integra-se facilmente com o Claude Desktop e outros clientes compatíveis com MCP.

SQLGenius - AI-Powered SQL Assistant

SQLGenius - AI-Powered SQL Assistant

SQLGenius é um assistente SQL alimentado por IA que converte linguagem natural em consultas SQL usando o Gemini Pro do Vertex AI. Construído com MCP e Streamlit, ele fornece uma interface intuitiva para exploração de dados do BigQuery com visualização em tempo real e gerenciamento de esquema.

Structured Thinking

Structured Thinking

Um servidor MCP unificado para ferramentas de pensamento estruturado, incluindo pensamento baseado em modelos e pensamento de verificação.

Thirdweb Mcp

Thirdweb Mcp

mcp-server-wechat

mcp-server-wechat

实现pc端微信的mcp服务功能

Weather MCP Server

Weather MCP Server

```python import socket import json import random import time # Configuration HOST = '127.0.0.1' # Standard loopback interface address (localhost) PORT = 65432 # Port to listen on (non-privileged ports are > 1023) UPDATE_INTERVAL = 5 # Seconds between weather updates def generate_weather_data(): """Generates random weather data.""" temperature = round(random.uniform(10, 35), 1) # Temperature in Celsius humidity = random.randint(40, 90) # Humidity percentage wind_speed = random.randint(5, 25) # Wind speed in km/h conditions = random.choice(['Sunny', 'Cloudy', 'Rainy', 'Windy']) weather_data = { 'temperature': temperature, 'humidity': humidity, 'wind_speed': wind_speed, 'conditions': conditions } return weather_data def main(): """Main function to run the weather server.""" with socket.socket(socket.AF_INET, socket.SOCK_STREAM) as s: s.bind((HOST, PORT)) s.listen() print(f"Weather server listening on {HOST}:{PORT}") conn, addr = s.accept() with conn: print(f"Connected by {addr}") while True: weather_data = generate_weather_data() weather_json = json.dumps(weather_data) try: conn.sendall(weather_json.encode('utf-8')) print(f"Sent weather data: {weather_json}") except BrokenPipeError: print("Client disconnected.") break # Exit the loop if the client disconnects time.sleep(UPDATE_INTERVAL) if __name__ == "__main__": main() ``` **Explanation:** 1. **Imports:** - `socket`: For network communication (creating a server). - `json`: For encoding Python dictionaries into JSON strings (for sending data). - `random`: For generating random weather data. - `time`: For pausing execution between weather updates. 2. **Configuration:** - `HOST`: The IP address the server will listen on. `'127.0.0.1'` is the loopback address (localhost), meaning the server will only be accessible from the same machine it's running on. - `PORT`: The port number the server will listen on. Choose a port number greater than 1023 to avoid needing special permissions. - `UPDATE_INTERVAL`: How often (in seconds) the server will generate and send new weather data. 3. **`generate_weather_data()` function:** - Creates a dictionary containing random weather information: - `temperature`: A random floating-point number between 10 and 35 (Celsius). - `humidity`: A random integer between 40 and 90 (percentage). - `wind_speed`: A random integer between 5 and 25 (km/h). - `conditions`: A random choice from a list of weather conditions. - Returns the dictionary. 4. **`main()` function:** - **Socket Creation:** - `with socket.socket(socket.AF_INET, socket.SOCK_STREAM) as s:`: Creates a socket object. - `socket.AF_INET`: Specifies the IPv4 address family. - `socket.SOCK_STREAM`: Specifies a TCP socket (for reliable, connection-oriented communication). The `with` statement ensures the socket is properly closed when the block is finished. - **Binding:** - `s.bind((HOST, PORT))`: Associates the socket with the specified IP address and port. This tells the operating system that this server will listen for connections on that address and port. - **Listening:** - `s.listen()`: Puts the socket into listening mode, waiting for incoming connections. - **Accepting Connections:** - `conn, addr = s.accept()`: Accepts an incoming connection. This blocks until a client connects. - `conn`: A new socket object representing the connection to the client. You'll use this socket to send and receive data with the client. - `addr`: The address of the client (IP address and port). - **Communication Loop:** - `with conn:`: Ensures the client socket is closed when the loop finishes. - `while True:`: An infinite loop that continuously generates and sends weather data. - `weather_data = generate_weather_data()`: Generates new weather data. - `weather_json = json.dumps(weather_data)`: Converts the Python dictionary to a JSON string. - `conn.sendall(weather_json.encode('utf-8'))`: Sends the JSON string to the client. - `.encode('utf-8')`: Encodes the string into bytes using UTF-8 encoding (a common and widely compatible encoding). Sockets send and receive bytes, not strings. - `print(f"Sent weather data: {weather_json}")`: Prints the sent data to the console (for debugging). - `time.sleep(UPDATE_INTERVAL)`: Pauses execution for `UPDATE_INTERVAL` seconds before sending the next update. - **Error Handling:** The `try...except BrokenPipeError` block handles the case where the client disconnects unexpectedly. If the client disconnects, `conn.sendall()` will raise a `BrokenPipeError`. The `except` block catches this error, prints a message, and breaks out of the `while` loop, effectively stopping the server's attempt to send data to the disconnected client. - **`if __name__ == "__main__":`:** - This is a standard Python idiom. It ensures that the `main()` function is only called when the script is run directly (not when it's imported as a module into another script). **How to Run:** 1. **Save:** Save the code as a Python file (e.g., `weather_server.py`). 2. **Run:** Open a terminal or command prompt and run the script: `python weather_server.py` 3. **Client:** You'll need a client program to connect to this server and receive the weather data. A simple client example (in Python) is provided below. **Example Client (Python):** ```python import socket import json HOST = '127.0.0.1' # The server's hostname or IP address PORT = 65432 # The port used by the server with socket.socket(socket.AF_INET, socket.SOCK_STREAM) as s: s.connect((HOST, PORT)) while True: try: data = s.recv(1024) # Receive up to 1024 bytes of data if not data: break # Server disconnected weather_json = data.decode('utf-8') weather_data = json.loads(weather_json) print(f"Received weather data: {weather_data}") except ConnectionResetError: print("Server disconnected.") break ``` **Client Explanation:** 1. **Imports:** `socket` and `json` (same as the server). 2. **Configuration:** `HOST` and `PORT` must match the server's configuration. 3. **Socket Creation and Connection:** - `s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)`: Creates a TCP socket. - `s.connect((HOST, PORT))`: Connects to the server at the specified address and port. 4. **Receiving Data:** - `while True:`: An infinite loop to continuously receive data. - `data = s.recv(1024)`: Receives up to 1024 bytes of data from the server. This blocks until data is received. - `if not data:`: Checks if `recv()` returned an empty byte string (`b''`). This indicates that the server has closed the connection. - `weather_json = data.decode('utf-8')`: Decodes the received bytes into a string using UTF-8. - `weather_data = json.loads(weather_json)`: Parses the JSON string into a Python dictionary. - `print(f"Received weather data: {weather_data}")`: Prints the received weather data. - **Error Handling:** The `try...except ConnectionResetError` block handles the case where the server disconnects unexpectedly. If the server disconnects, `s.recv()` will raise a `ConnectionResetError`. The `except` block catches this error, prints a message, and breaks out of the `while` loop. **To run the client:** 1. Save the client code as a Python file (e.g., `weather_client.py`). 2. Open a separate terminal or command prompt. 3. Run the client: `python weather_client.py` **Important Considerations:** * **Error Handling:** The server and client examples include basic error handling (checking for disconnections). In a real-world application, you'd want to add more robust error handling to deal with various network issues. * **Data Format:** JSON is a good choice for sending structured data over a network because it's human-readable and easy to parse. * **Threading/Asynchronous Programming:** For a more scalable server, consider using threads or asynchronous programming (e.g., `asyncio`) to handle multiple client connections concurrently. The simple example above only handles one client at a time. * **Security:** For production environments, consider security measures like encryption (e.g., using SSL/TLS) to protect the data being transmitted. * **MCP (Minecraft Protocol):** This example *simulates* a server. To actually integrate with Minecraft, you would need to implement the Minecraft protocol, which is significantly more complex. Libraries like `mcpi` (for Raspberry Pi) or `python-minecraft-protocol` can help with this, but they are beyond the scope of a simple example. This example provides the *data* that a Minecraft mod or plugin might use. **Portuguese Translation of the Explanation:** ``` Um exemplo de servidor MCP de clima em Python ```python import socket import json import random import time # Configuração HOST = '127.0.0.1' # Endereço de interface de loopback padrão (localhost) PORT = 65432 # Porta para escutar (portas não privilegiadas são > 1023) UPDATE_INTERVAL = 5 # Segundos entre as atualizações do clima def generate_weather_data(): """Gera dados climáticos aleatórios.""" temperature = round(random.uniform(10, 35), 1) # Temperatura em Celsius humidity = random.randint(40, 90) # Porcentagem de umidade wind_speed = random.randint(5, 25) # Velocidade do vento em km/h conditions = random.choice(['Sunny', 'Cloudy', 'Rainy', 'Windy']) weather_data = { 'temperature': temperature, 'humidity': humidity, 'wind_speed': wind_speed, 'conditions': conditions } return weather_data def main(): """Função principal para executar o servidor de clima.""" with socket.socket(socket.AF_INET, socket.SOCK_STREAM) as s: s.bind((HOST, PORT)) s.listen() print(f"Servidor de clima escutando em {HOST}:{PORT}") conn, addr = s.accept() with conn: print(f"Conectado por {addr}") while True: weather_data = generate_weather_data() weather_json = json.dumps(weather_data) try: conn.sendall(weather_json.encode('utf-8')) print(f"Dados climáticos enviados: {weather_json}") except BrokenPipeError: print("Cliente desconectado.") break # Sai do loop se o cliente desconectar time.sleep(UPDATE_INTERVAL) if __name__ == "__main__": main() ``` **Explicação:** 1. **Imports:** - `socket`: Para comunicação de rede (criação de um servidor). - `json`: Para codificar dicionários Python em strings JSON (para enviar dados). - `random`: Para gerar dados climáticos aleatórios. - `time`: Para pausar a execução entre as atualizações do clima. 2. **Configuração:** - `HOST`: O endereço IP que o servidor irá escutar. `'127.0.0.1'` é o endereço de loopback (localhost), o que significa que o servidor só estará acessível a partir da mesma máquina em que está sendo executado. - `PORT`: O número da porta que o servidor irá escutar. Escolha um número de porta maior que 1023 para evitar a necessidade de permissões especiais. - `UPDATE_INTERVAL`: Com que frequência (em segundos) o servidor irá gerar e enviar novos dados climáticos. 3. **Função `generate_weather_data()`:** - Cria um dicionário contendo informações climáticas aleatórias: - `temperature`: Um número de ponto flutuante aleatório entre 10 e 35 (Celsius). - `humidity`: Um inteiro aleatório entre 40 e 90 (porcentagem). - `wind_speed`: Um inteiro aleatório entre 5 e 25 (km/h). - `conditions`: Uma escolha aleatória de uma lista de condições climáticas. - Retorna o dicionário. 4. **Função `main()`:** - **Criação do Socket:** - `with socket.socket(socket.AF_INET, socket.SOCK_STREAM) as s:`: Cria um objeto socket. - `socket.AF_INET`: Especifica a família de endereços IPv4. - `socket.SOCK_STREAM`: Especifica um socket TCP (para comunicação confiável e orientada à conexão). A instrução `with` garante que o socket seja fechado corretamente quando o bloco terminar. - **Vinculação (Binding):** - `s.bind((HOST, PORT))`: Associa o socket ao endereço IP e à porta especificados. Isso informa ao sistema operacional que este servidor irá escutar conexões nesse endereço e porta. - **Escuta (Listening):** - `s.listen()`: Coloca o socket no modo de escuta, aguardando conexões de entrada. - **Aceitação de Conexões:** - `conn, addr = s.accept()`: Aceita uma conexão de entrada. Isso bloqueia até que um cliente se conecte. - `conn`: Um novo objeto socket representando a conexão com o cliente. Você usará este socket para enviar e receber dados com o cliente. - `addr`: O endereço do cliente (endereço IP e porta). - **Loop de Comunicação:** - `with conn:`: Garante que o socket do cliente seja fechado quando o loop terminar. - `while True:`: Um loop infinito que continuamente gera e envia dados climáticos. - `weather_data = generate_weather_data()`: Gera novos dados climáticos. - `weather_json = json.dumps(weather_data)`: Converte o dicionário Python em uma string JSON. - `conn.sendall(weather_json.encode('utf-8'))`: Envia a string JSON para o cliente. - `.encode('utf-8')`: Codifica a string em bytes usando a codificação UTF-8 (uma codificação comum e amplamente compatível). Sockets enviam e recebem bytes, não strings. - `print(f"Dados climáticos enviados: {weather_json}")`: Imprime os dados enviados no console (para depuração). - `time.sleep(UPDATE_INTERVAL)`: Pausa a execução por `UPDATE_INTERVAL` segundos antes de enviar a próxima atualização. - **Tratamento de Erros:** O bloco `try...except BrokenPipeError` lida com o caso em que o cliente se desconecta inesperadamente. Se o cliente se desconectar, `conn.sendall()` lançará um `BrokenPipeError`. O bloco `except` captura esse erro, imprime uma mensagem e sai do loop `while`, efetivamente interrompendo a tentativa do servidor de enviar dados para o cliente desconectado. - **`if __name__ == "__main__":`:** - Este é um idioma Python padrão. Ele garante que a função `main()` seja chamada apenas quando o script for executado diretamente (não quando for importado como um módulo em outro script). **Como Executar:** 1. **Salvar:** Salve o código como um arquivo Python (por exemplo, `weather_server.py`). 2. **Executar:** Abra um terminal ou prompt de comando e execute o script: `python weather_server.py` 3. **Cliente:** Você precisará de um programa cliente para se conectar a este servidor e receber os dados climáticos. Um exemplo de cliente simples (em Python) é fornecido abaixo. **Exemplo de Cliente (Python):** ```python import socket import json HOST = '127.0.0.1' # O nome do host ou endereço IP do servidor PORT = 65432 # A porta usada pelo servidor with socket.socket(socket.AF_INET, socket.SOCK_STREAM) as s: s.connect((HOST, PORT)) while True: try: data = s.recv(1024) # Recebe até 1024 bytes de dados if not data: break # Servidor desconectado weather_json = data.decode('utf-8') weather_data = json.loads(weather_json) print(f"Dados climáticos recebidos: {weather_data}") except ConnectionResetError: print("Servidor desconectado.") break ``` **Explicação do Cliente:** 1. **Imports:** `socket` e `json` (o mesmo que o servidor). 2. **Configuração:** `HOST` e `PORT` devem corresponder à configuração do servidor. 3. **Criação e Conexão do Socket:** - `s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)`: Cria um socket TCP. - `s.connect((HOST, PORT))`: Conecta-se ao servidor no endereço e porta especificados. 4. **Recebimento de Dados:** - `while True:`: Um loop infinito para receber dados continuamente. - `data = s.recv(1024)`: Recebe até 1024 bytes de dados do servidor. Isso bloqueia até que os dados sejam recebidos. - `if not data:`: Verifica se `recv()` retornou uma string de bytes vazia (`b''`). Isso indica que o servidor fechou a conexão. - `weather_json = data.decode('utf-8')`: Decodifica os bytes recebidos em uma string usando UTF-8. - `weather_data = json.loads(weather_json)`: Analisa a string JSON em um dicionário Python. - `print(f"Dados climáticos recebidos: {weather_data}")`: Imprime os dados climáticos recebidos. - **Tratamento de Erros:** O bloco `try...except ConnectionResetError` lida com o caso em que o servidor se desconecta inesperadamente. Se o servidor se desconectar, `s.recv()` lançará um `ConnectionResetError`. O bloco `except` captura esse erro, imprime uma mensagem e sai do loop `while`. **Para executar o cliente:** 1. Salve o código do cliente como um arquivo Python (por exemplo, `weather_client.py`). 2. Abra um terminal ou prompt de comando separado. 3. Execute o cliente: `python weather_client.py` **Considerações Importantes:** * **Tratamento de Erros:** Os exemplos de servidor e cliente incluem tratamento de erros básico (verificação de desconexões). Em uma aplicação do mundo real, você gostaria de adicionar um tratamento de erros mais robusto para lidar com vários problemas de rede. * **Formato de Dados:** JSON é uma boa escolha para enviar dados estruturados por uma rede porque é legível por humanos e fácil de analisar. * **Threading/Programação Assíncrona:** Para um servidor mais escalável, considere usar threads ou programação assíncrona (por exemplo, `asyncio`) para lidar com várias conexões de cliente simultaneamente. O exemplo simples acima lida apenas com um cliente por vez. * **Segurança:** Para ambientes de produção, considere medidas de segurança como criptografia (por exemplo, usando SSL/TLS) para proteger os dados que estão sendo transmitidos. * **MCP (Minecraft Protocol):** Este exemplo *simula* um servidor. Para realmente integrar com o Minecraft, você precisaria implementar o protocolo Minecraft, que é significativamente mais complexo. Bibliotecas como `mcpi` (para Raspberry Pi) ou `python-minecraft-protocol` podem ajudar com isso, mas estão além do escopo de um exemplo simples. Este exemplo fornece os *dados* que um mod ou plugin do Minecraft pode usar. ``` This provides a complete, runnable example with both server and client code, along with detailed explanations and considerations for real-world use. The Portuguese translation is also included. Remember to run the server *before* running the client.

Configurable Puppeteer MCP Server

Configurable Puppeteer MCP Server

Um servidor de Protocolo de Contexto de Modelo que fornece capacidades de automação de navegador usando Puppeteer com opções configuráveis através de variáveis de ambiente, permitindo que LLMs interajam com páginas web, capturem screenshots e executem JavaScript em um ambiente de navegador.

Time-MCP

Time-MCP

Servidor MCP para a hora e data.

Google Search Console MCP Server

Google Search Console MCP Server

MCP Server from Scratch using Python

MCP Server from Scratch using Python

🖥️ Shell MCP Server

🖥️ Shell MCP Server

Mirror of

Vite MCP Server

Vite MCP Server

CyberSecMCP

CyberSecMCP

Secure Messages Control Plane (MCP) Server - A robust platform for managing communication between AI agents

holaspirit-mcp-server

holaspirit-mcp-server

Mirror of

Google Search MCP Server

Google Search MCP Server

Espelho de

X MCP Server

X MCP Server

This is an MCP server for the X Platform

Armor Mcp

Armor Mcp

Servidor MCP para interagir com Blockchain, Swaps, Planejamento Estratégico e muito mais.

mcp-server-taiwan-aqi

mcp-server-taiwan-aqi

Obtenha os dados atuais e das últimas 24 horas das estações de monitoramento da qualidade do ar de Taiwan (R.O.C.).

Harvester MCP Server

Harvester MCP Server

Model Context Protocol (MCP) server for Harvester HCI

Telegram-bot-rcon-for-mcpe-servers

Telegram-bot-rcon-for-mcpe-servers

Control Minecraft remotely using the RCON Telegram bot

ClickUp MCP Server

ClickUp MCP Server

Espelho de

Linear MCP Server

Linear MCP Server

a private MCP server for accessing Linear

MCP Adobe Experience Platform Server

MCP Adobe Experience Platform Server

Servidor MCP para integração de APIs do Adobe Experience Platform

Welcome MCP Server

Welcome MCP Server

A server repository created using MCP

MCP Postgres Server

MCP Postgres Server

Espelho de