Skip to main content
Glama
cfrs2005

GS Robot MCP Server

by cfrs2005
README.md
# πŸ€– Gausium OpenAPI MCP Server

<div align="center">

[![Python Version](https://img.shields.io/badge/python-3.12+-blue.svg)](https://www.python.org/downloads/)
[![PyPI Version](https://img.shields.io/pypi/v/mcp-gs-robot.svg)](https://pypi.org/project/mcp-gs-robot/)
[![License](https://img.shields.io/badge/license-MIT-green.svg)](LICENSE)
[![MCP Compatible](https://img.shields.io/badge/MCP-Compatible-purple.svg)](https://github.com/modelcontextprotocol)
[![Claude Code](https://img.shields.io/badge/Claude_Code-Ready-orange.svg)](https://claude.ai/code)

**πŸ”§ A powerful MCP server bridging AI models with Gausium robots**

*Control and monitor Gausium cleaning robots through Claude, Cursor, and other AI assistants*

[πŸš€ Quick Start](https://github.com/cfrs2005/mcp-gs-robot#-quick-start) β€’ [πŸ“– Documentation](https://github.com/cfrs2005/mcp-gs-robot#-documentation) β€’ [πŸ› οΈ Installation](https://github.com/cfrs2005/mcp-gs-robot#-installation-1) β€’ [🎯 Examples](https://github.com/cfrs2005/mcp-gs-robot#-examples) β€’ [πŸ‡¨πŸ‡³ δΈ­ζ–‡ζ–‡ζ‘£](https://github.com/cfrs2005/mcp-gs-robot/blob/main/README_CN.md)

</div>

---

## 🌟 What is this?

This MCP (Model Control Protocol) server enables seamless interaction between AI models and Gausium cleaning robots through a standardized interface. Perfect for building intelligent automation workflows with Claude Code, Cursor, and other MCP-compatible AI tools.

**πŸ”— Repository:** [https://github.com/cfrs2005/mcp-gs-robot](https://github.com/cfrs2005/mcp-gs-robot)

### 🎯 Key Benefits

- πŸ€– **AI-First Design**: Built specifically for AI assistant integration
- πŸ”„ **Real-time Control**: Monitor and command robots instantly
- πŸ“Š **Rich Data Access**: Get detailed status, maps, and task reports
- πŸ›‘οΈ **Secure**: OAuth-based authentication with environment variables
- 🌐 **Universal**: Works with Claude, Cursor, and any MCP client

## πŸ—οΈ Architecture

The server follows a layered architecture that separates concerns and promotes maintainability:

![Architecture Diagram](https://github.com/cfrs2005/mcp-gs-robot/raw/main/docs/images/architecture.svg)

### πŸ”„ MCP Protocol Flow

The diagram below shows how AI models interact with Gausium robots through the MCP protocol:

![MCP Protocol Flow](https://github.com/cfrs2005/mcp-gs-robot/raw/main/docs/images/mcp-flow.svg)

## ✨ Features

### πŸ› οΈ Core MCP Tools

| Tool | Description | Status |
|------|-------------|--------|
| πŸ€– `list_robots` | List all accessible robots | βœ… Ready |
| πŸ“Š `get_robot_status` | Get detailed robot status and position | βœ… Ready |
| πŸ“‹ `list_robot_task_reports` | Retrieve cleaning task reports with filtering | βœ… Ready |
| πŸ—ΊοΈ `list_robot_maps` | Get available maps for robot navigation | βœ… Ready |
| 🎯 `create_robot_command` | Send commands to robots (start/pause/stop) | βœ… Ready |
| 🏒 `get_site_info` | Get building and floor information | βœ… Ready |
| πŸ“ `get_map_subareas` | Get detailed area information for tasks | βœ… Ready |
| πŸš€ `submit_temp_task` | Submit temporary cleaning tasks | βœ… Ready |

### 🧠 Smart Routing Tools (Enhanced in v0.1.12)

| Tool | Description | Status |
|------|-------------|--------|
| 🎯 `get_robot_status_smart` | Auto-select V1/V2 API based on robot series | βœ… Ready |
| πŸ“Š `get_task_reports_smart` | Intelligent task report API routing | βœ… Ready |
| πŸ” `get_robot_capabilities` | Show supported APIs for specific robot | βœ… Ready |

### πŸ”§ Advanced Workflows

- πŸŽ›οΈ **Automated Task Execution**: Complete workflows from status β†’ task selection β†’ execution
- πŸ“ˆ **Batch Operations**: Handle multiple robots simultaneously
- πŸ—ΊοΈ **Map Management**: Upload, download, and manage robot maps
- πŸ“Š **Report Generation**: Generate PNG maps from task reports
- πŸ—οΈ **Site-based Tasks**: Advanced task creation with building/floor context

### 🀝 Supported Robot Lines

#### M-line Robots (Traditional Cleaning Robots)
- **OMNIE** (OMNIE series) - Multi-purpose cleaning robot
- **Vacuum 40** (40 series) - Vacuum cleaning robot
- **Scrubber 50** (50 series) - Floor scrubbing robot
- **Scrubber 75** (75 series) - Heavy-duty floor scrubbing robot

#### S-line Robots (Advanced Smart Robots, including SW series)
- **Phantas** (S series) - Phantom intelligent cleaning robot
- **BEETLE** (SW series) - Beetle smart cleaning robot

## πŸ“ Project Structure

The project follows a structured layout optimized for MCP development:

```
πŸ—‚οΈ mcp-gs-robot/
β”œβ”€β”€ πŸ“¦ src/gs_openapi/           # Main package
β”‚   β”œβ”€β”€ πŸ”Œ api/                  # Direct API integrations
β”‚   β”‚   β”œβ”€β”€ πŸ€– robots.py         # Robot management APIs
β”‚   β”‚   └── πŸ—ΊοΈ maps.py           # Map management APIs
β”‚   β”œβ”€β”€ πŸ” auth/                 # Authentication layer
β”‚   β”‚   └── 🎫 token_manager.py  # OAuth token lifecycle
β”‚   β”œβ”€β”€ βš™οΈ config.py             # Configuration management
β”‚   β”œβ”€β”€ πŸ”§ core/                 # Core functionality
β”‚   β”‚   β”œβ”€β”€ πŸ“‘ client.py         # HTTP client wrapper
β”‚   β”‚   └── πŸ›£οΈ endpoints.py      # API endpoint definitions
β”‚   β”œβ”€β”€ πŸ”Œ mcp/                  # MCP server implementation
β”‚   β”‚   └── πŸŒ‰ gausium_mcp.py    # Main MCP bridge
β”‚   └── πŸ”„ workflows/            # Automated workflows
β”‚       └── 🎯 task_engine.py    # Task automation engine
β”œβ”€β”€ πŸ“š docs/                     # Documentation
β”‚   β”œβ”€β”€ πŸ–ΌοΈ images/               # Visual documentation
β”‚   β”œβ”€β”€ πŸ“– apis.md              # API documentation
β”‚   └── πŸ§ͺ TESTING_GUIDE.md     # Testing instructions
β”œβ”€β”€ πŸš€ main.py                  # Application entry point
└── πŸ“‹ pyproject.toml           # Package configuration
```

### πŸ” Key Components

| Component | Purpose | Icon |
|-----------|---------|------|
| **config.py** | Base URLs, API paths, environment variables | βš™οΈ |
| **token_manager.py** | OAuth token acquisition and refresh | πŸ” |
| **api/robots.py** | Robot status, commands, task reports | πŸ€– |
| **api/maps.py** | Map listing, upload, download | πŸ—ΊοΈ |
| **gausium_mcp.py** | MCP server integration layer | πŸŒ‰ |
| **task_engine.py** | Automated workflow orchestration | 🎯 |
| **main.py** | Server initialization and tool registration | πŸš€ |

## πŸš€ Quick Start

### πŸ“¦ Installation

#### Option 1: Install from PyPI (Recommended)

```bash
pip install mcp-gs-robot
```

#### Option 2: Install from Source

```bash
# Clone repository
git clone https://github.com/cfrs2005/mcp-gs-robot.git
cd mcp-gs-robot

# Setup with uv (recommended)
uv venv
source .venv/bin/activate  # Windows: .venv\Scripts\activate
uv pip install -e .
```

### πŸ”§ Configuration

**Set up your Gausium API credentials:**

```bash
# Required environment variables
export GS_CLIENT_ID="your_client_id"
export GS_CLIENT_SECRET="your_client_secret" 
export GS_OPEN_ACCESS_KEY="your_access_key"
```

> πŸ”‘ **Get credentials from [Gausium Developer Portal](https://developer.gs-robot.com/)**

### πŸƒβ€β™‚οΈ Running the Server

```bash
# Start MCP server (stdio mode)
python -m gs_openapi.main
# or if installed via pip:
mcp-gs-robot
```

βœ… Server starts using `stdio` transport (perfect for Claude Code)

### πŸ”Œ Claude Code Integration

**Method 1: Automatic installation with environment setup**

```bash
# Add MCP server with environment variables
claude mcp add mcp-gs-robot \
  --env GS_CLIENT_ID="your_client_id" \
  --env GS_CLIENT_SECRET="your_client_secret" \
  --env GS_OPEN_ACCESS_KEY="your_access_key"
```

**Method 2: Manual configuration**

Add to your `claude_desktop_config.json`:

```json
{
  "mcpServers": {
    "mcp-gs-robot": {
      "command": "mcp-gs-robot",
      "env": {
        "GS_CLIENT_ID": "your_client_id",
        "GS_CLIENT_SECRET": "your_client_secret", 
        "GS_OPEN_ACCESS_KEY": "your_access_key"
      }
    }
  }
}
```

**Method 3: Using environment file**

If you prefer to use a `.env` file:

```bash
# Set global environment variables
export GS_CLIENT_ID="your_client_id"
export GS_CLIENT_SECRET="your_client_secret"
export GS_OPEN_ACCESS_KEY="your_access_key"

# Simple MCP installation
claude mcp add mcp-gs-robot
```

> πŸ’‘ **Note**: This MCP server uses `stdio` transport (not SSE), which is perfect for Claude Code integration

## 🎯 Examples

### πŸ“± Claude Code Usage

```python
# In Claude Code, you can now use natural language:

"List all my robots"
# β†’ Calls mcp__mcp-gs-robot__list_robots

"Get status of robot GS101-0100-V1P-B001" 
# β†’ Calls mcp__mcp-gs-robot__get_robot_status

"Start cleaning task for robot in building 5"
# β†’ Orchestrates site info β†’ map selection β†’ task creation
```

### πŸ–₯️ IDE Integration

**Cursor Configuration:**

![Cursor Usage Screenshot](https://github.com/cfrs2005/mcp-gs-robot/raw/main/docs/images/cursor_usage_screenshot.png)

**Cherry Studio Configuration:**

![Cherry Studio Configuration](https://github.com/cfrs2005/mcp-gs-robot/raw/main/docs/images/cherrystudio.png)

### πŸ› Debugging

Monitor server logs for troubleshooting:

![MCP Debug Screenshot](https://github.com/cfrs2005/mcp-gs-robot/raw/main/docs/images/mcp_debug_screenshot.png)

## πŸ“– Documentation

| Document | Purpose |
|----------|----------|
| 🎯 [Claude Code Integration](docs/CLAUDE_CODE_INTEGRATION.md) | Complete Claude Code setup guide |
| πŸ“‹ [API Reference](docs/apis.md) | Complete API documentation |
| πŸ§ͺ [Testing Guide](docs/TESTING_GUIDE.md) | How to test the MCP server |
| πŸ”§ [Configuration](docs/README.md) | Detailed setup instructions |

## 🀝 Contributing

We welcome contributions! Please:

1. 🍴 Fork the repository
2. 🌿 Create a feature branch
3. βœ… Add tests for your changes
4. πŸ“ Update documentation
5. πŸ”„ Submit a pull request

## πŸ“„ License

MIT License - see [LICENSE](LICENSE) file for details.

## πŸ†˜ Support

- πŸ“ [Issues](https://github.com/cfrs2005/mcp-gs-robot/issues)
- πŸ“§ [Email](mailto:cfrs2005@gmail.com)
- πŸ“š [Gausium Developer Docs](https://developer.gs-robot.com/)

---

<div align="center">

**Made with ❀️ for the Claude Code community**

*Enabling AI-powered robot automation, one task at a time* πŸ€–βœ¨

</div>

TDQS

C2.9/5.0

Scored across 21 tools

Disambiguation2/5

Most tools have clear purposes, but there is notable overlap between download_robot_map_v1 and download_robot_map_v2, which differ only by API version and are easy for an agent to confuse. There is also potential ambiguity between the three workflow-execution tools and the lower-level task submission/command tools, since they cover overlapping workflows at different abstraction levels.

Naming Consistency4/5

The tools mostly follow a consistent snake_case verb_noun pattern, such as list_robots, get_site_info, create_robot_command, and upload_robot_map_v1. The main deviations are the 'smart' suffix tools and nested workflow names like execute_s_line_site_task_workflow, but the pattern remains predictable overall.

Tool Count3/5

With 21 tools, the surface is somewhat heavy for an MCP server, especially because several tools are version-specific or workflow-level wrappers around lower-level operations. The count is defensible for a broad robot management domain, but it feels closer to the upper limit of what a typical agent can navigate efficiently.

Completeness4/5

The toolset covers the core robot lifecycle well: robot listing, status, capabilities, map retrieval/upload, commands, task submission, reporting, and workflow execution. Minor gaps include lack of map update/delete operations and no v2 upload counterpart, but the available surface supports realistic automation workflows.

Maintenance

ActivityInactive
ResponsivenessNo issues