Discover Awesome MCP Servers

Extend your agent with 25,254 capabilities via MCP servers.

All25,254
Telegram MCP Server

Telegram MCP Server

MCP server to send notifications to Telegram

mcp-cbs-cijfers-open-data

mcp-cbs-cijfers-open-data

Máy chủ MCP để làm việc với Dữ liệu Mở CBS Cijfers

testmcpgithubdemo1

testmcpgithubdemo1

created from MCP server demo

MCP Server Docker

MCP Server Docker

Máy chủ MCP cho Docker

create-mcp-server

create-mcp-server

A comprehensive architecture for building robust Model Context Protocol (MCP) servers with integrated web capabilities

Weather MCP Server

Weather MCP Server

Flights Mcp Server

Flights Mcp Server

MCP Server for Google Flights !!

gatherings MCP Server

gatherings MCP Server

Một máy chủ giao thức ngữ cảnh mô hình (Model Context Protocol server) giúp theo dõi chi phí và tính toán hoàn trả cho các sự kiện xã hội, giúp dễ dàng thanh toán số dư giữa bạn bè.

Choose MCP Server Setup

Choose MCP Server Setup

Gương của

mcp-server-testWhat is MCP Server Test?How to use MCP Server Test?Key features of MCP Server Test?Use cases of MCP Server Test?FAQ from MCP Server Test?

mcp-server-testWhat is MCP Server Test?How to use MCP Server Test?Key features of MCP Server Test?Use cases of MCP Server Test?FAQ from MCP Server Test?

Test MCP Server

Server

Server

