Get the FREE Ultimate OpenClaw Setup Guide →

turret_mcp_server

This project is an MCP (Model Context Protocol) server that controls a turret using serial communication.

Installation
Run this command in your terminal to add the MCP server to Claude Code.
Run in terminal:
Command
claude mcp add --transport stdio gofmanaa-turret_mcp_server /path/to/turret_mcp_server/target/release/turret_mcp_server

How to use

The Turret Controller MCP Server exposes MCP tools to remotely control a turret over a serial connection. Core capabilities include firing the turret, setting its pan/tilt position, querying the current bullets count, and an echo tool for testing connectivity. To use these tools, connect your MCP client to the server using the appropriate server name configured in your environment (as shown in the example settings.json). The server expects the MPC commands named fire, set_turret_position, get_bullets, and echo. When you issue set_turret_position, provide x and y coordinates within the 0-180 range to pan and tilt the turret accordingly. You can also perform simple echo tests to verify connectivity and latency before issuing motion or firing commands.

How to install

Prerequisites:

  • Rust toolchain (rustc, cargo)
  • Access to a Rust-compatible environment (Linux/macOS; Windows with WSL or msys2)
  • USB serial connection to the turret hardware

Installation steps:

  1. Clone the repository: git clone https://github.com/your-org/turret_mcp_server.git cd turret_mcp_server
  2. Build the project in release mode: cargo build -r
  3. Locate the built binary: target/release/turret_mcp_server
  4. Prepare the MCP configuration (settings.json) to point to the binary, for example: { "mcpServers": { "turret-mcp-server": { "command": "/path/to/turret_mcp_server/target/release/turret_mcp_server", "alwaysAllow": ["set_turret_position", "get_bullets", "fire"] } } }
  5. Run the server using your preferred method (direct binary execution or within a process manager) and ensure the local serial port is accessible (e.g., /dev/ttyUSB0). If you want to run with Docker, refer to the Docker section in the README for specifics.
  6. If you modify the serial port, update the turret_mcp_server.rs source and recompile.

Docker alternative:

  • Build and run the container as described in the README, mapping the host serial device into the container and exposing the MCP endpoint as configured.

Additional notes

Tips and common issues:

  • The server uses the serial port at /dev/ttyUSB0 by default. Update the code to use the correct port for your system if needed.
  • Ensure your user has permissions to access the serial device (e.g., add to dialout group on Linux).
  • The alwaysAllow list in the settings.json controls which tools can be invoked without extra permissions; adjust as needed for your security model.
  • When running in Docker, you must pass the host's serial device into the container (e.g., --device=/dev/ttyUSB0).
  • If you encounter initialization errors, verify the serial connection and that the turret hardware is powered and responsive.
  • The Maven/Rust dependencies listed (anyhow, rmcp, serialport, serde_json, tracing_subscriber) are resolved by Cargo during build; ensure network access for crates.io if you build in a restricted environment.

Related MCP Servers

Sponsor this space

Reach thousands of developers