remote-capable server
The server can be hosted and run remotely because it primarily relies on remote services or has no dependency on the local environment.
Gausium OpenAPI MCP Server
This project implements an MCP (Model Control Protocol) server that acts as a bridge to the Gausium OpenAPI, allowing AI models or other clients to interact with Gausium robots through a standardized interface.
Repository: https://github.com/cfrs2005/mcp-gs-robot
Architecture
The server follows a layered architecture that separates concerns and promotes maintainability:
MCP Protocol Flow
The diagram below shows how AI models interact with Gausium robots through the MCP protocol:
Features
The server currently supports the following functionalities as MCP tools:
list_robots
: Lists robots accessible via the API key. (Based on: List Robots API)get_robot_status
: Fetches the detailed status of a specific robot by its serial number. (Based on: Get Robot Status API)list_robot_task_reports
: Retrieves cleaning task reports for a specific robot, with optional time filtering. (Based on: List Robot Task Reports API)list_robot_maps
: Lists the maps associated with a specific robot. (Based on: List Robot Maps API)
Project Structure
The project follows a structured layout based on Python best practices:
src/gs_openapi/config.py
: Contains base URLs, API paths, and environment variable names.src/gs_openapi/auth/token_manager.py
: Manages acquiring and refreshing OAuth tokens.src/gs_openapi/api/
: Contains modules (robots.py
,maps.py
) with functions that directly call the Gausium OpenAPI endpoints usinghttpx
.src/gs_openapi/mcp/gausium_mcp.py
: Defines theGausiumMCP
class which integrates the API calls and token management.main.py
: InitializesGausiumMCP
, registers the API functionalities as MCP tools using@mcp.tool()
, configures basic logging, and starts the server usingmcp.run()
.
Setup and Running
- Clone the repository:Copy
- Create and activate a virtual environment using
uv
:Copy - Install dependencies using
uv
:Copy - Configure Credentials:
The application expects Gausium API credentials to be set as environment variables:
GS_CLIENT_ID
: Your Gausium Application Client ID.GS_CLIENT_SECRET
: Your Gausium Application Client Secret.GS_OPEN_ACCESS_KEY
: Your Gausium OpenAPI Access Key.
You can set these directly in your shell:
Copy(Alternatively, modify
src/gs_openapi/config.py
for development, but do not commit credentials). - Run the server:By default, this starts the server using SSE transport onCopy
http://0.0.0.0:8000
. You can modifymain.py
to usestdio
transport if needed.
Connecting an MCP Client
Once the server is running, an MCP client (like Cursor or another compatible tool) can connect to it via the appropriate transport (SSE or stdio) to utilize the defined tools.
Usage with Cursor
Below is an example of how Cursor interacts with this MCP server:
Debugging
You can monitor the server logs for debugging information. The basic logging configuration in main.py
provides timestamps, levels, and source information.
Below is an example of the server log output during operation:
This server cannot be installed
A Model Control Protocol plugin for controlling GS cleaning robots, supporting robot listing, status monitoring, navigation commands, task execution, and remote control operations.