Skip to main content
Glama
PerifMCP

PerifMCP

by Mucca03

PerifMCP

PerifMCP is a local-first configuration studio for the GIM K64 RGB and compatible GK6X/Semitek keyboards.

The goal is to make the keyboard usable from two interfaces that share one state:

  • an MCP server so an AI agent can inspect, plan, apply and verify changes safely.

Status: the semantic core, the web UI and the local daemon (HTTP API + MCP server) are in place and tested against a mock backend. Writes to the device stay behind a read-only probe. No firmware update and no vendor VID change are implemented.

Why this exists

The keyboard identifies as 1ea7:0907 and uses the GK6X/Semitek 64-byte HID protocol. The vendor software is Windows-only and the community projects are archived or partial. PerifMCP keeps the protocol layer small, typed and testable, and puts a semantic layer on top:

web UI / MCP tools
        │
        ▼
  plan → preview → apply → verify
        │
        ▼
  @perifmcp/core (protocol, layout, keymaps, macros, lighting)
        │
        ▼
  /dev/hidraw1 (usage page 0xFF00)

Related MCP server: mijia-fast

Repository layout

apps/web       Vite + React UI with a 64-key visual keyboard
apps/daemon    local HTTP API + MCP server
packages/core  protocol, CRC, packet codec, layout, config types, semantics
docs           architecture, hardware, AI-tool and MCP-client contracts
profiles       example/shareable lighting profiles

Device

  • Model: GIM K64 RGB Keyboard

  • Manufacturer on label: ShenZhen RiYueZe Technology Co., LTD

  • Serial: K6420J000098

  • USB: 1ea7:0907 (SHARKOON / SEMITEK)

  • Layout: 64 keys, ANSI, GK64-style arrows

  • Control channel: HID interface with usagePage 0xFF00, usage 0x50

  • Linux: /dev/hidraw1 once the udev rule is installed

The kernel keeps hid_semitek bound. PerifMCP does not replace it.

Safety rules

  • Read-only by default.

  • Never send raw HID packets from the UI or an agent. Use semantic tools.

  • Take a snapshot before applying a plan.

  • Never update firmware.

  • Never call the vendor writeMacVid command (0x41/0x01).

  • Do not redistribute the proprietary Build/Data directory from pixeltris/GK6X.

Quick start

Requirements: Node.js 22+, pnpm 10+ and a Chromium-based browser.

pnpm install
pnpm dev

pnpm dev starts the web UI and the daemon. Without a keyboard the daemon uses a mock backend, so the full plan → preview → apply → verify flow works offline and never touches hardware. See Enabling device writes to write to a real keyboard. To check the protocol and services:

pnpm test
pnpm typecheck

The read-only hardware probe identifies the connected model without writing to it:

pnpm --filter @perifmcp/daemon probe

MCP tools

An AI agent talks to the daemon's MCP server with semantic tools, never raw HID packets. Connection details are in docs/mcp-clients.md. The tools are:

Tool

Purpose

keyboard_status

report the connected model and backend

keyboard_get_layout

read the 64-key layout

keyboard_get_config

read the current key assignments

keyboard_get_macros

read stored macros

keyboard_get_lighting

read the current lighting state

keyboard_plan_keys

plan a key remap

keyboard_plan_macro

plan a macro change

keyboard_plan_lighting

plan a lighting change

keyboard_preview_plan

show what a plan would write

keyboard_apply_plan

apply a plan (requires confirmation)

keyboard_snapshot

capture the current state before a write

keyboard_list_snapshots

list saved snapshots

keyboard_restore

restore a snapshot

keyboard_verify

check the device matches the applied plan

Shareable lighting profiles live in profiles/examples/. Each is a plan input for keyboard_plan_lighting (or POST /api/plans/lighting); see profiles/README.md.

Enabling device writes

By default the daemon runs the mock backend: plans, previews and applies work, but nothing reaches the keyboard. pnpm test runs against this mock, so a test run never touches your hardware.

Writing to the real keyboard (remapping keys, changing colors, storing macros) is off unless you turn it on. The daemon reports read-write only when all three of these are true:

  1. PERIFMCP_BACKEND=hid — use the real HID backend instead of the mock.

  2. PERIFMCP_ALLOW_WRITES=1 — opt in to writes. Without it the connection stays read-only.

  3. PERIFMCP_MODELS_FILE=/path/to/models.json — a model file with the key index for your board, supplied by you and never committed.

# Read-write session against the connected keyboard
PERIFMCP_BACKEND=hid \
PERIFMCP_ALLOW_WRITES=1 \
PERIFMCP_MODELS_FILE=/path/to/models.json \
pnpm --filter @perifmcp/daemon dev

Check the current mode any time with keyboard_status or GET /api/status; it returns read-only or read-write and lists why writes are blocked.

Once writes are enabled, any client of the daemon — including an AI agent over MCP — can change key assignments, lighting and macros on the physical keyboard. Keep the mock backend for development, enable the HID backend only when you intend to write, and take a snapshot (keyboard_snapshot) first so every change is reversible. Enabling writes is at your own risk.

Disclaimer

Not affiliated with Semitek, GIM or Sharkoon. This is an independent, community project. Use at your own risk.

License

The code in this repository is released under the MIT License (see LICENSE).

This grant covers only the PerifMCP source code. It does not cover the keyboard vendor's firmware or model/lighting data, nor the Build/Data directory from pixeltris/GK6X. That data is not included in this repository and is not redistributed here; obtain it from its own source under its own terms.

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      Not graded
      quality
      C
      maintenance
      Enables AI assistants to inspect devices and automation rules, preview and apply changes, create backups, compare snapshots, and restore rules on a local MiJia gateway, with writes requiring confirmation.
      1
      MIT
    • A
      license
      A
      quality
      B
      maintenance
      Enables an AI agent to read and configure OpenDeck stream controller setups through natural language, covering keys, dials, profiles, Multi and Toggle Actions, app-based profile switching, and plugin management. Every change is staged, previewed as a diff, applied only after confirmation, and backed up so it can be undone.
      33
      40 PyPI
      1
      MIT
    • A
      license
      Not graded
      quality
      B
      maintenance
      Enables MCP clients to inspect and configure compatible Hall-effect keyboards over local USB HID, covering connection and firmware checks, calibration, Rapid Trigger, key mapping, diagnostics, profiles, and settings persistence. Standalone operation is read-only unless write access is explicitly enabled.
      1
      MIT