labmcp-labjack 0.1.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- labmcp_labjack-0.1.0/.gitignore +15 -0
- labmcp_labjack-0.1.0/PKG-INFO +126 -0
- labmcp_labjack-0.1.0/README.md +113 -0
- labmcp_labjack-0.1.0/pyproject.toml +34 -0
- labmcp_labjack-0.1.0/server.json +46 -0
- labmcp_labjack-0.1.0/src/labmcp_labjack/__init__.py +1 -0
- labmcp_labjack-0.1.0/src/labmcp_labjack/driver.py +656 -0
- labmcp_labjack-0.1.0/src/labmcp_labjack/server.py +481 -0
- labmcp_labjack-0.1.0/src/labmcp_labjack/simulator.py +455 -0
- labmcp_labjack-0.1.0/tests/test_server.py +277 -0
|
@@ -0,0 +1,126 @@
|
|
|
1
|
+
Metadata-Version: 2.5
|
|
2
|
+
Name: labmcp-labjack
|
|
3
|
+
Version: 0.1.0
|
|
4
|
+
Summary: MCP server for LabJack T4, T7/T7-Pro and T8 DAQ devices (LJM): analog inputs, streaming, thermocouples, DACs and digital I/O with safety limits.
|
|
5
|
+
Project-URL: Homepage, https://github.com/K-Dense-AI/lab-instrument-mcps/tree/main/servers/engineering/labjack
|
|
6
|
+
Author: K-Dense and LabMCP contributors
|
|
7
|
+
License-Expression: Apache-2.0
|
|
8
|
+
Keywords: daq,data-acquisition,lab-instrument,labjack,ljm,mcp,t4,t7,t8
|
|
9
|
+
Requires-Python: >=3.10
|
|
10
|
+
Requires-Dist: labjack-ljm>=1.21
|
|
11
|
+
Requires-Dist: labmcp<0.2,>=0.1
|
|
12
|
+
Description-Content-Type: text/markdown
|
|
13
|
+
|
|
14
|
+
# LabJack T-series DAQ โ MCP Server
|
|
15
|
+
|
|
16
|
+
<!-- mcp-name: io.github.K-Dense-AI/labmcp-labjack -->
|
|
17
|
+
|
|
18
|
+
Let an AI agent read analog inputs, stream waveforms, read thermocouples, check digital lines and (with your permission) set DACs and digital outputs on **LabJack T4, T7/T7-Pro and T8** DAQ devices through LabJack's official **LJM** library.
|
|
19
|
+
|
|
20
|
+
| | |
|
|
21
|
+
|---|---|
|
|
22
|
+
| **Package** | `labmcp-labjack` |
|
|
23
|
+
| **Instruments** | LabJack T4, T7, T7-Pro, T8 (and their OEM versions) |
|
|
24
|
+
| **Interfaces** | USB, Ethernet, WiFi (T7-Pro) |
|
|
25
|
+
| **Protocol** | LJM library + T-series Modbus register map ([T-Series Datasheet](https://support.labjack.com/docs/t-series-datasheet), [register map `ljm_constants.json`](https://github.com/labjack/ljm_constants), [`labjack-ljm` Python wrapper](https://github.com/labjack/labjack-ljm-python)) |
|
|
26
|
+
| **Status** | ๐งช **simulated**: tested against a simulated LJM backend, not yet verified on hardware. [Report a hardware test](https://github.com/K-Dense-AI/lab-instrument-mcps/issues/new?template=hardware-verification.yml) |
|
|
27
|
+
|
|
28
|
+
## Try it without hardware
|
|
29
|
+
|
|
30
|
+
```bash
|
|
31
|
+
uvx labmcp-labjack --simulate --check
|
|
32
|
+
uvx labmcp-labjack --simulate --option sim_model=T8 --check # T4, T7, T7-Pro (default) or T8
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
The simulator wires a 2 V / 10 Hz sine to AIN0, a thermistor divider (~2.5 V) to AIN1, DAC0 back into AIN2, an LM34 cold-junction sensor to AIN3, and a ~37 ยฐC thermocouple to AIN0-AIN3 when the thermocouple feature is used. Other inputs are grounded.
|
|
36
|
+
|
|
37
|
+
## Connect your LabJack
|
|
38
|
+
|
|
39
|
+
1. **Install LJM** (the native library and USB driver) from [labjack.com/support/software/installers/ljm](https://labjack.com/support/software/installers/ljm). The `labjack-ljm` Python package is installed automatically with this server, but it needs that native library.
|
|
40
|
+
2. **Close other LabJack software** (Kipling, LJLogM, LJStreamM). A device can only be claimed by one process at a time over USB.
|
|
41
|
+
3. **Test the connection:**
|
|
42
|
+
```bash
|
|
43
|
+
uvx labmcp-labjack --check # first LabJack found
|
|
44
|
+
uvx labmcp-labjack --address 470012345 --check # by serial number
|
|
45
|
+
uvx labmcp-labjack --address 192.168.1.207 --option connection_type=ETHERNET --check
|
|
46
|
+
uvx labmcp-labjack --option device_type=T4 --check # only open a T4
|
|
47
|
+
```
|
|
48
|
+
`--address` is the LJM identifier: a serial number, an IP address, a device name, or `ANY` (the default).
|
|
49
|
+
|
|
50
|
+
## Add to your MCP client
|
|
51
|
+
|
|
52
|
+
**Claude Code**
|
|
53
|
+
```bash
|
|
54
|
+
claude mcp add labjack -- uvx labmcp-labjack --address 470012345
|
|
55
|
+
```
|
|
56
|
+
|
|
57
|
+
**Claude Desktop / Cursor / Windsurf** (`claude_desktop_config.json`, `.cursor/mcp.json`, โฆ)
|
|
58
|
+
```json
|
|
59
|
+
{
|
|
60
|
+
"mcpServers": {
|
|
61
|
+
"labjack": {
|
|
62
|
+
"command": "uvx",
|
|
63
|
+
"args": ["labmcp-labjack", "--address", "470012345"]
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
```
|
|
68
|
+
|
|
69
|
+
Add `--read-only` to allow measurements but block the DAC and digital-output tools (`set_outputs_safe` stays available). Add `--option safe_dio=FIO0,FIO1` to make `set_outputs_safe` always release those lines, even if another program drove them. For other clients, generate the snippet with `uvx labmcp config labjack --client vscode` (also `cursor`, `codex`, `claude-code`).
|
|
70
|
+
|
|
71
|
+
## Tools
|
|
72
|
+
|
|
73
|
+
<!-- TOOLS:START -->
|
|
74
|
+
| Tool | Kind | Description |
|
|
75
|
+
|---|---|---|
|
|
76
|
+
| `get_command_log` | ๐ read | Return the most recent raw commands sent to / replies received from the instrument (newest last). Useful for debugging and for recording what was done. |
|
|
77
|
+
| `get_connection_info` | ๐ read | Report which instrument is connected (identity, address, simulated or real), whether the server is read-only, and the active safety limits. Call this first. |
|
|
78
|
+
| `get_device_info` | ๐ read | Identify the connected LabJack (model, serial, firmware, connection) and list what it offers: analog inputs, valid input ranges, resolution indices, DAC range, digital lines and stream rate. Call this before configuring channels. |
|
|
79
|
+
| `read_analog_inputs` | ๐ read | Read one or more analog inputs once (command-response) and return volts. |
|
|
80
|
+
| `read_device_temperature` | ๐ read | Read the LabJack's internal temperature sensor (ยฐC, about ยฑ2 ยฐC) and the estimated ambient air temperature. On the T8 also returns the sensor next to each AIN terminal. Cannot be read while a stream is running. |
|
|
81
|
+
| `read_digital_inputs` | ๐ read | Report the logic level and direction (input/output/analog) of digital I/O lines. |
|
|
82
|
+
| `read_thermocouple` | ๐ read | Read a thermocouple with the T7/T8 AIN thermocouple extended feature (types B, C, E, J, K, N, R, S, T) and return ยฐC with the measured voltage and cold-junction temperature. |
|
|
83
|
+
| `reconnect` | ๐ safety | Close and re-open the connection to the instrument (e.g. after it was power cycled or a cable was re-plugged). |
|
|
84
|
+
| `set_digital_output` | โ ๏ธ hazard | Make a digital line an output and drive it high (3.3 V) or low (0 V). |
|
|
85
|
+
| `set_outputs_safe` | ๐ safety | Put the outputs in a safe state: stop any stream, set DAC0 and DAC1 to 0 V, and release every digital line this server drove (plus the `safe_dio` option lines) to input - or drive them low with dio_mode='low'. Use when finished or if anything looks wrong. |
|
|
86
|
+
| `stream_analog` | ๐ read | Acquire a hardware-timed waveform on one or more analog inputs (LJM stream mode) and return per-channel statistics plus a downsampled waveform; optionally save everything to CSV. |
|
|
87
|
+
| `write_dac` | โ ๏ธ hazard | Set an analog output (DAC0/DAC1) to a DC voltage. The output stays at this value until changed or `set_outputs_safe` is called. |
|
|
88
|
+
<!-- TOOLS:END -->
|
|
89
|
+
|
|
90
|
+
`get_connection_info`, `get_command_log` and `reconnect` are built into every LabMCP server. The command log records every LJM register read and write.
|
|
91
|
+
|
|
92
|
+
## Safety limits
|
|
93
|
+
|
|
94
|
+
| Limit | Default | Meaning |
|
|
95
|
+
|---|---|---|
|
|
96
|
+
| `max_dac_voltage_v` | 5 V | Highest DAC voltage an agent may set (hardware: T4/T7 0-5 V, T8 0-10 V) |
|
|
97
|
+
| `max_stream_duration_s` | 60 s | Longest hardware-timed stream |
|
|
98
|
+
| `max_scan_rate_hz` | 10 000 Hz | Highest stream scan rate (the device maximum still applies) |
|
|
99
|
+
|
|
100
|
+
Override at launch, e.g. `--limit max_dac_voltage_v=2.5`. Limits are checked before anything is sent. Streams are also capped at 2 million samples in total.
|
|
101
|
+
|
|
102
|
+
## Example prompts
|
|
103
|
+
|
|
104
|
+
- "Read AIN0-AIN3 on the ยฑ1 V range and tell me which channels look like they are floating."
|
|
105
|
+
- "Stream AIN0 and AIN1 at 5 kHz for 2 seconds, give me the RMS and peak-to-peak of each, and save the data to ~/data/run12.csv."
|
|
106
|
+
- "Read the type K thermocouple on AIN2 every 10 seconds for a minute and tell me whether it is still warming up."
|
|
107
|
+
- "Set DAC0 to 1.25 V, then check the loopback on AIN2 and report the error in millivolts."
|
|
108
|
+
- "Which digital lines are outputs right now, and what level are they at?"
|
|
109
|
+
- "We're done โ put all the outputs back in a safe state."
|
|
110
|
+
|
|
111
|
+
## Notes
|
|
112
|
+
|
|
113
|
+
- **Model differences are enforced.** Valid input ranges (`AIN#_RANGE`) and resolution indices come from LabJack's register map: T7 ยฑ10/ยฑ1/ยฑ0.1/ยฑ0.01 V and index 0-8 (T7-Pro 0-12, but 9-12 cannot stream); T8 ยฑ11 โฆ ยฑ0.018 V and index 0-16 (one index shared by all inputs); T4 fixed ranges (AIN0-3 ยฑ10 V, AIN4-11 0-2.5 V) and index 0-5. DAC range: T4/T7 0-5 V, T8 0-10 V.
|
|
114
|
+
- **Settings persist.** Range, resolution and differential settings made by `read_analog_inputs` stay on the device until changed or power-cycled. Omitted settings are left as they are; every reading reports what it was measured against (`GND`, the T7 negative input, or the T8's isolated terminal).
|
|
115
|
+
- **Reading digital lines never changes their direction.** `read_digital_inputs` uses the `DIO_STATE`/`DIO_DIRECTION` bitmasks. (Reading a single-line register such as `FIO3` would switch that line to input.)
|
|
116
|
+
- **T4 flexible I/O.** AIN4-AIN11 share terminals with FIO4-EIO3. The server refuses to read those AINs while the line is a digital output, because the read would switch it to analog and release whatever it drives.
|
|
117
|
+
- **`set_outputs_safe` default is `input`**, the T-series power-up state (input with pull-up). If an attached relay board treats a pulled-up input as "on", use `dio_mode="low"` instead.
|
|
118
|
+
- **Thermocouples** use the AIN extended feature (`AIN#_EF_INDEX` 20-30). With `cjc="internal"` the T7 uses `TEMPERATURE_DEVICE_K` and the T8 uses each channel's own terminal sensor; `cjc="lm34"` uses LabJack's LM34 conversion (55.56 K/V, 255.37 K). An open input returns `valid=false` (the device reports -9999).
|
|
119
|
+
- **Streams** follow LabJack's `stream_basic.py` example (internal clock, no trigger, auto settling). While a stream runs, command-response analog reads are blocked by the device. Skipped scans (buffer overflow) are reported and left empty.
|
|
120
|
+
- **Importing the LJM wrapper prints to stdout** if the native library is missing. The server redirects that import so the MCP stdio channel is never corrupted, and reports a clear install hint instead.
|
|
121
|
+
|
|
122
|
+
## Hardware verification
|
|
123
|
+
|
|
124
|
+
| Model | Firmware | Interface | Verified by | Date |
|
|
125
|
+
|---|---|---|---|---|
|
|
126
|
+
| *none yet: [be the first](https://github.com/K-Dense-AI/lab-instrument-mcps/issues/new?template=hardware-verification.yml)* | | | | |
|
|
@@ -0,0 +1,113 @@
|
|
|
1
|
+
# LabJack T-series DAQ โ MCP Server
|
|
2
|
+
|
|
3
|
+
<!-- mcp-name: io.github.K-Dense-AI/labmcp-labjack -->
|
|
4
|
+
|
|
5
|
+
Let an AI agent read analog inputs, stream waveforms, read thermocouples, check digital lines and (with your permission) set DACs and digital outputs on **LabJack T4, T7/T7-Pro and T8** DAQ devices through LabJack's official **LJM** library.
|
|
6
|
+
|
|
7
|
+
| | |
|
|
8
|
+
|---|---|
|
|
9
|
+
| **Package** | `labmcp-labjack` |
|
|
10
|
+
| **Instruments** | LabJack T4, T7, T7-Pro, T8 (and their OEM versions) |
|
|
11
|
+
| **Interfaces** | USB, Ethernet, WiFi (T7-Pro) |
|
|
12
|
+
| **Protocol** | LJM library + T-series Modbus register map ([T-Series Datasheet](https://support.labjack.com/docs/t-series-datasheet), [register map `ljm_constants.json`](https://github.com/labjack/ljm_constants), [`labjack-ljm` Python wrapper](https://github.com/labjack/labjack-ljm-python)) |
|
|
13
|
+
| **Status** | ๐งช **simulated**: tested against a simulated LJM backend, not yet verified on hardware. [Report a hardware test](https://github.com/K-Dense-AI/lab-instrument-mcps/issues/new?template=hardware-verification.yml) |
|
|
14
|
+
|
|
15
|
+
## Try it without hardware
|
|
16
|
+
|
|
17
|
+
```bash
|
|
18
|
+
uvx labmcp-labjack --simulate --check
|
|
19
|
+
uvx labmcp-labjack --simulate --option sim_model=T8 --check # T4, T7, T7-Pro (default) or T8
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
The simulator wires a 2 V / 10 Hz sine to AIN0, a thermistor divider (~2.5 V) to AIN1, DAC0 back into AIN2, an LM34 cold-junction sensor to AIN3, and a ~37 ยฐC thermocouple to AIN0-AIN3 when the thermocouple feature is used. Other inputs are grounded.
|
|
23
|
+
|
|
24
|
+
## Connect your LabJack
|
|
25
|
+
|
|
26
|
+
1. **Install LJM** (the native library and USB driver) from [labjack.com/support/software/installers/ljm](https://labjack.com/support/software/installers/ljm). The `labjack-ljm` Python package is installed automatically with this server, but it needs that native library.
|
|
27
|
+
2. **Close other LabJack software** (Kipling, LJLogM, LJStreamM). A device can only be claimed by one process at a time over USB.
|
|
28
|
+
3. **Test the connection:**
|
|
29
|
+
```bash
|
|
30
|
+
uvx labmcp-labjack --check # first LabJack found
|
|
31
|
+
uvx labmcp-labjack --address 470012345 --check # by serial number
|
|
32
|
+
uvx labmcp-labjack --address 192.168.1.207 --option connection_type=ETHERNET --check
|
|
33
|
+
uvx labmcp-labjack --option device_type=T4 --check # only open a T4
|
|
34
|
+
```
|
|
35
|
+
`--address` is the LJM identifier: a serial number, an IP address, a device name, or `ANY` (the default).
|
|
36
|
+
|
|
37
|
+
## Add to your MCP client
|
|
38
|
+
|
|
39
|
+
**Claude Code**
|
|
40
|
+
```bash
|
|
41
|
+
claude mcp add labjack -- uvx labmcp-labjack --address 470012345
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
**Claude Desktop / Cursor / Windsurf** (`claude_desktop_config.json`, `.cursor/mcp.json`, โฆ)
|
|
45
|
+
```json
|
|
46
|
+
{
|
|
47
|
+
"mcpServers": {
|
|
48
|
+
"labjack": {
|
|
49
|
+
"command": "uvx",
|
|
50
|
+
"args": ["labmcp-labjack", "--address", "470012345"]
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
Add `--read-only` to allow measurements but block the DAC and digital-output tools (`set_outputs_safe` stays available). Add `--option safe_dio=FIO0,FIO1` to make `set_outputs_safe` always release those lines, even if another program drove them. For other clients, generate the snippet with `uvx labmcp config labjack --client vscode` (also `cursor`, `codex`, `claude-code`).
|
|
57
|
+
|
|
58
|
+
## Tools
|
|
59
|
+
|
|
60
|
+
<!-- TOOLS:START -->
|
|
61
|
+
| Tool | Kind | Description |
|
|
62
|
+
|---|---|---|
|
|
63
|
+
| `get_command_log` | ๐ read | Return the most recent raw commands sent to / replies received from the instrument (newest last). Useful for debugging and for recording what was done. |
|
|
64
|
+
| `get_connection_info` | ๐ read | Report which instrument is connected (identity, address, simulated or real), whether the server is read-only, and the active safety limits. Call this first. |
|
|
65
|
+
| `get_device_info` | ๐ read | Identify the connected LabJack (model, serial, firmware, connection) and list what it offers: analog inputs, valid input ranges, resolution indices, DAC range, digital lines and stream rate. Call this before configuring channels. |
|
|
66
|
+
| `read_analog_inputs` | ๐ read | Read one or more analog inputs once (command-response) and return volts. |
|
|
67
|
+
| `read_device_temperature` | ๐ read | Read the LabJack's internal temperature sensor (ยฐC, about ยฑ2 ยฐC) and the estimated ambient air temperature. On the T8 also returns the sensor next to each AIN terminal. Cannot be read while a stream is running. |
|
|
68
|
+
| `read_digital_inputs` | ๐ read | Report the logic level and direction (input/output/analog) of digital I/O lines. |
|
|
69
|
+
| `read_thermocouple` | ๐ read | Read a thermocouple with the T7/T8 AIN thermocouple extended feature (types B, C, E, J, K, N, R, S, T) and return ยฐC with the measured voltage and cold-junction temperature. |
|
|
70
|
+
| `reconnect` | ๐ safety | Close and re-open the connection to the instrument (e.g. after it was power cycled or a cable was re-plugged). |
|
|
71
|
+
| `set_digital_output` | โ ๏ธ hazard | Make a digital line an output and drive it high (3.3 V) or low (0 V). |
|
|
72
|
+
| `set_outputs_safe` | ๐ safety | Put the outputs in a safe state: stop any stream, set DAC0 and DAC1 to 0 V, and release every digital line this server drove (plus the `safe_dio` option lines) to input - or drive them low with dio_mode='low'. Use when finished or if anything looks wrong. |
|
|
73
|
+
| `stream_analog` | ๐ read | Acquire a hardware-timed waveform on one or more analog inputs (LJM stream mode) and return per-channel statistics plus a downsampled waveform; optionally save everything to CSV. |
|
|
74
|
+
| `write_dac` | โ ๏ธ hazard | Set an analog output (DAC0/DAC1) to a DC voltage. The output stays at this value until changed or `set_outputs_safe` is called. |
|
|
75
|
+
<!-- TOOLS:END -->
|
|
76
|
+
|
|
77
|
+
`get_connection_info`, `get_command_log` and `reconnect` are built into every LabMCP server. The command log records every LJM register read and write.
|
|
78
|
+
|
|
79
|
+
## Safety limits
|
|
80
|
+
|
|
81
|
+
| Limit | Default | Meaning |
|
|
82
|
+
|---|---|---|
|
|
83
|
+
| `max_dac_voltage_v` | 5 V | Highest DAC voltage an agent may set (hardware: T4/T7 0-5 V, T8 0-10 V) |
|
|
84
|
+
| `max_stream_duration_s` | 60 s | Longest hardware-timed stream |
|
|
85
|
+
| `max_scan_rate_hz` | 10 000 Hz | Highest stream scan rate (the device maximum still applies) |
|
|
86
|
+
|
|
87
|
+
Override at launch, e.g. `--limit max_dac_voltage_v=2.5`. Limits are checked before anything is sent. Streams are also capped at 2 million samples in total.
|
|
88
|
+
|
|
89
|
+
## Example prompts
|
|
90
|
+
|
|
91
|
+
- "Read AIN0-AIN3 on the ยฑ1 V range and tell me which channels look like they are floating."
|
|
92
|
+
- "Stream AIN0 and AIN1 at 5 kHz for 2 seconds, give me the RMS and peak-to-peak of each, and save the data to ~/data/run12.csv."
|
|
93
|
+
- "Read the type K thermocouple on AIN2 every 10 seconds for a minute and tell me whether it is still warming up."
|
|
94
|
+
- "Set DAC0 to 1.25 V, then check the loopback on AIN2 and report the error in millivolts."
|
|
95
|
+
- "Which digital lines are outputs right now, and what level are they at?"
|
|
96
|
+
- "We're done โ put all the outputs back in a safe state."
|
|
97
|
+
|
|
98
|
+
## Notes
|
|
99
|
+
|
|
100
|
+
- **Model differences are enforced.** Valid input ranges (`AIN#_RANGE`) and resolution indices come from LabJack's register map: T7 ยฑ10/ยฑ1/ยฑ0.1/ยฑ0.01 V and index 0-8 (T7-Pro 0-12, but 9-12 cannot stream); T8 ยฑ11 โฆ ยฑ0.018 V and index 0-16 (one index shared by all inputs); T4 fixed ranges (AIN0-3 ยฑ10 V, AIN4-11 0-2.5 V) and index 0-5. DAC range: T4/T7 0-5 V, T8 0-10 V.
|
|
101
|
+
- **Settings persist.** Range, resolution and differential settings made by `read_analog_inputs` stay on the device until changed or power-cycled. Omitted settings are left as they are; every reading reports what it was measured against (`GND`, the T7 negative input, or the T8's isolated terminal).
|
|
102
|
+
- **Reading digital lines never changes their direction.** `read_digital_inputs` uses the `DIO_STATE`/`DIO_DIRECTION` bitmasks. (Reading a single-line register such as `FIO3` would switch that line to input.)
|
|
103
|
+
- **T4 flexible I/O.** AIN4-AIN11 share terminals with FIO4-EIO3. The server refuses to read those AINs while the line is a digital output, because the read would switch it to analog and release whatever it drives.
|
|
104
|
+
- **`set_outputs_safe` default is `input`**, the T-series power-up state (input with pull-up). If an attached relay board treats a pulled-up input as "on", use `dio_mode="low"` instead.
|
|
105
|
+
- **Thermocouples** use the AIN extended feature (`AIN#_EF_INDEX` 20-30). With `cjc="internal"` the T7 uses `TEMPERATURE_DEVICE_K` and the T8 uses each channel's own terminal sensor; `cjc="lm34"` uses LabJack's LM34 conversion (55.56 K/V, 255.37 K). An open input returns `valid=false` (the device reports -9999).
|
|
106
|
+
- **Streams** follow LabJack's `stream_basic.py` example (internal clock, no trigger, auto settling). While a stream runs, command-response analog reads are blocked by the device. Skipped scans (buffer overflow) are reported and left empty.
|
|
107
|
+
- **Importing the LJM wrapper prints to stdout** if the native library is missing. The server redirects that import so the MCP stdio channel is never corrupted, and reports a clear install hint instead.
|
|
108
|
+
|
|
109
|
+
## Hardware verification
|
|
110
|
+
|
|
111
|
+
| Model | Firmware | Interface | Verified by | Date |
|
|
112
|
+
|---|---|---|---|---|
|
|
113
|
+
| *none yet: [be the first](https://github.com/K-Dense-AI/lab-instrument-mcps/issues/new?template=hardware-verification.yml)* | | | | |
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
[project]
|
|
2
|
+
name = "labmcp-labjack"
|
|
3
|
+
version = "0.1.0"
|
|
4
|
+
description = "MCP server for LabJack T4, T7/T7-Pro and T8 DAQ devices (LJM): analog inputs, streaming, thermocouples, DACs and digital I/O with safety limits."
|
|
5
|
+
readme = "README.md"
|
|
6
|
+
license = "Apache-2.0"
|
|
7
|
+
requires-python = ">=3.10"
|
|
8
|
+
authors = [{ name = "K-Dense and LabMCP contributors" }]
|
|
9
|
+
keywords = ["mcp", "lab-instrument", "daq", "labjack", "ljm", "data-acquisition", "t7", "t4", "t8"]
|
|
10
|
+
dependencies = ["labmcp>=0.1,<0.2", "labjack-ljm>=1.21"]
|
|
11
|
+
|
|
12
|
+
[project.scripts]
|
|
13
|
+
labmcp-labjack = "labmcp_labjack.server:main"
|
|
14
|
+
|
|
15
|
+
[project.urls]
|
|
16
|
+
Homepage = "https://github.com/K-Dense-AI/lab-instrument-mcps/tree/main/servers/engineering/labjack"
|
|
17
|
+
|
|
18
|
+
[tool.labmcp]
|
|
19
|
+
name = "LabJack T-series DAQ"
|
|
20
|
+
domain = "engineering"
|
|
21
|
+
category = "Data acquisition"
|
|
22
|
+
vendor = "LabJack"
|
|
23
|
+
models = ["T4", "T7", "T7-Pro", "T8"]
|
|
24
|
+
interfaces = ["USB", "Ethernet", "WiFi (T7-Pro)"]
|
|
25
|
+
protocol = "LJM library (Modbus TCP register map)"
|
|
26
|
+
summary = "Read analog inputs, stream waveforms, read thermocouples and the device temperature, read/set digital I/O and set DACs, with voltage and stream limits."
|
|
27
|
+
status = "simulated"
|
|
28
|
+
|
|
29
|
+
[build-system]
|
|
30
|
+
requires = ["hatchling"]
|
|
31
|
+
build-backend = "hatchling.build"
|
|
32
|
+
|
|
33
|
+
[tool.hatch.build.targets.wheel]
|
|
34
|
+
packages = ["src/labmcp_labjack"]
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://static.modelcontextprotocol.io/schemas/2025-12-11/server.schema.json",
|
|
3
|
+
"name": "io.github.K-Dense-AI/labmcp-labjack",
|
|
4
|
+
"title": "LabJack T-series DAQ",
|
|
5
|
+
"description": "MCP server for LabJack T4, T7/T7-Pro and T8 DAQ devices (LJM): analog inputs, streaming, thermocoupl",
|
|
6
|
+
"version": "0.1.0",
|
|
7
|
+
"repository": {
|
|
8
|
+
"url": "https://github.com/K-Dense-AI/lab-instrument-mcps",
|
|
9
|
+
"source": "github",
|
|
10
|
+
"subfolder": "servers/engineering/labjack"
|
|
11
|
+
},
|
|
12
|
+
"websiteUrl": "https://github.com/K-Dense-AI/lab-instrument-mcps/tree/main/servers/engineering/labjack",
|
|
13
|
+
"packages": [
|
|
14
|
+
{
|
|
15
|
+
"registryType": "pypi",
|
|
16
|
+
"registryBaseUrl": "https://pypi.org",
|
|
17
|
+
"identifier": "labmcp-labjack",
|
|
18
|
+
"version": "0.1.0",
|
|
19
|
+
"transport": {
|
|
20
|
+
"type": "stdio"
|
|
21
|
+
},
|
|
22
|
+
"environmentVariables": [
|
|
23
|
+
{
|
|
24
|
+
"name": "LABMCP_ADDRESS",
|
|
25
|
+
"description": "Instrument address, e.g. serial:///dev/ttyUSB0 or tcp://192.168.1.50:5025",
|
|
26
|
+
"isRequired": false
|
|
27
|
+
},
|
|
28
|
+
{
|
|
29
|
+
"name": "LABMCP_SIMULATE",
|
|
30
|
+
"description": "Set to 1 to use the built-in simulator (no hardware)",
|
|
31
|
+
"isRequired": false
|
|
32
|
+
},
|
|
33
|
+
{
|
|
34
|
+
"name": "LABMCP_READ_ONLY",
|
|
35
|
+
"description": "Set to 1 to disable all state-changing tools",
|
|
36
|
+
"isRequired": false
|
|
37
|
+
},
|
|
38
|
+
{
|
|
39
|
+
"name": "LABMCP_LIMITS",
|
|
40
|
+
"description": "Safety limit overrides, e.g. max_temperature_c=80",
|
|
41
|
+
"isRequired": false
|
|
42
|
+
}
|
|
43
|
+
]
|
|
44
|
+
}
|
|
45
|
+
]
|
|
46
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"""LabMCP server for LabJack T-series DAQ devices (T4, T7/T7-Pro, T8) via the LJM library."""
|