Skip to main content
Pre-release

This release is a pre-release and may not be stable for production use.

Grok Gadgets gateway

The connection point between your Grok Bot and your gadgets: a built-in simulated light, Linux gadgets and ESP32 devices. It serves six MCP tools. The owner tested USB and Wi-Fi hardware through the gateway. Grok Bot calls the six tools natively from the Mac and iPhone apps through serve --oauth behind a tunnel you run (record, project status). Independent project, not affiliated with SpaceXSI.

Writing style: ASD-STE100-inspired English. Use short sentences, active verbs and one instruction per step. This is not certified compliance.

Start here

Path Next step
Use a gadget Connect Grok Bot to the tested kit
Build a gadget Start with a simulated light
Run the gateway Keep a local gateway available

Install from PyPI

The package is on PyPI. Install it into a virtual environment with Python 3.11+. It is an alpha, so name the version or pass --pre:

python3 -m venv .venv
.venv/bin/python -m pip install --pre grok-gadgets-gateway
.venv/bin/grok-gadgets-gateway --version

Each GitHub release also has the wheel and SHA256SUMS; the PyPI files are the same build.

On an Intel Mac, cryptography has no prebuilt wheel and needs a Rust toolchain to build.

For your first simulator test, follow first success.

Quick start

For contributors: clone the source with Git and uv.

git clone https://github.com/adidshaft/grok-gadgets-gateway.git
cd grok-gadgets-gateway
uv sync --locked
uv run grok-gadgets-gateway init
uv run grok-gadgets-gateway serve --simulator
uv run grok-gadgets-gateway rehearse

Run rehearse in a second terminal while serve keeps running. It calls the six tools in the order Grok Bot will: list the gadgets, set the simulated light blue, read its state. See first success in five minutes.

How it works

flowchart LR
    B["Grok Bot on Mac or iPhone"] -->|HTTPS and OAuth| T["Owner-run tunnel"]
    T --> G["Gateway<br>Always-on server"]
    R["rehearse: local check"] --> G
    G --> S["Simulated light"]
    G --> D["Linux / ESP32 gadgets"]

The gateway gives Grok Bot six tools:

Tool What it does
gadgets_list_devices Lists gadgets, their commands and what each one does. Call it first.
gadgets_get_state Reads a gadget's last reported state and how fresh it is.
gadgets_command Sends a command and waits up to 3 seconds for the result.
gadgets_command_status Reads the result of a slower command later.
gadgets_read_events Reads button presses and other events in order.
gadgets_diagnostics A support report with no tokens, state or arguments.

A relay in accounts mode (serve --oauth --accounts) scopes every tool to the caller's own gadgets. It adds gadgets_claim, gadgets_remove, gadgets_share and gadgets_name. With gadgets_name you can say "the desk display" instead of an ID (relay host guide).

A result is the gadget's own report, not proof of a physical effect.

Connect a gadget

init prints two settings blocks with absolute paths. Use the first when the connector starts the gateway itself (stdio). Use the second for a running serve at http://127.0.0.1:8766/mcp, with the bearer token from ~/.config/grok-gadgets/mcp-token. init --client http prints just one.

Gadgets connect to 127.0.0.1:8765 with their own token:

uv run grok-gadgets-gateway enroll desk-lamp --token-file desk-lamp.token

enroll desk-lamp --rotate issues a new token for the same gadget. Write gadgets with the Linux SDK or the ESP32 SDK; the Linux SDK's dev command needs no token at all. Both ports are loopback only. A Wi-Fi gadget on your home network can use the opt-in TLS listener on one private address, serve --lan-listen; see Wi-Fi devices.

Grok Bot today

The owner tested Grok Bot local commands on 12 October 2026. Grok Bot ran rehearse on the Mac. Read the connection evidence. On 13 October 2026 Grok Bot also called the six tools natively from the Mac and the iPhone. It used an owner-run tunnel and serve --oauth, a sign-in that you approve on the Mac (tunnel guide). The owner tested this route for one day, including a phone call over cellular. The original Mac route needs an awake Mac. During its sleep check, calls failed; nothing was queued. An always-on relay now lets the kit work without the Mac. See the relay record. Phone setup passed on iPhone and Android; Grok Bot calls from Android remain untested. See the phone setup record and roadmap. Never expose port 8765. Read remote access and security first.

Troubleshooting

Symptom Next step
Not sure which command Run grok-gadgets-gateway --help. Use serve for a long-running process; stdio is for a connector that starts the gateway itself.
No simulated light Start with --simulator.
401 from rehearse Send Authorization: Bearer <token> with the exact contents of the token file.
Config rejected Use strict v1 JSON within the documented bounds.
Command still accepted or dispatched The gadget is slow. Poll gadgets_command_status; never resend with a new command ID.

Learn more

Community

Questions, build photos and ideas are welcome on r/GrokGadgets. Report bugs and request features in GitHub Issues. New here? Pick a good first issue and read CONTRIBUTING. Get help: SUPPORT. Contribute on the dev branch; main holds tagged stable releases (branches).

License and affiliation

Apache-2.0; see LICENSE and NOTICE. Grok Gadgets is an independent open-source project. It is not affiliated with, endorsed by or sponsored by SpaceXSI. We reconstructed the pre-publication commit dates; see the history record.

Project discussion

Ask questions and share gadget ideas in hub Discussions. Use this repository's issue forms for defects.

Metadata

Release files for grok-gadgets-gateway 0.1.0a21

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for grok-gadgets-gateway 0.1.0a21
File Size Uploaded Provenance
grok_gadgets_gateway-0.1.0a21.tar.gz 388.6 kB With provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for grok-gadgets-gateway 0.1.0a21
File Interpreter ABI Platform
grok_gadgets_gateway-0.1.0a21-py3-none-any.whl Python 3 none any Details

Total release size: 564.9 kB

Release files / grok_gadgets_gateway-0.1.0a21.tar.gz

Download URL grok_gadgets_gateway-0.1.0a21.tar.gz
Size 388.6 kB
Tags Source
SHA-256 checksum
How to use checksums
8c6a1a4761072c3fa568233908e703294c471593fa982fe13dba241e33ffdcc2
BLAKE2b-256 checksum
How to use checksums
34d51c2afb563d40aa602721153d6501819c07c33a3242fcf9403b717eca97cd
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 24, 2026.

Transparency log

Release files / grok_gadgets_gateway-0.1.0a21-py3-none-any.whl

Download URL grok_gadgets_gateway-0.1.0a21-py3-none-any.whl
Size 176.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
142dfd70dc4d4f10ff2833eeabf83fcd6829c5ea49f4fefb5a60ef374a5dc253
BLAKE2b-256 checksum
How to use checksums
3886adf452be7fa30e115e584d4882097a793967a32fc1c10c9042fbe109b7bb
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 24, 2026.

Transparency log

Security for grok-gadgets-gateway 0.1.0a21

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

All 2 files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for grok_gadgets_gateway-0.1.0a21.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 24, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page