Discover Awesome MCP Servers

Extend your agent with 20,526 capabilities via MCP servers.

All20,526
amap-weather-server

amap-weather-server

Server cuaca amap dengan MCP

mcp_server

mcp_server

Okay, here's a basic outline and example code snippets to guide you in implementing a sample MCP (Media Control Protocol) server using a Dolphin MCP client. This will be a simplified example to illustrate the core concepts. **Understanding the Components** * **MCP (Media Control Protocol):** A protocol for controlling media playback devices. It defines commands like play, pause, stop, seek, and volume control. * **Dolphin MCP Client:** A library or tool (presumably you have access to this) that acts as the client in the MCP communication. It sends commands to the MCP server. * **MCP Server:** The application you'll build. It listens for MCP commands from the Dolphin MCP client, interprets them, and then performs the corresponding actions (e.g., controlling a media player). **High-Level Steps** 1. **Choose a Programming Language and Framework:** Python is a good choice for its simplicity and networking libraries. You could use the `socket` module directly or a framework like `asyncio` for asynchronous handling. 2. **Set up a Socket Server:** Create a socket server that listens on a specific port (e.g., 5000). This server will accept connections from the Dolphin MCP client. 3. **Receive and Parse MCP Commands:** When a client connects, receive data from the socket. This data will be the MCP command. You'll need to parse the command string to determine the action to perform. 4. **Implement Command Handlers:** Create functions or methods to handle each MCP command (e.g., `handle_play()`, `handle_pause()`, `handle_seek()`). These handlers will interact with your media player (or a simulated media player for testing). 5. **Send Responses (Optional):** The MCP protocol may define response messages. You can send acknowledgements or status updates back to the client. 6. **Error Handling:** Implement error handling to gracefully deal with invalid commands, network issues, and other potential problems. **Python Example (using `socket` module)** ```python import socket import threading HOST = '127.0.0.1' # Loopback address (localhost) PORT = 5000 # Port to listen on # Simulated Media Player (replace with actual media player control) class MediaPlayer: def __init__(self): self.playing = False self.position = 0 # in seconds self.volume = 100 def play(self): print("Playing...") self.playing = True def pause(self): print("Pausing...") self.playing = False def stop(self): print("Stopping...") self.playing = False self.position = 0 def seek(self, position): print(f"Seeking to {position} seconds...") self.position = position def set_volume(self, volume): print(f"Setting volume to {volume}%") self.volume = volume media_player = MediaPlayer() # Create an instance of the media player def handle_client(conn, addr): print(f"Connected by {addr}") try: while True: data = conn.recv(1024) # Receive up to 1024 bytes if not data: break command = data.decode('utf-8').strip() # Decode and remove whitespace print(f"Received command: {command}") # Parse the command (very basic example) parts = command.split() action = parts[0].lower() if action == "play": media_player.play() conn.sendall(b"OK\n") # Send a simple acknowledgement elif action == "pause": media_player.pause() conn.sendall(b"OK\n") elif action == "stop": media_player.stop() conn.sendall(b"OK\n") elif action == "seek": try: position = int(parts[1]) media_player.seek(position) conn.sendall(b"OK\n") except (IndexError, ValueError): conn.sendall(b"ERROR: Invalid seek command\n") elif action == "volume": try: volume = int(parts[1]) media_player.set_volume(volume) conn.sendall(b"OK\n") except (IndexError, ValueError): conn.sendall(b"ERROR: Invalid volume command\n") else: print(f"Unknown command: {command}") conn.sendall(b"ERROR: Unknown command\n") except Exception as e: print(f"Error handling client: {e}") finally: conn.close() print(f"Connection closed with {addr}") def main(): with socket.socket(socket.AF_INET, socket.SOCK_STREAM) as s: s.bind((HOST, PORT)) s.listen() print(f"Listening on {HOST}:{PORT}") while True: conn, addr = s.accept() thread = threading.Thread(target=handle_client, args=(conn, addr)) thread.start() if __name__ == "__main__": main() ``` **Explanation:** 1. **Imports:** Imports the necessary modules (`socket` for networking, `threading` for handling multiple clients concurrently). 2. **Constants:** Defines the host and port for the server. 3. **`MediaPlayer` Class:** A simple class to simulate a media player. Replace the placeholder methods with actual media player control code (e.g., using a library like `vlc` or `pygame`). 4. **`handle_client(conn, addr)` Function:** * This function is executed in a separate thread for each client connection. * It receives data from the client using `conn.recv(1024)`. * It decodes the data (assuming UTF-8 encoding) and removes leading/trailing whitespace. * It parses the command string (very basic splitting on spaces). **Important:** A real MCP implementation would likely have a more robust parsing mechanism. * It calls the appropriate `media_player` methods based on the command. * It sends a simple "OK" or "ERROR" response back to the client. * It includes error handling to catch exceptions. * It closes the connection when the client disconnects or an error occurs. 5. **`main()` Function:** * Creates a socket object using `socket.socket(socket.AF_INET, socket.SOCK_STREAM)`. * Binds the socket to the specified host and port using `s.bind((HOST, PORT))`. * Starts listening for incoming connections using `s.listen()`. * Enters a loop that accepts incoming connections using `s.accept()`. * For each connection, it creates a new thread to handle the client using `threading.Thread(target=handle_client, args=(conn, addr))`. * Starts the thread using `thread.start()`. 6. **`if __name__ == "__main__":`:** Ensures that the `main()` function is only executed when the script is run directly (not when it's imported as a module). **How to Run:** 1. Save the code as a Python file (e.g., `mcp_server.py`). 2. Run the script from your terminal: `python mcp_server.py` 3. Use the Dolphin MCP client to connect to `127.0.0.1` on port `5000`. 4. Send MCP commands like "play", "pause", "stop", "seek 10", "volume 50". Observe the output in the server's terminal. **Important Considerations and Improvements:** * **MCP Protocol Specification:** You *must* have the full specification for the MCP protocol you're using. This example is a very simplified approximation. The specification will define the exact command formats, data types, and response codes. * **Robust Command Parsing:** Use a more robust parsing method (e.g., regular expressions, a dedicated parsing library) to handle complex command formats and arguments. * **Error Handling:** Implement comprehensive error handling to catch invalid commands, network errors, and other potential issues. Provide informative error messages to the client. * **Asynchronous I/O:** For a more scalable server, consider using `asyncio` for asynchronous I/O. This allows the server to handle multiple clients concurrently without using threads. * **Media Player Integration:** Replace the `MediaPlayer` class with actual code to control your media player. You might need to use a library specific to your media player (e.g., `vlc`, `pygame`, or a media player's API). * **Security:** If the MCP server will be exposed to a network, consider security implications and implement appropriate security measures (e.g., authentication, authorization, encryption). * **Threading vs. Asynchronous:** For a small number of clients, threading might be sufficient. For a larger number of clients, asynchronous I/O is generally more efficient. * **Dolphin MCP Client Documentation:** Refer to the Dolphin MCP client's documentation for details on how to connect to the server and send commands. **Example Commands from Dolphin MCP Client:** Assuming the Dolphin MCP client sends commands as simple text strings: * `PLAY` * `PAUSE` * `STOP` * `SEEK 60` (Seek to 60 seconds) * `VOLUME 75` (Set volume to 75%) **Indonesian Translation of Key Concepts:** * **MCP (Media Control Protocol):** Protokol Kontrol Media * **Dolphin MCP Client:** Klien Dolphin MCP * **MCP Server:** Server MCP * **Socket:** Soket * **Command:** Perintah * **Parse:** Mengurai (or Memproses) * **Handler:** Penangan * **Response:** Respon * **Error Handling:** Penanganan Kesalahan * **Media Player:** Pemutar Media * **Thread:** Utas (or Alur) * **Asynchronous I/O:** I/O Asinkron This detailed explanation and code example should give you a solid starting point for implementing your MCP server. Remember to adapt the code to your specific needs and the requirements of the Dolphin MCP client and the MCP protocol you're using. Good luck!

Wise MCP Server

Wise MCP Server

Enables access to Wise API functionality for managing recipients and sending money transfers. Supports listing recipients, creating new recipients, validating account details, and executing money transfers with authentication handling.

Plex MCP Account Finder

Plex MCP Account Finder

Connects to multiple Plex accounts to perform fuzzy searches for users across servers by email, username, or display name, and generates authentication tokens for new account access.

Fortune MCP Server

Fortune MCP Server

Enables users to perform tarot card readings and generate horoscopes based on specified dates, times, and locations. Provides mystical divination services through tarot draws and astrological calculations.

ScreenshotOne MCP Server

ScreenshotOne MCP Server

A simple implementation of an MCP server for the ScreenshotOne API

AskTheApi Team Builder

AskTheApi Team Builder

Pembangun jaringan agen untuk berkomunikasi dengan API OpenAPI. Berbasis di AutoGen.

MonteWalk

MonteWalk

Provides AI agents with institutional-grade quantitative finance tools including real-time market data, paper trading via Alpaca, risk analysis with Monte Carlo simulations, backtesting, and multi-source news sentiment analysis for portfolio management and trading strategy development.

IRIS Legacy

IRIS Legacy

Archived monolithic MCP server that provided 28 tools for Microsoft 365 (email, calendar, Teams, users, files), Italian PEC certified email, booking, and document management. Replaced by 8 atomic MCP servers.

Cortex MCP

Cortex MCP

A Model Context Protocol server that provides natural language access to Cortex API, enabling users to query information about their system's structure and make faster decisions about services, incidents, and team responsibilities.

Reddit User MCP Server

Reddit User MCP Server

Enables interaction with Reddit through a Reddable account, allowing users to fetch posts and comments, reply to discussions, and manage comment visibility using secure API key authentication.

Planning Center Online API and MCP Server Integration

Planning Center Online API and MCP Server Integration

Server MCP Planning Center Online

How-To-Cook

How-To-Cook

An AI recipe recommendation server based on the MCP protocol, providing functions such as recipe query, classification filtering, intelligent dietary planning, and daily menu recommendation.

Google Cloud DNS API MCP Server

Google Cloud DNS API MCP Server

Auto-generated MCP server that enables interaction with Google's Cloud DNS API for managing DNS zones and records through natural language.

Salesforce DX MCP Server

Salesforce DX MCP Server

Enables secure interaction with Salesforce orgs through LLMs, providing tools for managing orgs, querying data, deploying metadata, running tests, and performing code analysis. Features granular access control and uses encrypted auth files to avoid exposing secrets in plain text.

mcp-gsheets

mcp-gsheets

mcp-gsheets

Remote MCP Server

Remote MCP Server

A server that implements the Model Context Protocol (MCP) on Cloudflare Workers, allowing AI models to access custom tools without authentication.

MCP Server

MCP Server

Manages query validation, database connection, and security for a system that transforms SQL databases into interactive dashboards using natural language queries.

Transmission MCP Server

Transmission MCP Server

Provides tools for interacting with the Transmission BitTorrent client via natural language, enabling users to manage torrents, configure download settings, and monitor download activity.

MCP Redirect Server

MCP Redirect Server

A Model Context Protocol server built with NestJS that provides OAuth 2.1 authentication with GitHub and exposes MCP tools through Server-Sent Events transport. Enables secure, real-time communication with JWT-based protection and dependency injection.

Google Calendar MCP Server

Google Calendar MCP Server

Enables natural language queries to Google Calendar API for checking appointments, availability, and events. Supports flexible time ranges, timezone handling, and both service account and OAuth authentication methods.

Python MCP Sandbox

Python MCP Sandbox

An interactive Python code execution environment that allows users and LLMs to safely execute Python code and install packages in isolated Docker containers.

Kokkai Minutes MCP Agent

Kokkai Minutes MCP Agent

Provides a structured interface to the Japanese National Diet Library's parliamentary proceedings API, allowing AI models to search and retrieve Diet meeting records and speeches.

GitHub MCP Server

GitHub MCP Server

Android Tester MCP

Android Tester MCP

An MCP server for automating virtual or physical Android devices using the Gbox SDK. It enables users to manage app installations, capture screenshots, and perform complex UI actions through natural language instructions.

Weather MCP

Weather MCP

A Model Context Protocol server that enables natural language weather queries for global cities, integrating with OpenWeather API to provide real-time weather information in an easy-to-read format.

Element MCP Server

Element MCP Server

Connects Claude with Matrix/Element to read and search messages across rooms. Enables listing rooms, viewing room information, retrieving message history, and searching conversation content from your Matrix account.

LinkedIn Sales Navigator No Cookies Required MCP Server

LinkedIn Sales Navigator No Cookies Required MCP Server

Provides access to the LinkedIn Sales Navigator API without requiring browser cookies for authentication. It enables AI assistants to interact with sales data and various utility endpoints including TV Maze and deck of cards.

MCP Search Server

MCP Search Server

Provides web search functionality for the Gemini Terminal Agent, handling concurrent requests and content extraction to deliver real-time information from the web.

HTTP MCP Server

HTTP MCP Server

An MCP server that enables AI assistants to fetch public GitHub repository lists for any username via HTTP or stdio transports. It provides a specialized tool for repository retrieval and supports both remote web server and local integration modes.