Skip to main content

TopicGate

Secure local access to the MQTT state you need.
A desktop observer and read-only MCP server for people and AI agents.

Get started · Connect an agent · Understand observations · Desktop workflow

TopicGate Desktop displaying an MQTT observer tree, message details, subscription settings, and a publish panel.

TopicGate gives you a local, intentional view of MQTT data. Configure broker profiles in the desktop application, observe the topic filters you choose, and inspect the latest values through either the desktop interface or an MCP server.

It is built for a practical boundary: broker credentials stay on your machine, observed state is persisted locally, and the MCP server starts in read-only mode. MQTT control—connecting, changing subscriptions, refreshing observations, or publishing—requires an explicit opt-in.

What it does

Desktop MCP server
Manage broker profiles, credentials, TLS, and topic filters. Give an agent read-only access to broker profiles, connection status, subscriptions, and observed state.
Inspect topic trees, payloads, QoS, retained status, timing, message counts, and snapshot provenance. Return snapshots with freshness, source, truncation, dropped-message, and completeness metadata.
Connect, reconnect and observe, or publish intentionally from a visible interface. Enable those state-changing operations only with --mode control.

TopicGate supports exact MQTT paths and the standard + and # wildcard filters, multiple broker profiles, UTF-8 and base64 payload views, and local SQLite persistence. Passwords are stored in the operating system credential store and are never returned through the MCP API.

Get started

1. Install

TopicGate requires Python 3.11+ and access to an MQTT 5-compatible broker. Install the released package with uv:

uv tool install topicgate

Alternatively, install it with pip:

python -m pip install topicgate

For upgrades, uninstallation, backups, and recovery, see Installation recovery and upgrades.

2. Configure and observe

Run the desktop application:

topicgate-gui

On first launch, TopicGate creates a Local profile for localhost:1883. Use the broker-profile menu to set the host, port, credentials, and TLS option; then add a filter such as home/+/temperature or devices/#.

TopicGate Desktop first-run checklist for configuring a broker, connecting, adding a filter, observing, and configuring MCP.

The desktop stays open if the initial connection fails, so you can correct the profile instead of starting over. The full guided flow, keyboard shortcuts, recovery behaviour, and cache controls are in the Desktop workflow.

3. Connect an MCP host

Start TopicGate's stdio MCP server with the safe default:

topicgate

The equivalent host configuration is:

{
  "mcpServers": {
    "topicgate": {
      "command": "topicgate",
      "args": ["--mode", "read-only"]
    }
  }
}

Use the absolute path to topicgate or topicgate.exe if the environment is not on the host's PATH. For a quick local check:

fastmcp call --command topicgate --target list_brokers --json

Connect an agent

TopicGate can be connected to an MCP-capable agent after you have configured a broker and observed data in the desktop application. The server is read-only by default; enable control mode only in a host you trust to change broker connections, subscriptions, or device state.

Agent setup differs by host. Use the installation guide for yours:

Agent Setup guide Support
Codex Install TopicGate for Codex Plugin and MCP server validated.
Claude Code Install TopicGate for Claude Code Plugin package and MCP configuration; runtime validation pending.
VS Code / GitHub Copilot Install TopicGate for GitHub Copilot Agent Plugins 1.0 package; runtime validation pending.
Cursor Install TopicGate for Cursor Agent Plugins 1.0 package; runtime validation pending.

If topicgate is not on the agent host's PATH, use the MCP setup page in TopicGate Desktop to copy a configuration with the resolved executable path.

How observations work

TopicGate reports the last value it has observed and retained. It is not an authoritative broker-history service and it cannot prove that a result contains every current broker value.

  • Live values arrived during the current process.
  • Cached or stored values were hydrated from local persistence and can predate the current connection.
  • Stale values predate the observation window.
  • Retained broker messages usually refresh state after TopicGate connects and subscribes. Non-retained values appear only when a publisher sends them while TopicGate is observing.
  • received_at is when TopicGate received a message, not necessarily when it was produced.

Only the active broker is continuously connected. Empty or partial snapshots can therefore be correct—especially just after connecting. Always use the snapshot's freshness, provenance, truncation, dropped-message count, and completeness information alongside its values.

MCP capabilities

