Provides remote management capabilities for RISC-V based NanoKVM hardware, including power control, HID input (keyboard/mouse), and real-time display monitoring.
Enables remote operating system installation and management by allowing AI assistants to mount and unmount Ubuntu ISO images on the remote machine.
Click on "Install Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@NanoKVM MCP Servertake a screenshot of the server console"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
NanoKVM MCP Server
An MCP (Model Context Protocol) server for controlling Sipeed NanoKVM devices. This enables AI assistants like Claude to remotely control hardware via keyboard, mouse, power buttons, and screen capture.
What is NanoKVM?
NanoKVM is an open-source, affordable IP-KVM device based on RISC-V. It allows remote access to computers at the BIOS level—perfect for managing servers, embedded systems, or any headless machine.
What is MCP?
Model Context Protocol is an open standard for connecting AI assistants to external tools and data sources. This server exposes NanoKVM functionality as MCP tools that Claude and other AI assistants can use.
Features
Category | Capabilities |
Power Control | Power on/off, reset, force shutdown via ATX header |
Keyboard | Type text, send key combinations (Ctrl+C, Alt+F4, etc.) |
Mouse/Touch | Click, move, scroll, tap at absolute screen coordinates |
Screenshots | Capture display as JPEG from MJPEG video stream |
ISO Mounting | Mount/unmount ISO images for remote OS installation |
Monitoring | Power LED status, HDD activity, HDMI state, resolution |
Installation
From Source
Dependencies
Python 3.10+
mcp- Model Context Protocol SDKhttpx- Async HTTP clientwebsockets- WebSocket client for real-time HIDpycryptodome- AES encryption for authenticationpillow- Image processing for screenshots
Configuration
Environment Variables
Variable | Required | Default | Description |
| Yes | - | NanoKVM IP address or hostname |
| No |
| Web UI username |
| No |
| Web UI password |
| No |
| Target screen width in pixels |
| No |
| Target screen height in pixels |
| No |
| Use HTTPS instead of HTTP |
Claude Desktop
Add to ~/Library/Application Support/Claude/claude_desktop_config.json (macOS) or %APPDATA%\Claude\claude_desktop_config.json (Windows):
Claude Code
Add to your Claude Code MCP configuration:
Available MCP Tools
Power Control
Tool | Parameters | Description |
|
| Control power button or reset |
| - | Get power and HDD LED states |
Actions:
power- Short press (800ms) - normal power on/offpower_long- Long press (5000ms) - force power offreset- Press reset button
Display
Tool | Parameters | Description |
| - | Get HDMI connection state and resolution |
| - | Reset HDMI connection |
| - | Capture display as base64 JPEG |
Keyboard Input
Tool | Parameters | Description |
|
| Type text (max 1024 chars) |
|
| Send single key with modifiers |
Supported Keys:
Letters:
a-zNumbers:
0-9Function keys:
f1-f12Navigation:
up,down,left,right,home,end,pageup,pagedownControl:
enter,escape,tab,backspace,delete,insert,space
Mouse/Touch Input
Tool | Parameters | Description |
|
| Tap at screen coordinates |
|
| Click button, optionally at position |
|
| Move cursor to position |
|
| Scroll wheel (positive=down) |
Coordinate System:
Origin (0, 0) is top-left corner
Coordinates are in screen pixels based on
SCREEN_WIDTHandSCREEN_HEIGHTInternally mapped to NanoKVM's 1-32767 absolute coordinate range
Storage
Tool | Parameters | Description |
| - | List available ISO images |
|
| Mount ISO image |
| - | Unmount current ISO |
| - | Get mounted image info |
System
Tool | Parameters | Description |
| - | Reset keyboard/mouse devices |
| - | Get NanoKVM device info |
| - | Get hardware information |
Usage Examples
Once configured, ask Claude to:
Request | Tool Used |
"Is the server powered on?" |
|
"Power on the machine" |
|
"Reset the server" |
|
"Force shutdown" |
|
"Type 'root' and press enter" |
|
"Press Ctrl+Alt+Delete" |
|
"Take a screenshot" |
|
"Click at position 500, 300" |
|
"Mount the Ubuntu ISO" |
|
Programmatic Usage
You can also use the client library directly:
API Reference
See API_REFERENCE.md for complete documentation of the NanoKVM REST API and WebSocket protocol, including:
Authentication (AES-256-CBC encryption)
All REST endpoints with request/response formats
WebSocket HID protocol for keyboard and mouse
USB HID keycodes reference
Direct SSH HID access via
/dev/hidg*
How It Works
Architecture
Communication Methods
Feature | Method | Endpoint |
Authentication | REST |
|
Power control | REST |
|
Text input | REST |
|
Key/Mouse events | WebSocket |
|
Screenshots | REST |
|
ISO mounting | REST |
|
Development
Setup
Project Structure
Troubleshooting
Connection Refused
Verify NanoKVM is reachable:
ping <NANOKVM_HOST>Check web UI is accessible:
http://<NANOKVM_HOST>Verify credentials are correct
Authentication Failed
Default credentials are
admin/adminCheck if password was changed in NanoKVM web UI
Authentication can be disabled in
/etc/kvm/server.yaml
HID Input Not Working
Try
nanokvm_reset_hidtoolCheck "Reset HID" in NanoKVM web UI
Verify USB cable connection to target machine
Check
/dev/hidg*devices exist on NanoKVM via SSH
Screenshot Timeout
Ensure HDMI is connected and signal detected
Check
nanokvm_hdmi_statusfor connection stateTry
nanokvm_hdmi_resetto reinitialize
License
MIT
Related Projects
Sipeed NanoKVM - The hardware this server controls
Model Context Protocol - The protocol specification
FastMCP - Python MCP framework