Skip to main content
Glama

daq-mcp

An MCP server that lets an AI coding client talk to National Instruments DAQ hardware — with a safety model aimed at physical I/O, not just HTTP errors.

Not affiliated with, endorsed by, or supported by NI / Emerson. Licensed under the Apache License 2.0. See NOTICE for attribution.

Documentation: docs/ — architecture, safety, configuration, tool reference, devices, examples, limitations, troubleshooting, development history.

Portfolio-oriented stack notes: TECH_STACK.md.

Why this exists

Most MCP servers wrap APIs or filesystems. This one wraps data acquisition: list devices, read sensors, write digital/analog lines, stream a live signal. The protocol plumbing is straightforward; the interesting part is refusing unsafe writes, clamping analog output, and keeping agent and browser on the same allowlist.

Related MCP server: rigol-dho-mcp

Quick start (no hardware)

Requires Python 3.11+ and uv.

git clone https://github.com/rhit-folayaod/daq-mcp.git
cd daq-mcp
uv sync
DAQ_MCP_SIMULATE=1 uv run server.py
$env:DAQ_MCP_SIMULATE="1"; uv run server.py

Optional NI binding: uv sync --extra hardware (needs NI-DAQmx on the machine). If the driver is missing, the server falls back to simulation automatically.

Safety in one paragraph

Writes are off unless DAQ_MCP_ALLOW_WRITE=1. Only allowlisted channels are reachable; only channels marked as outputs are writable; analog output is clamped (±5 V by default). Configure channel roles with the dashboard picker or wiring tools — profiles stay local (gitignored). Details: docs/safety.md.

Tools (summary)

Area

Tools

Discovery

list_devices, describe_device, self_test

Analog in

read_analog, monitor_analog (measurement: voltage / strain / thermocouple / accelerometer)

Digital / AO

read_digital, write_digital, write_analog, animate_digital

Live

start_live, live_status, stop_live, save_capture, list_captures

Wiring

get_wiring, set_wiring, profile list / load / delete

Full parameter notes: docs/tools.md.

Live dashboard

DAQ_MCP_ALLOW_WRITE=1 uv run server.py --dashboard-only

Open http://127.0.0.1:8765/. For dashboard + MCP on one port (avoids two processes fighting over the device): uv run server.py --http → MCP at /mcp/. Remote access needs a token and/or a tunnel — docs/configuration.md.

Cursor

See .cursor/mcp.json.example and docs/configuration.md. Do not commit machine-local .cursor/mcp.json, tokens, or wiring profiles.

Tests

uv run pytest

Simulator-only; CI runs the same on main.

Layout

server.py              MCP tools + safety + entrypoint
src/daq_mcp/           backends, live, dashboard, wiring, captures, auth
docs/                  architecture, safety, config, tools, …
tests/                 pytest against the simulator

Contributing

See CONTRIBUTING.md.

Available Tools

8 tools
describe_deviceA

Describe one device's full channel inventory.

Returns available analog input, analog output, digital input, and digital output channels, plus voltage ranges and max sample rates. Use this to pick valid channel names before reading or writing.

Inputs: device (required). Returns: object

list_devicesA

List NI DAQ devices visible to this machine.

Returns the device name, product type, serial number, and which channel types it supports. Call this first — channel names are device-specific.

Inputs: no named parameters. Returns: result

monitor_analogA

Acquire a finite analog waveform and return summary statistics.

Built for the "is my sensor behaving?" question: returns mean, RMS, peak- to-peak, standard deviation, and a downsampled preview rather than the full sample array. Keeps large acquisitions out of the context window.

Inputs: channel (required), duration_s (required), rate_hz. Returns: object

read_analogA

Read voltage samples from an analog input channel.

channel: fully qualified, e.g. "Dev1/ai0" samples: how many samples to acquire (1 = single instantaneous reading) rate_hz: sample rate for multi-sample reads

Returns the samples plus min/mean/max, so the model can reason about the signal without pulling thousands of raw floats into context.

Inputs: channel (required), rate_hz, samples, terminal_config. Returns: object

read_digitalA

Read the current logic level of a digital input line.

channel: e.g. "Dev1/port0/line0" Returns {"channel": ..., "value": true/false}.

Inputs: channel (required). Returns: object

self_testB

Run the device's built-in self-test and report pass/fail.

Useful as a first diagnostic when reads return unexpected values.

Inputs: device (required). Returns: object

write_analogA

Set an analog output channel to a DC voltage.

Clamped to AO_VOLTAGE_LIMITS. Returns both the requested and the actual applied voltage, and flags whether clamping occurred — never silently changes the value the model asked for.

Inputs: channel (required), voltage (required). Returns: object

write_digitalA

Set a digital output line high or low.

Requires DAQ_MCP_ALLOW_WRITE=1. Returns the line's state after the write (read back from hardware, not echoed) so the model can confirm the effect.

Inputs: value (required), channel (required). Returns: object

Tool Schema Changelog

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

Loading tool schema changelog…

    TDQS

    A4/5.0

    Scored across 8 tools

    Disambiguation4/5

    Most tools clearly target distinct resources/actions: device enumeration, channel description, analog read/write, digital read/write, waveform analysis, and self-test. The only potential overlap is between read_analog and monitor_analog—both acquire analog signals and return summary statistics—but their descriptions clarify different use cases (raw samples vs. battery of descriptive statistics).

    Naming Consistency5/5

    All tool names follow a consistent snake_case verb_noun pattern (list_devices, describe_device, read_analog, write_analog, etc.). Even self_test fits the command-style, and there is no mixing of camelCase or inconsistent verb forms.

    Tool Count5/5

    Eight tools cover the core tasks for a DAQ MCP server—device discovery, channel inventory, analog/digital I/O, waveform monitoring, and diagnostics. This is a well-scoped set that avoids bloat while providing all essential operations.

    Completeness4/5

    The surface provides a full CRUD-like lifecycle for basic DAQ interactions: enumerate, describe, read, write, and test. Minor gaps exist such as no arbitrary analog waveform generation (write_analog only outputs DC) and no continuous acquisition mode, but these are not critical for typical agent use.

    Maintenance

    ActivityInactive
    ResponsivenessOutdated data

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      A
      quality
      D
      maintenance
      MCP server for controlling and reading Rigol DHO800/DHO900 oscilloscopes over LAN via SCPI commands.
      11
      2
      MIT
    • A
      license
      A
      quality
      D
      maintenance
      A safety-bounded MCP server for discovering data-acquisition devices and performing finite analog-voltage and digital-input reads through NI's nidaqmx Python package.
      9
      Apache 2.0