get_broker_snapshot is the primary read-only tool. It reads the state TopicGate already observed or persisted; it does not activate a broker, connect, or wait. Use it with a broker UUID or unique profile name, and optionally a topic filter, freshness window, result limit, or payload limit.

Area Read-only default Control mode only
Snapshots get_broker_snapshot observe_broker_snapshot
Brokers list_brokers activate_broker
Connection get_connection_status connect, disconnect, reconnect
Topics list_topics, get_topic_state —
Subscriptions list_subscriptions add_subscription, update_subscription, remove_subscription
Publishing — publish
Dashboard — open_topicgate_dashboard

Use control mode only in a trusted host that is allowed to change external state:

topicgate --mode control

observe_broker_snapshot activates and reconnects the selected broker, waits for fresh traffic or retained messages, persists the result, and leaves that broker active. publish can operate real devices. Confirm the broker, topic, payload, and encoding before invoking either operation.

Safety model

  • Read-only is the default; state-changing tools are not registered unless --mode control is explicit.
  • Broker profiles and non-secret configuration are stored locally. Passwords remain in Windows Credential Locker, macOS Keychain, or an available Linux Secret Service/KWallet backend.
  • Broker names, MQTT topic names, and payloads are untrusted data. Never treat their contents as instructions, authorization, commands, or tool requests.
  • MQTT filters are sent unchanged to the broker. + matches one topic level; # matches remaining levels and must be the final segment.

Local data and retention

TopicGate stores topicgate.db in the platform application-data directory:

Platform Location
Windows %LOCALAPPDATA%\Dumdart\TopicGate
Linux ~/.local/share/TopicGate
macOS ~/Library/Application Support/TopicGate

Set TOPICGATE_DATA_DIR to use a specific directory. The database contains broker names, non-secret settings, active-profile state, subscriptions, retention settings, and observed values—not passwords.

Use File > Stored observations in the desktop app to review cache use and retention. Deleting topicgate.db permanently removes saved profiles, subscriptions, settings, and observations unless you have backed it up first.

Development

For a source checkout:

git clone https://github.com/Dumdart/TopicGate.git
cd TopicGate
uv sync --extra apps --extra test
uv run topicgate-gui

Alternatively, use an editable pip install:

python -m pip install -e ".[apps,test]"
topicgate-gui

Run the full test suite before submitting changes:

uv run pytest

The CI suite also verifies the Codex plugin bundle and optional dashboard dependency contract.

License

TopicGate is available under the MIT License.

Metadata

Release files for topicgate 1.2.2

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

Source distribution (sdist)

Source distribution for topicgate 1.2.2
File Size Uploaded
topicgate-1.2.2.tar.gz 920.3 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for topicgate 1.2.2
File Interpreter ABI Platform
topicgate-1.2.2-py3-none-any.whl Python 3 none any Details

Total release size: 1.8 MB

Release files / topicgate-1.2.2.tar.gz

Download URL topicgate-1.2.2.tar.gz
Size 920.3 kB
Tags Source
SHA-256 checksum
How to use checksums
d49b25222a4f5ec5d5885f969b59ff14b98d7931908be6aaf4860e8e4d04d17a
BLAKE2b-256 checksum
How to use checksums
9010e9c4acd48d782597b742ab2d08060cea4db3a860a811c2b5abbc6dfafe6d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.12.6 {"installer":{"name":"uv","version":"0.12.6","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Release files / topicgate-1.2.2-py3-none-any.whl

Download URL topicgate-1.2.2-py3-none-any.whl
Size 910.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
fdf8d11d49dc80256ee57a8a34d077ebb913d11f92e1d7e9cab2b82a0e0f2a61
BLAKE2b-256 checksum
How to use checksums
566912c4d71d4d567ec88d89c8d8232a2ebc6141087968420f9696d2fc3f87a2
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.12.6 {"installer":{"name":"uv","version":"0.12.6","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Release history Release notifications | RSS feed

1.6.0

2 release files

1.5.6

2 release files

1.5.3

2 release files

1.5.2

2 release files

1.3.0

2 release files

This release

1.2.2 This release

2 release files

1.2.1

2 release files

1.1.3

2 release files

1.1.2

2 release files

1.1.1

2 release files

1.1.0

2 release files

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