daqmx-mcp
# daqmx-mcp
> **Independent community project.** `daqmx-mcp` is not affiliated with, endorsed by, sponsored by, or supported by National Instruments. NI, NI-DAQmx, and related names are trademarks of National Instruments. This project includes no NI binaries, drivers, logos, or documentation. Users must obtain and license required NI software separately.
`daqmx-mcp` is a safety-bounded MCP server and Codex plugin for discovering data-acquisition devices and performing finite analog-voltage and digital-input reads through NI's supported `nidaqmx` Python package. Version 0.1.0 intentionally has no output, relay, reset, calibration, arbitrary property-write, continuous acquisition, shell, or Python-execution capability.
AI-generated hardware configurations require review by a qualified person. Tool results, including self-tests, are **not proof that a connected system is electrically safe**.
## Quick start: mock mode
Requires Python 3.10 or newer.
```bash
python -m venv .venv
# Linux/macOS: source .venv/bin/activate
# Windows PowerShell: .venv\Scripts\Activate.ps1
python -m pip install -e ".[dev]"
daqmx-mcp --check-config --config config.example.json
daqmx-mcp --config config.example.json
```
The final command is an STDIO MCP server and waits for an MCP client. To add the installed command to Codex:
```bash
codex mcp add daqmx-mcp --env DAQMX_MCP_CONFIG=/absolute/path/to/config.example.json -- daqmx-mcp
```
Do not copy the example absolute path literally. Codex desktop, CLI, and IDE extension share the same MCP configuration; the desktop and IDE settings also provide **MCP servers → Add server → STDIO**, followed by a restart.
## What works
- `get_server_status`, discovery, details, channel listing, self-test
- finite multi-channel analog-voltage acquisition with optional PFI digital start trigger
- one-shot software-timed digital input
- bounded statistics and sample previews
- new-file-only TDMS (preferred) and CSV recording inside one approved directory
- deterministic cross-platform mock backend
- lazy local backend that reports missing Python package/driver rather than breaking mock mode
- exact device/channel allowlists, structured errors, metadata-only audit events, and `finally` cleanup
No `stop_acquisition` tool is needed: every v0.1.0 acquisition is synchronous, finite, bounded, and owned by one tool transaction.
## Documentation
- [Architecture](docs/ARCHITECTURE.md)
- [Safety and threat model](docs/SAFETY.md)
- [Configuration](docs/CONFIGURATION.md)
- [Tool reference](docs/TOOLS.md)
- [Windows, NI-DAQmx, and simulated devices](docs/NI_DAQMX_SETUP.md)
- [Codex and plugin setup](docs/CODEX_SETUP.md)
- [Examples and limitations](docs/EXAMPLES.md)
- [Compatibility and verification](docs/COMPATIBILITY.md)
- [Troubleshooting](docs/TROUBLESHOOTING.md)
- [Roadmap](docs/ROADMAP.md)
- [Risk register](docs/RISK_REGISTER.md)
- [Reviewed references](docs/REFERENCES.md)
- [Release checklist](docs/RELEASING.md)
## Development
```bash
python -m pip install -e ".[dev]"
ruff format --check .
ruff check .
mypy src
pytest --cov=daqmx_mcp --cov-report=term-missing
python -m build
pip-audit
```
See [CONTRIBUTING.md](CONTRIBUTING.md). Apache-2.0 is used for original project code; dependency and separately installed NI software licenses remain their own.
TDQS
Scored across 9 tools
Every tool targets a distinct resource or action: device discovery, server status, channel listing, self-test, analog input, digital input, recording, and error explanation. The two analog voltage tools are differentiated by output (in-memory statistics vs. file creation), so no agent confusion.
All tool names follow a consistent verb_noun pattern in snake_case (e.g., list_devices, get_device_details, read_digital_inputs). Even compound verbs like self_test_device and record_analog_voltage adhere to the same pattern, making the API predictable.
With 9 tools, the server is well-scoped for a DAQmx interface, covering device management, input operations, recording, and diagnostics. The count is neither sparse nor bloated, and each tool earns its place.
Core workflows are covered: device discovery, channel enumeration, analog/digital input, recording to file, self-test, and error handling. However, analog/digital output and continuous acquisition are absent, which may be intentional for safety but represents a notable gap for a DAQmx server.