Okay, here's a basic outline and code snippets to get you started with a simple "Weather MCP" (assuming you mean a Minecraft Protocol server that provides weather information) in Python. Keep in mind that a *full* implementation is quite complex and requires deep understanding of the Minecraft protocol. This example focuses on the core concepts. **Disclaimer:** This is a simplified example. A real Minecraft server needs to handle much more, including player authentication, world generation, chunk loading, entity management, and a lot more protocol details. This is just a starting point to illustrate the weather aspect. **Conceptual Outline** 1. **Minecraft Protocol Basics:** * Minecraft uses a custom TCP-based protocol. You'll need to understand how to send and receive packets in the correct format. The protocol has evolved over different Minecraft versions, so you'll need to target a specific version. * The protocol involves handshaking, status requests, login, and then gameplay packets. * We'll focus on sending the relevant weather-related packets. 2. **Networking:** * Use Python's `socket` module to listen for incoming connections from Minecraft clients. * Handle each client connection in a separate thread or using asynchronous programming (e.g., `asyncio`). 3. **Weather Data:** * For simplicity, we'll simulate weather. In a real application, you might fetch weather data from an external API. 4. **Packet Construction:** * You'll need to construct Minecraft packets according to the protocol specification. This involves packing data (integers, strings, etc.) into byte arrays in the correct order and format. **Simplified Code Example (Python)** ```python import socket import struct import threading import time # Configuration HOST = '0.0.0.0' # Listen on all interfaces PORT = 25565 # Default Minecraft port PROTOCOL_VERSION = 763 # Example: Minecraft 1.16.5 SERVER_VERSION_NAME = "WeatherMCP-0.1" MAX_PLAYERS = 10 # --- Minecraft Protocol Helper Functions --- def pack_varint(data): """Packs an integer into a Minecraft-style VarInt.""" out = bytearray() while True: byte = data & 0x7F data >>= 7 if data != 0: byte |= 0x80 out.append(byte) if data == 0: break return bytes(out) def pack_string(data): """Packs a string into a Minecraft-style string (VarInt length + UTF-8 encoded string).""" encoded = data.encode('utf-8') length = len(encoded) return pack_varint(length) + encoded def create_packet(packet_id, data): """Creates a Minecraft packet with a VarInt packet ID and data.""" packet_id_bytes = pack_varint(packet_id) packet_data = packet_id_bytes + data packet_length = pack_varint(len(packet_data)) return packet_length + packet_data # --- Weather Simulation --- is_raining = False rain_level = 0.0 # 0.0 = no rain, 1.0 = heavy rain thunder_level = 0.0 # 0.0 = no thunder, 1.0 = heavy thunder is_thundering = False def update_weather(): """Simulates weather changes.""" global is_raining, rain_level, thunder_level, is_thundering import random while True: # Simulate a chance of rain starting or stopping if random.random() < 0.01: # 1% chance per second is_raining = not is_raining if is_raining: print("It started raining!") rain_level = 0.1 # Start with light rain else: print("It stopped raining!") rain_level = 0.0 # Simulate rain intensity changes if is_raining: rain_level = min(1.0, rain_level + random.uniform(0.001, 0.005)) # Increase rain else: rain_level = max(0.0, rain_level - random.uniform(0.001, 0.005)) # Decrease rain # Simulate thunder (similar to rain) if random.random() < 0.005: is_thundering = not is_thundering if is_thundering: print("Thunder started!") thunder_level = 0.1 else: print("Thunder stopped!") thunder_level = 0.0 if is_thundering: thunder_level = min(1.0, thunder_level + random.uniform(0.001, 0.005)) else: thunder_level = max(0.0, thunder_level - random.uniform(0.001, 0.005)) time.sleep(1) # Check every second # --- Packet Sending Functions --- def send_time_update(client_socket, world_age, time_of_day): """Sends a Time Update packet (ID 0x4E for 1.16.5).""" packet_id = 0x4E # Time Update packet ID data = struct.pack("!qq", world_age, time_of_day) # Long Long packet = create_packet(packet_id, data) try: client_socket.sendall(packet) except Exception as e: print(f"Error sending time update: {e}") def send_change_game_state(client_socket, reason, value): """Sends a Change Game State packet (ID 0x1F for 1.16.5).""" packet_id = 0x1F data = struct.pack("!bq", reason, value) # Byte Float packet = create_packet(packet_id, data) try: client_socket.sendall(packet) except Exception as e: print(f"Error sending change game state: {e}") def send_login_success(client_socket, uuid, username): """Sends a Login Success packet (ID 0x26 for 1.16.5).""" packet_id = 0x26 uuid_bytes = uuid.encode('utf-8') username_bytes = username.encode('utf-8') data = pack_string(uuid) + pack_string(username) packet = create_packet(packet_id, data) try: client_socket.sendall(packet) except Exception as e: print(f"Error sending login success: {e}") def send_join_game(client_socket): """Sends a Join Game packet (ID 0x25 for 1.16.5).""" packet_id = 0x25 entity_id = 0 gamemode = 1 # Creative dimension = 0 # Overworld hashed_seed = 0 max_players = 20 level_type = "default" view_distance = 32 reduced_debug_info = False enable_respawn_screen = True is_debug = False is_flat = False data = struct.pack("!ibbqql", entity_id, gamemode, dimension, hashed_seed, max_players, view_distance) data += pack_string(level_type) data += struct.pack("!??", reduced_debug_info, enable_respawn_screen) packet = create_packet(packet_id, data) try: client_socket.sendall(packet) except Exception as e: print(f"Error sending join game: {e}") def send_player_position_and_look(client_socket): """Sends a Player Position and Look packet (ID 0x34 for 1.16.5).""" packet_id = 0x34 x = 0.0 y = 64.0 z = 0.0 yaw = 0.0 pitch = 0.0 flags = 0x00 teleport_id = 0 data = struct.pack("!ddddbff", x, y, z, yaw, pitch, flags, teleport_id) packet = create_packet(packet_id, data) try: client_socket.sendall(packet) except Exception as e: print(f"Error sending player position and look: {e}") def send_world_border(client_socket): """Sends a World Border packet (ID 0x41 for 1.16.5).""" packet_id = 0x41 action = 3 # Initialize border_diameter = 60000000.0 new_border_diameter = 60000000.0 speed = 0 x = 0.0 z = 0.0 warning_time = 0 warning_blocks = 0 data = struct.pack("!iqqdqql", action, border_diameter, new_border_diameter, speed, x, z, warning_time, warning_blocks) packet = create_packet(packet_id, data) try: client_socket.sendall(packet) except Exception as e: print(f"Error sending world border: {e}") def send_server_list_response(client_socket): """Sends a Server List Response packet (ID 0x00).""" packet_id = 0x00 description = { "version": { "name": SERVER_VERSION_NAME, "protocol": PROTOCOL_VERSION }, "players": { "max": MAX_PLAYERS, "online": 0 }, "description": { "text": "Weather MCP Server" } } import json json_data = json.dumps(description, separators=(',', ':')) data = pack_string(json_data) packet = create_packet(packet_id, data) try: client_socket.sendall(packet) except Exception as e: print(f"Error sending server list response: {e}") def send_set_slot(client_socket): """Sends a Set Slot packet (ID 0x16 for 1.16.5).""" packet_id = 0x16 window_id = 0 slot = 36 item_id = 276 # Diamond Sword item_count = 1 nbt_data = b'\x0a\x00\x04Name\x08\x00\x00\x00\x0bWeather Sword\x00' data = struct.pack("!bh", window_id, slot) data += pack_varint(item_id) data += struct.pack("!b", item_count) data += nbt_data packet = create_packet(packet_id, data) try: client_socket.sendall(packet) except Exception as e: print(f"Error sending set slot: {e}") def send_entity_equipment(client_socket): """Sends an Entity Equipment packet (ID 0x47 for 1.16.5).""" packet_id = 0x47 entity_id = 0 slot = 0 # Main Hand item_id = 276 # Diamond Sword item_count = 1 nbt_data = b'\x0a\x00\x04Name\x08\x00\x00\x00\x0bWeather Sword\x00' data = pack_varint(entity_id) data += struct.pack("!b", slot) data += pack_varint(item_id) data += struct.pack("!b", item_count) data += nbt_data data += b'\xff' # End of equipment list packet = create_packet(packet_id, data) try: client_socket.sendall(packet) except Exception as e: print(f"Error sending entity equipment: {e}") def send_update_weather(client_socket, entity_id, type, value): """Sends an Update Weather packet (ID 0x08 for 1.16.5).""" packet_id = 0x08 data = struct.pack("!ibf", entity_id, type, value) packet = create_packet(packet_id, data) try: client_socket.sendall(packet) except Exception as e: print(f"Error sending update weather: {e}") # --- Client Handling --- def handle_client(client_socket, client_address): """Handles a single client connection.""" print(f"Accepted connection from {client_address}") try: # --- Handshaking --- packet_length_bytes = client_socket.recv(1) packet_length = struct.unpack("!b", packet_length_bytes)[0] packet_data = client_socket.recv(packet_length) packet_id = struct.unpack("!b", packet_data[:1])[0] if packet_id == 0x00: protocol_version, server_address_length = struct.unpack("!bi", packet_data[1:6]) server_address = client_socket.recv(server_address_length) server_port, next_state = struct.unpack("!hi", packet_data[6+server_address_length:12+server_address_length]) if next_state == 1: send_server_list_response(client_socket) client_socket.recv(1) # Ping client_socket.sendall(create_packet(0x01, struct.pack("!q", int(time.time() * 1000)))) elif next_state == 2: send_login_success(client_socket, "00000000-0000-0000-0000-000000000000", "WeatherPlayer") send_join_game(client_socket) send_player_position_and_look(client_socket) send_world_border(client_socket) send_set_slot(client_socket) send_entity_equipment(client_socket) # --- Main Game Loop (Send Weather Updates) --- while True: send_time_update(client_socket, 100, 6000) send_update_weather(client_socket, 0, 1, rain_level) # Rain send_update_weather(client_socket, 1, 2, thunder_level) # Thunder time.sleep(0.5) # Send weather updates every 0.5 seconds except Exception as e: print(f"Error handling client: {e}") finally: print(f"Closing connection from {client_address}") client_socket.close() # --- Main Server --- def main(): """Main server function.""" server_socket = socket.socket(socket.AF_INET, socket.SOCK_STREAM) server_socket.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1) # Allow reuse of the address server_socket.bind((HOST, PORT)) server_socket.listen(5) # Listen for up to 5 incoming connections print(f"Weather MCP Server listening on {HOST}:{PORT}") # Start the weather simulation thread weather_thread = threading.Thread(target=update_weather) weather_thread.daemon = True # Exit when the main thread exits weather_thread.start() try: while True: client_socket, client_address = server_socket.accept() client_thread = threading.Thread(target=handle_client, args=(client_socket, client_address)) client_thread.daemon = True client_thread.start() except KeyboardInterrupt: print("Shutting down server...") finally: server_socket.close() if __name__ == "__main__": main() ``` **Key Improvements and Explanations:** * **Clearer Structure:** The code is organized into functions for packet packing, weather simulation, and client handling. * **VarInt Packing:** Includes `pack_varint` and `pack_string` functions to handle Minecraft's variable-length integer format. This is *essential* for the protocol. * **Packet Creation:** The `create_packet` function simplifies packet construction. * **Weather Simulation:** The `update_weather` function now simulates rain and thunder, changing the `rain_level` and `thunder_level` variables. It runs in its own thread. * **Weather Packets:** The `send_update_weather` function sends the correct packets to update the client's weather. It uses the `rain_level` and `thunder_level` values. The `send_change_game_state` function is *not* the correct way to change weather in modern Minecraft. The `Update Weather` packet is the correct one. * **Time Updates:** The `send_time_update` function sends time updates, which are important for the Minecraft client. * **Basic Handshaking and Login:** The `handle_client` function now includes basic handshaking and login to get the client into the game. It sends the necessary packets (Login Success, Join Game, Player Position and Look). This is *minimal* but allows the client to connect. * **Error Handling:** Includes `try...except` blocks to catch potential errors during network operations. * **Threading:** Uses threads to handle multiple clients concurrently. The weather simulation also runs in a separate thread. * **Comments:** More comments to explain the code. * **`struct.pack`:** Uses `struct.pack` for efficient packing of data into byte arrays. The `!` prefix in the format strings indicates network byte order (big-endian), which is required by the Minecraft protocol. * **Server List Ping:** Responds to the server list ping request so the server shows up in the Minecraft client's server list. * **Example Item:** Gives the player a diamond sword named "Weather Sword" to demonstrate sending item data. * **World Border:** Sends a world border packet to prevent the player from wandering too far. **How to Run:** 1. **Save:** Save the code as a Python file (e.g., `weather_mcp.py`). 2. **Run:** Execute the script from your terminal: `python weather_mcp.py` 3. **Minecraft Client:** * Start your Minecraft client (version 1.16.5 or the version you targeted). * Add a new server with the IP address of the machine running the script (usually `localhost` or `127.0.0.1`). * Connect to the server. **Important Considerations and Next Steps:** * **Minecraft Protocol Version:** The Minecraft protocol changes frequently. This example is based on 1.16.5. You'll need to adapt the packet IDs and data formats if you're targeting a different version. Refer to the Minecraft protocol documentation for your target version. A good resource is the [wiki.vg](https://wiki.vg/Protocol) wiki. * **Authentication:** This example skips authentication. In a real server, you'll need to handle player authentication with Mojang's servers. * **World Generation:** This example doesn't generate a world. You'll need to implement world generation and chunk loading to create a playable environment. * **Entity Management:** You'll need to manage entities (players, mobs, etc.) and send packets to update their positions and states. * **Asynchronous Programming:** For a more scalable server, consider using Python's `asyncio` library for asynchronous networking. This can handle many more concurrent connections than threading. * **Libraries:** Consider using a Minecraft server library to simplify protocol handling. However, be aware that many libraries may be outdated or incomplete. * **Security:** Be very careful about security when writing a Minecraft server. There are many potential vulnerabilities that can be exploited. This improved example provides a much better foundation for building a simple Minecraft server that can control the weather. Remember that building a full-fledged server is a significant undertaking. Start small, test frequently, and consult the Minecraft protocol documentation. Good luck!

SkySQL MCP Integration

SkySQL MCP Integration

🐋 Docker MCP server

🐋 Docker MCP server

Mirror of

Simple Memory Extension MCP Server

Simple Memory Extension MCP Server

Một máy chủ MCP (Memory, Context, and Persistence) mở rộng cửa sổ ngữ cảnh của các tác nhân AI bằng cách cung cấp các công cụ để lưu trữ, truy xuất và tìm kiếm ký ức, cho phép các tác nhân duy trì lịch sử và ngữ cảnh trong các tương tác dài.

ChatGPT MCP Server

ChatGPT MCP Server

Mirror of

Mcp Servers Wiki Website

Mcp Servers Wiki Website

Binance Market Data MCP Server

Binance Market Data MCP Server

MCP System Monitor

MCP System Monitor

A system monitoring tool that exposes system metrics via the Model Context Protocol (MCP). This tool allows LLMs to retrieve real-time system information through an MCP-compatible interface.

Apache Doris MCP Server

Apache Doris MCP Server

An MCP server for Apache Doris & VeloDB

mock-assistant-mcp-server

mock-assistant-mcp-server

Trợ lý máy chủ MCP cho dữ liệu mô phỏng

MCP Server Pool

MCP Server Pool

MCP 服务合集

google-workspace-mcp

google-workspace-mcp

Google Scholar

Google Scholar

🔍 Cho phép các trợ lý AI tìm kiếm và truy cập các bài báo trên Google Scholar thông qua một giao diện MCP đơn giản.

MCP Chess

MCP Chess

A MCP server for playing chess

untapped-mcp

untapped-mcp

A Untapped MCP server to be used with claude.

FreeCAD MCP

FreeCAD MCP

Kho lưu trữ này là một MCP (Mô-đun Cộng đồng Python) của FreeCAD cho phép bạn điều khiển FreeCAD từ Claude Desktop.

Model Context Protocol Community

Model Context Protocol Community

Easily run, deploy, and connect to MCP servers

Kubectl MCP Tool

Kubectl MCP Tool

Một máy chủ Giao thức Ngữ cảnh Mô hình (Model Context Protocol) cho phép các trợ lý AI tương tác với các cụm Kubernetes thông qua ngôn ngữ tự nhiên, hỗ trợ các hoạt động Kubernetes cốt lõi, giám sát, bảo mật và chẩn đoán.

comment-stripper-mcp

comment-stripper-mcp

A flexible MCP server that batch processes code files to remove comments across multiple programming languages. Currently supports JavaScript, TypeScript, and Vue files with regex-based pattern matching. Handles individual files, directories (including subdirectories), and text input. Built for clean code maintenance and preparation.

MCP Server для Prom.ua

MCP Server для Prom.ua

Máy chủ MCP để làm việc với API Prom.ua