rs-scope-mcp 0.1.2__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.
- rs_scope_mcp-0.1.2/.github/workflows/ci.yml +30 -0
- rs_scope_mcp-0.1.2/.github/workflows/release.yml +77 -0
- rs_scope_mcp-0.1.2/.gitignore +9 -0
- rs_scope_mcp-0.1.2/.mcpbignore +19 -0
- rs_scope_mcp-0.1.2/CHANGELOG.md +50 -0
- rs_scope_mcp-0.1.2/COMMERCIAL.md +60 -0
- rs_scope_mcp-0.1.2/LICENSE +75 -0
- rs_scope_mcp-0.1.2/PKG-INFO +166 -0
- rs_scope_mcp-0.1.2/README.md +137 -0
- rs_scope_mcp-0.1.2/docs/ARCHITECTURE.md +127 -0
- rs_scope_mcp-0.1.2/docs/BENCH-NOTES.md +103 -0
- rs_scope_mcp-0.1.2/docs/DEMO.md +72 -0
- rs_scope_mcp-0.1.2/docs/rs-scope-api.md +1189 -0
- rs_scope_mcp-0.1.2/icon.png +0 -0
- rs_scope_mcp-0.1.2/manifest.json +94 -0
- rs_scope_mcp-0.1.2/pyproject.toml +66 -0
- rs_scope_mcp-0.1.2/scripts/acceptance_test.py +309 -0
- rs_scope_mcp-0.1.2/scripts/extract_scpi.py +486 -0
- rs_scope_mcp-0.1.2/scripts/field_guide_shots.py +316 -0
- rs_scope_mcp-0.1.2/scripts/gen_api_docs.py +402 -0
- rs_scope_mcp-0.1.2/server.json +44 -0
- rs_scope_mcp-0.1.2/skills/bus-reverse-engineering/SKILL.md +127 -0
- rs_scope_mcp-0.1.2/skills/embedded-bringup/SKILL.md +109 -0
- rs_scope_mcp-0.1.2/skills/ham-bench/SKILL.md +121 -0
- rs_scope_mcp-0.1.2/skills/scope-operating/SKILL.md +127 -0
- rs_scope_mcp-0.1.2/src/rs_scope_mcp/__init__.py +13 -0
- rs_scope_mcp-0.1.2/src/rs_scope_mcp/analysis.py +377 -0
- rs_scope_mcp-0.1.2/src/rs_scope_mcp/cli.py +166 -0
- rs_scope_mcp-0.1.2/src/rs_scope_mcp/data/__init__.py +0 -0
- rs_scope_mcp-0.1.2/src/rs_scope_mcp/data/rtb2/__init__.py +0 -0
- rs_scope_mcp-0.1.2/src/rs_scope_mcp/data/rtb2/commands.json +24265 -0
- rs_scope_mcp-0.1.2/src/rs_scope_mcp/data/rtb2/firmware/RTB2004-03.000.tree +3202 -0
- rs_scope_mcp-0.1.2/src/rs_scope_mcp/data/rtb2/overrides.json +242 -0
- rs_scope_mcp-0.1.2/src/rs_scope_mcp/demo.py +240 -0
- rs_scope_mcp-0.1.2/src/rs_scope_mcp/instrument.py +302 -0
- rs_scope_mcp-0.1.2/src/rs_scope_mcp/registry.py +531 -0
- rs_scope_mcp-0.1.2/src/rs_scope_mcp/scope.py +492 -0
- rs_scope_mcp-0.1.2/src/rs_scope_mcp/server.py +671 -0
- rs_scope_mcp-0.1.2/src/rs_scope_mcp/sim.py +481 -0
- rs_scope_mcp-0.1.2/src/rs_scope_mcp/store.py +228 -0
- rs_scope_mcp-0.1.2/src/rs_scope_mcp/transport.py +176 -0
- rs_scope_mcp-0.1.2/tests/data/pod1-i2c.npy +0 -0
- rs_scope_mcp-0.1.2/tests/data/pod1-servo.npy +0 -0
- rs_scope_mcp-0.1.2/tests/data/pod1-spi.npy +0 -0
- rs_scope_mcp-0.1.2/tests/data/pod1-uart.npy +0 -0
- rs_scope_mcp-0.1.2/tests/data/pods.json +18 -0
- rs_scope_mcp-0.1.2/tests/test_instrument_sim.py +144 -0
- rs_scope_mcp-0.1.2/tests/test_packaging.py +26 -0
- rs_scope_mcp-0.1.2/tests/test_registry.py +153 -0
- rs_scope_mcp-0.1.2/tests/test_task_tools.py +194 -0
- rs_scope_mcp-0.1.2/uv.lock +1915 -0
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
name: CI
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
branches: [main]
|
|
6
|
+
pull_request:
|
|
7
|
+
|
|
8
|
+
jobs:
|
|
9
|
+
test:
|
|
10
|
+
runs-on: ubuntu-latest
|
|
11
|
+
strategy:
|
|
12
|
+
fail-fast: false
|
|
13
|
+
matrix:
|
|
14
|
+
python-version: ["3.10", "3.11", "3.12"]
|
|
15
|
+
steps:
|
|
16
|
+
- uses: actions/checkout@v4
|
|
17
|
+
|
|
18
|
+
- name: Install uv
|
|
19
|
+
uses: astral-sh/setup-uv@v5
|
|
20
|
+
with:
|
|
21
|
+
python-version: ${{ matrix.python-version }}
|
|
22
|
+
|
|
23
|
+
- name: Sync dependencies
|
|
24
|
+
run: uv sync
|
|
25
|
+
|
|
26
|
+
- name: Lint
|
|
27
|
+
run: uv run ruff check .
|
|
28
|
+
|
|
29
|
+
- name: Test
|
|
30
|
+
run: uv run pytest
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
name: Release
|
|
2
|
+
|
|
3
|
+
# Publishes the sdist + wheel to PyPI. Fires when a GitHub Release is published
|
|
4
|
+
# (`gh release create vX.Y.Z`), or by hand from the Actions tab / `gh workflow run`.
|
|
5
|
+
# The release tag's version must match pyproject.toml.
|
|
6
|
+
#
|
|
7
|
+
# Auth: the PYPI_API_TOKEN repository secret. Trusted Publishing (OIDC) is also
|
|
8
|
+
# wired (id-token: write); to switch to it, register the publisher on pypi.org
|
|
9
|
+
# (workflow release.yml, environment release) and delete the `password:` line.
|
|
10
|
+
|
|
11
|
+
on:
|
|
12
|
+
release:
|
|
13
|
+
types: [published]
|
|
14
|
+
workflow_dispatch:
|
|
15
|
+
|
|
16
|
+
jobs:
|
|
17
|
+
publish:
|
|
18
|
+
runs-on: ubuntu-latest
|
|
19
|
+
environment: release
|
|
20
|
+
permissions:
|
|
21
|
+
id-token: write
|
|
22
|
+
contents: read
|
|
23
|
+
steps:
|
|
24
|
+
- uses: actions/checkout@v4
|
|
25
|
+
|
|
26
|
+
- name: Install uv
|
|
27
|
+
uses: astral-sh/setup-uv@v5
|
|
28
|
+
with:
|
|
29
|
+
python-version: "3.12"
|
|
30
|
+
|
|
31
|
+
- name: Check tag matches pyproject version
|
|
32
|
+
if: startsWith(github.ref, 'refs/tags/')
|
|
33
|
+
run: |
|
|
34
|
+
v=$(python3 -c "import tomllib;print(tomllib.load(open('pyproject.toml','rb'))['project']['version'])")
|
|
35
|
+
test "v$v" = "${GITHUB_REF_NAME}" || { echo "tag ${GITHUB_REF_NAME} != v$v"; exit 1; }
|
|
36
|
+
|
|
37
|
+
- name: Build sdist + wheel
|
|
38
|
+
run: uv build
|
|
39
|
+
|
|
40
|
+
- name: Publish to PyPI
|
|
41
|
+
uses: pypa/gh-action-pypi-publish@release/v1
|
|
42
|
+
with:
|
|
43
|
+
password: ${{ secrets.PYPI_API_TOKEN }}
|
|
44
|
+
|
|
45
|
+
# Builds the Claude Desktop extension (.mcpb) and the skill files and attaches them
|
|
46
|
+
# to the release that triggered this run. The ae5vg.com Downloads page reads the
|
|
47
|
+
# asset list from the `releases/latest` API, so a release with no asset shows nothing.
|
|
48
|
+
bundle:
|
|
49
|
+
if: ${{ github.event_name == 'release' }}
|
|
50
|
+
runs-on: ubuntu-latest
|
|
51
|
+
permissions:
|
|
52
|
+
contents: write # upload a release asset
|
|
53
|
+
steps:
|
|
54
|
+
- uses: actions/checkout@v4
|
|
55
|
+
- uses: actions/setup-node@v4
|
|
56
|
+
with:
|
|
57
|
+
node-version: "20"
|
|
58
|
+
- name: Check the tag matches manifest.json, pyproject.toml and server.json
|
|
59
|
+
if: ${{ !github.event.release.prerelease }}
|
|
60
|
+
run: |
|
|
61
|
+
tag="${GITHUB_REF_NAME#v}"
|
|
62
|
+
manifest=$(python3 -c 'import json;print(json.load(open("manifest.json"))["version"])')
|
|
63
|
+
pyproject=$(python3 -c 'import tomllib;print(tomllib.load(open("pyproject.toml","rb"))["project"]["version"])')
|
|
64
|
+
registry=$(python3 -c 'import json;d=json.load(open("server.json"));print(d["version"],d["packages"][0]["version"])')
|
|
65
|
+
echo "tag=$tag manifest=$manifest pyproject=$pyproject server.json=$registry"
|
|
66
|
+
test "$tag" = "$manifest"
|
|
67
|
+
test "$tag" = "$pyproject"
|
|
68
|
+
for v in $registry; do test "$tag" = "$v" || exit 1; done
|
|
69
|
+
- name: Build the desktop extension
|
|
70
|
+
run: npx --yes @anthropic-ai/mcpb pack
|
|
71
|
+
- name: Zip each operating skill
|
|
72
|
+
# A .mcpb does not install its skills, so each skill is also a download of its own.
|
|
73
|
+
run: (cd skills && for s in */; do s="${s%/}"; zip -qr "../$s.skill" "$s" -x '*.DS_Store'; done)
|
|
74
|
+
- name: Attach to the release
|
|
75
|
+
env:
|
|
76
|
+
GH_TOKEN: ${{ github.token }}
|
|
77
|
+
run: gh release upload "$GITHUB_REF_NAME" ./*.mcpb ./*.skill --clobber
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
# Files excluded from the packaged .mcpb bundle
|
|
2
|
+
.git/
|
|
3
|
+
.venv/
|
|
4
|
+
__pycache__/
|
|
5
|
+
*.py[cod]
|
|
6
|
+
.ruff_cache/
|
|
7
|
+
.pytest_cache/
|
|
8
|
+
tests/
|
|
9
|
+
*.egg-info/
|
|
10
|
+
build/
|
|
11
|
+
dist/
|
|
12
|
+
.DS_Store
|
|
13
|
+
icon_*.png
|
|
14
|
+
# dev tooling and documentation assets, not part of the extension
|
|
15
|
+
scripts/
|
|
16
|
+
docs/field-guide/
|
|
17
|
+
docs/demo/
|
|
18
|
+
docs/*.pdf
|
|
19
|
+
.github/
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
# Changelog
|
|
2
|
+
|
|
3
|
+
## 0.1.2 (2026-11-23)
|
|
4
|
+
|
|
5
|
+
Found by the new 40-check acceptance suite run end to end on an RTB2004:
|
|
6
|
+
|
|
7
|
+
- Mode changes (`DEV:MODE`, `SPEC`, `BPL:ENAB`, `MASK:STAT`, `DISP:MODE`) wait for completion;
|
|
8
|
+
commands sent during the switch failed with -221.
|
|
9
|
+
- Leaving the Bode application restores the setup saved before the sweep (the Bode application
|
|
10
|
+
locks the memory to 75 kSa and changes channel and generator settings).
|
|
11
|
+
- `mask create` builds the envelope itself, returns to normal acquisition and self-checks the mask;
|
|
12
|
+
the -221 recovery no longer re-learns the mask from the signal under test.
|
|
13
|
+
- `capture` switches bus decoding on before acquiring.
|
|
14
|
+
- `identify`: idle levels from the longest clock pause or the level before the first edge (short
|
|
15
|
+
records that start mid-transfer); chip select is the line that holds while the clock runs.
|
|
16
|
+
- Text previews use the low 8 bits of 9-bit UART words.
|
|
17
|
+
- Skills: notes on self-checked masks, the Bode restore, incomplete frames and parallel glitches.
|
|
18
|
+
- `scripts/acceptance_test.py`: 40 checks in five groups; real-capture regression fixtures.
|
|
19
|
+
- scope-operating skill: the generator load note had the direction reversed (`HIGHz` into a
|
|
20
|
+
terminator reads half, `R50` into an open input reads double).
|
|
21
|
+
- Docs: Field Guide PDF; API reference section 3 expanded with the bench findings above.
|
|
22
|
+
|
|
23
|
+
## 0.1.1
|
|
24
|
+
|
|
25
|
+
- `measure` takes a fresh single acquisition when the scope is stopped (a stopped record may not
|
|
26
|
+
contain the source, for example after a capture with that channel off).
|
|
27
|
+
- `history` stops the acquisition first (history queries are rejected while it runs); `mask test`
|
|
28
|
+
with `keep_failed` stops at the end so the stored failures stay frozen.
|
|
29
|
+
- Desktop extension: display name without a slash (it broke the launch), data folder defaults to
|
|
30
|
+
`${HOME}/rs-scope-data` and is created on first use.
|
|
31
|
+
- `scripts/acceptance_test.py`: 21 checks on real hardware through the MCP protocol.
|
|
32
|
+
|
|
33
|
+
## 0.1.0
|
|
34
|
+
|
|
35
|
+
First release. Supported and bench-tested: R&S RTB2 / RTB2000 series (RTB2004, firmware 03.000).
|
|
36
|
+
|
|
37
|
+
- Complete SCPI foundation: the user manual's command chapter (749 command blocks, 962 headers) with
|
|
38
|
+
the firmware's own command tree overlaid (408 undocumented command families) and bench-verified
|
|
39
|
+
corrections. Every command is validated before it is sent; rejected queries are detected in about
|
|
40
|
+
2 ms; guarded commands need confirmation.
|
|
41
|
+
- Task tools: `capture`, `measure`, `spectrum`, `bode`, `mask`, `history`, `data`, `session`,
|
|
42
|
+
`setup`, `demo`, plus the foundation tools `connection`, `scpi`, `scpi_search`, `scpi_describe`,
|
|
43
|
+
`scpi_block`, `screenshot`.
|
|
44
|
+
- Local data store (SQLite catalog and sample files) with summaries first and drill-down on request.
|
|
45
|
+
- Demo mode with analog and full (logic probe) scene sets.
|
|
46
|
+
- `data` actions `envelope` (AM depth, keying rise/fall, crest factor) and `identify` (I2C, SPI, UART with baud, PWM/servo, clock from logic edges), bench-verified.
|
|
47
|
+
- Skills: scope-operating, ham-bench, bus-reverse-engineering, embedded-bringup.
|
|
48
|
+
- `rs-scope` command line for bench checks, the demo and screenshots; a registry-driven simulator.
|
|
49
|
+
- Licensed under PolyForm Noncommercial 1.0.0: free for hobbyists; commercial licensing through
|
|
50
|
+
Westlake Professionals.
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
# Commercial use
|
|
2
|
+
|
|
3
|
+
rs-scope-mcp is free for hobbyists. Commercial use needs a license.
|
|
4
|
+
|
|
5
|
+
rs-scope-mcp is licensed under the [PolyForm Noncommercial License 1.0.0](LICENSE). The
|
|
6
|
+
[LICENSE](LICENSE) file is the binding text. This page explains it in plain words and lists what
|
|
7
|
+
you can buy. If the two ever seem to disagree, or you are not sure which side of the line you are
|
|
8
|
+
on, ask before you rely on either.
|
|
9
|
+
|
|
10
|
+
## Free to use
|
|
11
|
+
|
|
12
|
+
You do not need a license, a key or a registration to use rs-scope-mcp for:
|
|
13
|
+
|
|
14
|
+
- **Personal use and hobby projects.** Your own oscilloscope, your own bench, your own learning.
|
|
15
|
+
- **Amateur radio.** Your station, a club station, Field Day and contests, and volunteer
|
|
16
|
+
emergency communication.
|
|
17
|
+
- **Education.** Schools, colleges and universities, their students and teachers, and courses
|
|
18
|
+
that teach electronics, radio or embedded systems.
|
|
19
|
+
- **Nonprofit and public organizations.** Charitable organizations, public research
|
|
20
|
+
organizations, public safety and health organizations, environmental protection organizations
|
|
21
|
+
and government institutions.
|
|
22
|
+
|
|
23
|
+
Free use includes changing the software and sharing it, as long as whoever gets a copy also gets
|
|
24
|
+
the license and the `Required Notice:` line.
|
|
25
|
+
|
|
26
|
+
## Needs a commercial license
|
|
27
|
+
|
|
28
|
+
Any use by a business or for a business needs a commercial license. That includes:
|
|
29
|
+
|
|
30
|
+
- **Internal use.** Engineers using it on the company's oscilloscopes, in development, on a test
|
|
31
|
+
bench, in production test, or in a lab.
|
|
32
|
+
- **Work for clients.** Consultants, contractors, design houses and test labs using it on
|
|
33
|
+
customer hardware or in customer projects.
|
|
34
|
+
- **Products and services.** Shipping it with test equipment or a product, building it into an
|
|
35
|
+
automated test system, or running it as part of a service you sell.
|
|
36
|
+
- **Business use on a personal machine.** If the work is for your employer or your customers, it
|
|
37
|
+
needs a license, even on your own laptop and your own time.
|
|
38
|
+
|
|
39
|
+
If you are not sure, assume a license is needed and ask. Most questions take one email.
|
|
40
|
+
|
|
41
|
+
## What you can buy
|
|
42
|
+
|
|
43
|
+
- **Commercial license.** Annual, per company. Covers the company and its employees, with every
|
|
44
|
+
release published during the term.
|
|
45
|
+
- **Support for more instruments.** Other Rohde & Schwarz oscilloscope families, or other
|
|
46
|
+
vendors' instruments, brought to the same standard: complete command registry, firmware
|
|
47
|
+
overlay, bench-verified behavior and a simulator, verified on your hardware.
|
|
48
|
+
- **Custom skills and integrations.** Measurement and test procedures written as skills for your
|
|
49
|
+
products, data export into your tools, and integration with your test automation.
|
|
50
|
+
- **Support plans.** Help with deployment, answers when an instrument does something unexpected,
|
|
51
|
+
and priority fixes.
|
|
52
|
+
|
|
53
|
+
## How to buy
|
|
54
|
+
|
|
55
|
+
Commercial licenses, instrument support, custom work and support plans are sold through
|
|
56
|
+
**Westlake Professionals**: [westlakeprofessionals.com](https://westlakeprofessionals.com).
|
|
57
|
+
|
|
58
|
+
rs-scope-mcp is an independent project and is not affiliated with or endorsed by Rohde & Schwarz.
|
|
59
|
+
|
|
60
|
+
73 de AE5VG
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
Required Notice: Copyright Stefan Brunner (AE5VG)
|
|
2
|
+
|
|
3
|
+
# PolyForm Noncommercial License 1.0.0
|
|
4
|
+
|
|
5
|
+
<https://polyformproject.org/licenses/noncommercial/1.0.0>
|
|
6
|
+
|
|
7
|
+
## Acceptance
|
|
8
|
+
|
|
9
|
+
In order to get any license under these terms, you must agree to them as both strict obligations and conditions to all your licenses.
|
|
10
|
+
|
|
11
|
+
## Copyright License
|
|
12
|
+
|
|
13
|
+
The licensor grants you a copyright license for the software to do everything you might do with the software that would otherwise infringe the licensor's copyright in it for any permitted purpose. However, you may only distribute the software according to [Distribution License](#distribution-license) and make changes or new works based on the software according to [Changes and New Works License](#changes-and-new-works-license).
|
|
14
|
+
|
|
15
|
+
## Distribution License
|
|
16
|
+
|
|
17
|
+
The licensor grants you an additional copyright license to distribute copies of the software. Your license to distribute covers distributing the software with changes and new works permitted by [Changes and New Works License](#changes-and-new-works-license).
|
|
18
|
+
|
|
19
|
+
## Notices
|
|
20
|
+
|
|
21
|
+
You must ensure that anyone who gets a copy of any part of the software from you also gets a copy of these terms or the URL for them above, as well as copies of any plain-text lines beginning with `Required Notice:` that the licensor provided with the software. For example:
|
|
22
|
+
|
|
23
|
+
> Required Notice: Copyright Yoyodyne, Inc. (http://example.com)
|
|
24
|
+
|
|
25
|
+
## Changes and New Works License
|
|
26
|
+
|
|
27
|
+
The licensor grants you an additional copyright license to make changes and new works based on the software for any permitted purpose.
|
|
28
|
+
|
|
29
|
+
## Patent License
|
|
30
|
+
|
|
31
|
+
The licensor grants you a patent license for the software that covers patent claims the licensor can license, or becomes able to license, that you would infringe by using the software.
|
|
32
|
+
|
|
33
|
+
## Noncommercial Purposes
|
|
34
|
+
|
|
35
|
+
Any noncommercial purpose is a permitted purpose.
|
|
36
|
+
|
|
37
|
+
## Personal Uses
|
|
38
|
+
|
|
39
|
+
Personal use for research, experiment, and testing for the benefit of public knowledge, personal study, private entertainment, hobby projects, amateur pursuits, or religious observance, without any anticipated commercial application, is use for a permitted purpose.
|
|
40
|
+
|
|
41
|
+
## Noncommercial Organizations
|
|
42
|
+
|
|
43
|
+
Use by any charitable organization, educational institution, public research organization, public safety or health organization, environmental protection organization, or government institution is use for a permitted purpose regardless of the source of funding or obligations resulting from the funding.
|
|
44
|
+
|
|
45
|
+
## Fair Use
|
|
46
|
+
|
|
47
|
+
You may have "fair use" rights for the software under the law. These terms do not limit them.
|
|
48
|
+
|
|
49
|
+
## No Other Rights
|
|
50
|
+
|
|
51
|
+
These terms do not allow you to sublicense or transfer any of your licenses to anyone else, or prevent the licensor from granting licenses to anyone else. These terms do not imply any other licenses.
|
|
52
|
+
|
|
53
|
+
## Patent Defense
|
|
54
|
+
|
|
55
|
+
If you make any written claim that the software infringes or contributes to infringement of any patent, your patent license for the software granted under these terms ends immediately. If your company makes such a claim, your patent license ends immediately for work on behalf of your company.
|
|
56
|
+
|
|
57
|
+
## Violations
|
|
58
|
+
|
|
59
|
+
The first time you are notified in writing that you have violated any of these terms, or done anything with the software not covered by your licenses, your licenses can nonetheless continue if you come into full compliance with these terms, and take practical steps to correct past violations, within 32 days of receiving notice. Otherwise, all your licenses end immediately.
|
|
60
|
+
|
|
61
|
+
## No Liability
|
|
62
|
+
|
|
63
|
+
***As far as the law allows, the software comes as is, without any warranty or condition, and the licensor will not be liable to you for any damages arising out of these terms or the use or nature of the software, under any kind of legal claim.***
|
|
64
|
+
|
|
65
|
+
## Definitions
|
|
66
|
+
|
|
67
|
+
The **licensor** is the individual or entity offering these terms, and the **software** is the software the licensor makes available under these terms.
|
|
68
|
+
|
|
69
|
+
**You** refers to the individual or entity agreeing to these terms.
|
|
70
|
+
|
|
71
|
+
**Your company** is any legal entity, sole proprietorship, or other kind of organization that you work for, plus all organizations that have control over, are under the control of, or are under common control with that organization. **Control** means ownership of substantially all the assets of an entity, or the power to direct its management and policies by vote, contract, or otherwise. Control can be direct or indirect.
|
|
72
|
+
|
|
73
|
+
**Your licenses** are all the licenses granted to you for the software under these terms.
|
|
74
|
+
|
|
75
|
+
**Use** means anything you do with the software requiring one of your licenses.
|
|
@@ -0,0 +1,166 @@
|
|
|
1
|
+
Metadata-Version: 2.5
|
|
2
|
+
Name: rs-scope-mcp
|
|
3
|
+
Version: 0.1.2
|
|
4
|
+
Summary: MCP server that lets Claude and other AI assistants control Rohde & Schwarz oscilloscopes (RTB2 / RTB2000 series) over LAN and harvest what they measure.
|
|
5
|
+
Project-URL: Homepage, https://github.com/sbrunner-atx/rs-scope-mcp
|
|
6
|
+
Project-URL: Documentation, https://github.com/sbrunner-atx/rs-scope-mcp#readme
|
|
7
|
+
Project-URL: Repository, https://github.com/sbrunner-atx/rs-scope-mcp
|
|
8
|
+
Project-URL: Issues, https://github.com/sbrunner-atx/rs-scope-mcp/issues
|
|
9
|
+
Project-URL: Changelog, https://github.com/sbrunner-atx/rs-scope-mcp/blob/main/CHANGELOG.md
|
|
10
|
+
Project-URL: Commercial use, https://github.com/sbrunner-atx/rs-scope-mcp/blob/main/COMMERCIAL.md
|
|
11
|
+
Author: Stefan Brunner (AE5VG)
|
|
12
|
+
License-Expression: PolyForm-Noncommercial-1.0.0
|
|
13
|
+
License-File: LICENSE
|
|
14
|
+
Keywords: ae5vg,ai-assistant,amateur-radio,claude,embedded,ham-radio,mcp,model-context-protocol,oscilloscope,reverse-engineering,rohde-schwarz,rtb2,rtb2000,rtb2002,rtb2004,scpi
|
|
15
|
+
Classifier: Development Status :: 2 - Pre-Alpha
|
|
16
|
+
Classifier: Intended Audience :: Developers
|
|
17
|
+
Classifier: Intended Audience :: Science/Research
|
|
18
|
+
Classifier: License :: Other/Proprietary License
|
|
19
|
+
Classifier: Programming Language :: Python :: 3 :: Only
|
|
20
|
+
Classifier: Topic :: Communications :: Ham Radio
|
|
21
|
+
Classifier: Topic :: Scientific/Engineering :: Electronic Design Automation (EDA)
|
|
22
|
+
Classifier: Topic :: System :: Hardware
|
|
23
|
+
Requires-Python: >=3.10
|
|
24
|
+
Requires-Dist: mcp[cli]<2,>=1.2.0
|
|
25
|
+
Requires-Dist: numpy>=1.24
|
|
26
|
+
Provides-Extra: extract
|
|
27
|
+
Requires-Dist: pymupdf>=1.24; extra == 'extract'
|
|
28
|
+
Description-Content-Type: text/markdown
|
|
29
|
+
|
|
30
|
+
# rs-scope-mcp
|
|
31
|
+
|
|
32
|
+
**Let Claude drive your Rohde & Schwarz oscilloscope, and keep what it measures.**
|
|
33
|
+
|
|
34
|
+
An MCP server that connects Claude (and other AI assistants) to a Rohde & Schwarz oscilloscope over
|
|
35
|
+
the LAN. It controls the instrument through its complete SCPI command set and **harvests the data**:
|
|
36
|
+
waveforms, logic channels, serial-bus decodes, Bode plots, FFTs, measurements, segmented history and
|
|
37
|
+
screenshots, so Claude can analyse real numbers instead of guessing from a picture.
|
|
38
|
+
|
|
39
|
+
Part of the AE5VG amateur radio AI collection: <https://ae5vg.com>.
|
|
40
|
+
|
|
41
|
+
## Supported instruments
|
|
42
|
+
|
|
43
|
+
| Series | Models | Status |
|
|
44
|
+
|---|---|---|
|
|
45
|
+
| **R&S RTB2 / RTB2000** | RTB2002, RTB2004 | Supported and bench-tested (RTB2004, firmware 03.000, all options) |
|
|
46
|
+
|
|
47
|
+
The RTB2 is the rebranded RTB2000: identical hardware, a different enclosure color scheme, and firmware
|
|
48
|
+
that runs on either, so both names are covered. The project is structured per instrument family
|
|
49
|
+
(`src/rs_scope_mcp/data/<family>/`) so other R&S scopes can follow.
|
|
50
|
+
|
|
51
|
+
> Independent project, not affiliated with or endorsed by Rohde & Schwarz. R&S and RTB2000 are
|
|
52
|
+
> trademarks of Rohde & Schwarz GmbH & Co. KG.
|
|
53
|
+
|
|
54
|
+
## What you can ask
|
|
55
|
+
|
|
56
|
+
- "Measure the frequency and peak-to-peak on channel 1, then show me the screen."
|
|
57
|
+
- "Capture the I2C traffic on D0/D1 and list every address and byte."
|
|
58
|
+
- "Sweep this filter from 100 Hz to 1 MHz and tell me the -3 dB points."
|
|
59
|
+
- "Grab 40 single shots and find the one where the UART frame is corrupted."
|
|
60
|
+
- "Check my CW keying waveform for clicks." (always through an attenuator or dummy load)
|
|
61
|
+
|
|
62
|
+
Built for three kinds of work: **amateur radio** bench tests, **hardware reverse engineering**, and
|
|
63
|
+
**microcontroller / embedded / drone** development.
|
|
64
|
+
|
|
65
|
+
## Status
|
|
66
|
+
|
|
67
|
+
Pre-alpha. In place and bench-tested:
|
|
68
|
+
|
|
69
|
+
- **Complete SCPI foundation:** 748 documented command blocks (962 headers) from the manual, plus 415
|
|
70
|
+
undocumented command families the firmware reports. Every command is validated before it is sent.
|
|
71
|
+
- **Reliable sessions:** rejected queries detected in about 2 ms (the instrument otherwise stays silent),
|
|
72
|
+
the error queue read after every write, batching, and full-setup snapshot and restore.
|
|
73
|
+
- **Safety gate:** generator and pattern outputs, Bode sweeps, resets, self-alignment, file deletion and
|
|
74
|
+
network settings need explicit confirmation.
|
|
75
|
+
- **Task tools:** `capture` (acquire and harvest analog channels, logic pods and bus decodes in one
|
|
76
|
+
call), `measure`, `spectrum`, `bode`, `history` (walk segmented memory), `data` (drill into stored
|
|
77
|
+
samples, edges and frames, or read-only SQL), `setup` (show, save, restore) and `session`.
|
|
78
|
+
- **Local data store:** every capture is kept in `RS_SCOPE_DATA_DIR` (SQLite catalog plus sample
|
|
79
|
+
files and the scope's own setup), so Claude gets a compact summary and asks for details only when
|
|
80
|
+
needed.
|
|
81
|
+
- **Pass/fail testing and demo mode:** `mask` learns a tolerance envelope from a good signal and
|
|
82
|
+
counts failures (keeping only the failing acquisitions for analysis); `demo` plays a looping show
|
|
83
|
+
of what the scope can do, analog only or with the logic probe ([docs/DEMO.md](https://github.com/sbrunner-atx/rs-scope-mcp/blob/main/docs/DEMO.md)).
|
|
84
|
+
- **Foundation tools:** `connection`, `scpi_search`, `scpi_describe`, `scpi`, `scpi_block`, `screenshot`.
|
|
85
|
+
- **Simulator** for tests and demos without hardware.
|
|
86
|
+
|
|
87
|
+
Next: publishing (GitHub, PyPI, MCP Registry) and the Field Guide.
|
|
88
|
+
See [docs/ARCHITECTURE.md](https://github.com/sbrunner-atx/rs-scope-mcp/blob/main/docs/ARCHITECTURE.md).
|
|
89
|
+
|
|
90
|
+
## Quick start
|
|
91
|
+
|
|
92
|
+
```bash
|
|
93
|
+
uv sync
|
|
94
|
+
uv run python -m rs_scope_mcp.sim --port 5025 # simulated scope, or use a real one
|
|
95
|
+
uv run rs-scope --host 127.0.0.1 idn
|
|
96
|
+
uv run rs-scope --host 127.0.0.1 query "CHAN1:SCAL?" "TIM:SCAL?"
|
|
97
|
+
uv run rs-scope search "i2c frame data"
|
|
98
|
+
```
|
|
99
|
+
|
|
100
|
+
### Connect the real scope
|
|
101
|
+
|
|
102
|
+
On the scope: **Menu, Setup, Interface, Ethernet, Parameter**. Use DHCP or a fixed address and leave
|
|
103
|
+
*IP Port* at 5025. The scope also announces itself over mDNS (`_scpi-raw._tcp`).
|
|
104
|
+
|
|
105
|
+
```bash
|
|
106
|
+
uv run rs-scope --host <scope-ip> idn
|
|
107
|
+
uv run rs-scope --host <scope-ip> screenshot scope.png
|
|
108
|
+
uv run rs-scope --host <scope-ip> tree-diff # compare the registry with your firmware
|
|
109
|
+
```
|
|
110
|
+
|
|
111
|
+
### Use it from Claude
|
|
112
|
+
|
|
113
|
+
```json
|
|
114
|
+
{
|
|
115
|
+
"mcpServers": {
|
|
116
|
+
"rs-scope": {
|
|
117
|
+
"command": "uv",
|
|
118
|
+
"args": ["run", "--directory", "/path/to/rs-scope-mcp", "rs-scope-mcp"],
|
|
119
|
+
"env": { "RS_SCOPE_HOST": "192.168.1.50" }
|
|
120
|
+
}
|
|
121
|
+
}
|
|
122
|
+
}
|
|
123
|
+
```
|
|
124
|
+
|
|
125
|
+
Settings: `RS_SCOPE_HOST`, `RS_SCOPE_PORT` (5025), `RS_SCOPE_TIMEOUT` (10 s),
|
|
126
|
+
`RS_SCOPE_DATA_DIR` (`~/rs-scope-data`, where screenshots and captures are stored).
|
|
127
|
+
|
|
128
|
+
## Skills
|
|
129
|
+
|
|
130
|
+
Four skills teach Claude how to work the bench with these tools (`skills/`, also as `.skill` files on
|
|
131
|
+
the releases page):
|
|
132
|
+
|
|
133
|
+
| Skill | For |
|
|
134
|
+
|---|---|
|
|
135
|
+
| **scope-operating** | Every session: leave the scope as found, safety, capture then analyze, trustworthy numbers |
|
|
136
|
+
| **ham-bench** | Transmitter checks through attenuators: AM depth, CW keying and key clicks, SSB two-tone, harmonics, filter Bode sweeps |
|
|
137
|
+
| **bus-reverse-engineering** | Unknown pins: levels, identify the protocol and rate, confirm with the decoder, census of addresses and commands |
|
|
138
|
+
| **embedded-bringup** | Rails and ripple, sequencing and reset, clocks, PWM/servo/ESC, sensor buses, GPS/telemetry/RC links, intermittent faults, revision comparison |
|
|
139
|
+
|
|
140
|
+
## Documentation
|
|
141
|
+
|
|
142
|
+
- [Demo mode](https://github.com/sbrunner-atx/rs-scope-mcp/blob/main/docs/DEMO.md): wiring for the analog and the full demo, and every scene.
|
|
143
|
+
- [SCPI API reference](https://github.com/sbrunner-atx/rs-scope-mcp/blob/main/docs/rs-scope-api.md) ([PDF](https://github.com/sbrunner-atx/rs-scope-mcp/raw/main/docs/rs-scope-api.pdf)): every command, with the
|
|
144
|
+
bench-verified behavior the manual does not mention.
|
|
145
|
+
- [Architecture](https://github.com/sbrunner-atx/rs-scope-mcp/blob/main/docs/ARCHITECTURE.md): the layer stack, the data store and the context strategy.
|
|
146
|
+
- [Bench notes](https://github.com/sbrunner-atx/rs-scope-mcp/blob/main/docs/BENCH-NOTES.md): what was measured on the RTB2004.
|
|
147
|
+
- [Field Guide screenshots](https://github.com/sbrunner-atx/rs-scope-mcp/tree/main/docs/field-guide/screenshots/): captured by `scripts/field_guide_shots.py`.
|
|
148
|
+
|
|
149
|
+
The command registry is generated from your own copy of the R&S RTB2 user manual:
|
|
150
|
+
|
|
151
|
+
```bash
|
|
152
|
+
uv run --extra extract python scripts/extract_scpi.py "/path/to/R&S RTB2 User Manual.pdf"
|
|
153
|
+
uv run python scripts/gen_api_docs.py
|
|
154
|
+
```
|
|
155
|
+
|
|
156
|
+
## License: free for hobbyists, licensed for business
|
|
157
|
+
|
|
158
|
+
**Free for hobbyists.** Personal use, amateur radio, education and nonprofit use are free under the
|
|
159
|
+
[PolyForm Noncommercial License 1.0.0](https://github.com/sbrunner-atx/rs-scope-mcp/blob/main/LICENSE). The source is open to read, change and share.
|
|
160
|
+
|
|
161
|
+
**Commercial use needs a license.** Any use by or for a business, including internal use on a
|
|
162
|
+
company test bench, needs a commercial license. Support for more instruments, custom skills and
|
|
163
|
+
integrations, and support plans are available too. See [COMMERCIAL.md](https://github.com/sbrunner-atx/rs-scope-mcp/blob/main/COMMERCIAL.md), and buy
|
|
164
|
+
through **Westlake Professionals**: <https://westlakeprofessionals.com>.
|
|
165
|
+
|
|
166
|
+
Paid work is what keeps the free version going.
|
|
@@ -0,0 +1,137 @@
|
|
|
1
|
+
# rs-scope-mcp
|
|
2
|
+
|
|
3
|
+
**Let Claude drive your Rohde & Schwarz oscilloscope, and keep what it measures.**
|
|
4
|
+
|
|
5
|
+
An MCP server that connects Claude (and other AI assistants) to a Rohde & Schwarz oscilloscope over
|
|
6
|
+
the LAN. It controls the instrument through its complete SCPI command set and **harvests the data**:
|
|
7
|
+
waveforms, logic channels, serial-bus decodes, Bode plots, FFTs, measurements, segmented history and
|
|
8
|
+
screenshots, so Claude can analyse real numbers instead of guessing from a picture.
|
|
9
|
+
|
|
10
|
+
Part of the AE5VG amateur radio AI collection: <https://ae5vg.com>.
|
|
11
|
+
|
|
12
|
+
## Supported instruments
|
|
13
|
+
|
|
14
|
+
| Series | Models | Status |
|
|
15
|
+
|---|---|---|
|
|
16
|
+
| **R&S RTB2 / RTB2000** | RTB2002, RTB2004 | Supported and bench-tested (RTB2004, firmware 03.000, all options) |
|
|
17
|
+
|
|
18
|
+
The RTB2 is the rebranded RTB2000: identical hardware, a different enclosure color scheme, and firmware
|
|
19
|
+
that runs on either, so both names are covered. The project is structured per instrument family
|
|
20
|
+
(`src/rs_scope_mcp/data/<family>/`) so other R&S scopes can follow.
|
|
21
|
+
|
|
22
|
+
> Independent project, not affiliated with or endorsed by Rohde & Schwarz. R&S and RTB2000 are
|
|
23
|
+
> trademarks of Rohde & Schwarz GmbH & Co. KG.
|
|
24
|
+
|
|
25
|
+
## What you can ask
|
|
26
|
+
|
|
27
|
+
- "Measure the frequency and peak-to-peak on channel 1, then show me the screen."
|
|
28
|
+
- "Capture the I2C traffic on D0/D1 and list every address and byte."
|
|
29
|
+
- "Sweep this filter from 100 Hz to 1 MHz and tell me the -3 dB points."
|
|
30
|
+
- "Grab 40 single shots and find the one where the UART frame is corrupted."
|
|
31
|
+
- "Check my CW keying waveform for clicks." (always through an attenuator or dummy load)
|
|
32
|
+
|
|
33
|
+
Built for three kinds of work: **amateur radio** bench tests, **hardware reverse engineering**, and
|
|
34
|
+
**microcontroller / embedded / drone** development.
|
|
35
|
+
|
|
36
|
+
## Status
|
|
37
|
+
|
|
38
|
+
Pre-alpha. In place and bench-tested:
|
|
39
|
+
|
|
40
|
+
- **Complete SCPI foundation:** 748 documented command blocks (962 headers) from the manual, plus 415
|
|
41
|
+
undocumented command families the firmware reports. Every command is validated before it is sent.
|
|
42
|
+
- **Reliable sessions:** rejected queries detected in about 2 ms (the instrument otherwise stays silent),
|
|
43
|
+
the error queue read after every write, batching, and full-setup snapshot and restore.
|
|
44
|
+
- **Safety gate:** generator and pattern outputs, Bode sweeps, resets, self-alignment, file deletion and
|
|
45
|
+
network settings need explicit confirmation.
|
|
46
|
+
- **Task tools:** `capture` (acquire and harvest analog channels, logic pods and bus decodes in one
|
|
47
|
+
call), `measure`, `spectrum`, `bode`, `history` (walk segmented memory), `data` (drill into stored
|
|
48
|
+
samples, edges and frames, or read-only SQL), `setup` (show, save, restore) and `session`.
|
|
49
|
+
- **Local data store:** every capture is kept in `RS_SCOPE_DATA_DIR` (SQLite catalog plus sample
|
|
50
|
+
files and the scope's own setup), so Claude gets a compact summary and asks for details only when
|
|
51
|
+
needed.
|
|
52
|
+
- **Pass/fail testing and demo mode:** `mask` learns a tolerance envelope from a good signal and
|
|
53
|
+
counts failures (keeping only the failing acquisitions for analysis); `demo` plays a looping show
|
|
54
|
+
of what the scope can do, analog only or with the logic probe ([docs/DEMO.md](https://github.com/sbrunner-atx/rs-scope-mcp/blob/main/docs/DEMO.md)).
|
|
55
|
+
- **Foundation tools:** `connection`, `scpi_search`, `scpi_describe`, `scpi`, `scpi_block`, `screenshot`.
|
|
56
|
+
- **Simulator** for tests and demos without hardware.
|
|
57
|
+
|
|
58
|
+
Next: publishing (GitHub, PyPI, MCP Registry) and the Field Guide.
|
|
59
|
+
See [docs/ARCHITECTURE.md](https://github.com/sbrunner-atx/rs-scope-mcp/blob/main/docs/ARCHITECTURE.md).
|
|
60
|
+
|
|
61
|
+
## Quick start
|
|
62
|
+
|
|
63
|
+
```bash
|
|
64
|
+
uv sync
|
|
65
|
+
uv run python -m rs_scope_mcp.sim --port 5025 # simulated scope, or use a real one
|
|
66
|
+
uv run rs-scope --host 127.0.0.1 idn
|
|
67
|
+
uv run rs-scope --host 127.0.0.1 query "CHAN1:SCAL?" "TIM:SCAL?"
|
|
68
|
+
uv run rs-scope search "i2c frame data"
|
|
69
|
+
```
|
|
70
|
+
|
|
71
|
+
### Connect the real scope
|
|
72
|
+
|
|
73
|
+
On the scope: **Menu, Setup, Interface, Ethernet, Parameter**. Use DHCP or a fixed address and leave
|
|
74
|
+
*IP Port* at 5025. The scope also announces itself over mDNS (`_scpi-raw._tcp`).
|
|
75
|
+
|
|
76
|
+
```bash
|
|
77
|
+
uv run rs-scope --host <scope-ip> idn
|
|
78
|
+
uv run rs-scope --host <scope-ip> screenshot scope.png
|
|
79
|
+
uv run rs-scope --host <scope-ip> tree-diff # compare the registry with your firmware
|
|
80
|
+
```
|
|
81
|
+
|
|
82
|
+
### Use it from Claude
|
|
83
|
+
|
|
84
|
+
```json
|
|
85
|
+
{
|
|
86
|
+
"mcpServers": {
|
|
87
|
+
"rs-scope": {
|
|
88
|
+
"command": "uv",
|
|
89
|
+
"args": ["run", "--directory", "/path/to/rs-scope-mcp", "rs-scope-mcp"],
|
|
90
|
+
"env": { "RS_SCOPE_HOST": "192.168.1.50" }
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
```
|
|
95
|
+
|
|
96
|
+
Settings: `RS_SCOPE_HOST`, `RS_SCOPE_PORT` (5025), `RS_SCOPE_TIMEOUT` (10 s),
|
|
97
|
+
`RS_SCOPE_DATA_DIR` (`~/rs-scope-data`, where screenshots and captures are stored).
|
|
98
|
+
|
|
99
|
+
## Skills
|
|
100
|
+
|
|
101
|
+
Four skills teach Claude how to work the bench with these tools (`skills/`, also as `.skill` files on
|
|
102
|
+
the releases page):
|
|
103
|
+
|
|
104
|
+
| Skill | For |
|
|
105
|
+
|---|---|
|
|
106
|
+
| **scope-operating** | Every session: leave the scope as found, safety, capture then analyze, trustworthy numbers |
|
|
107
|
+
| **ham-bench** | Transmitter checks through attenuators: AM depth, CW keying and key clicks, SSB two-tone, harmonics, filter Bode sweeps |
|
|
108
|
+
| **bus-reverse-engineering** | Unknown pins: levels, identify the protocol and rate, confirm with the decoder, census of addresses and commands |
|
|
109
|
+
| **embedded-bringup** | Rails and ripple, sequencing and reset, clocks, PWM/servo/ESC, sensor buses, GPS/telemetry/RC links, intermittent faults, revision comparison |
|
|
110
|
+
|
|
111
|
+
## Documentation
|
|
112
|
+
|
|
113
|
+
- [Demo mode](https://github.com/sbrunner-atx/rs-scope-mcp/blob/main/docs/DEMO.md): wiring for the analog and the full demo, and every scene.
|
|
114
|
+
- [SCPI API reference](https://github.com/sbrunner-atx/rs-scope-mcp/blob/main/docs/rs-scope-api.md) ([PDF](https://github.com/sbrunner-atx/rs-scope-mcp/raw/main/docs/rs-scope-api.pdf)): every command, with the
|
|
115
|
+
bench-verified behavior the manual does not mention.
|
|
116
|
+
- [Architecture](https://github.com/sbrunner-atx/rs-scope-mcp/blob/main/docs/ARCHITECTURE.md): the layer stack, the data store and the context strategy.
|
|
117
|
+
- [Bench notes](https://github.com/sbrunner-atx/rs-scope-mcp/blob/main/docs/BENCH-NOTES.md): what was measured on the RTB2004.
|
|
118
|
+
- [Field Guide screenshots](https://github.com/sbrunner-atx/rs-scope-mcp/tree/main/docs/field-guide/screenshots/): captured by `scripts/field_guide_shots.py`.
|
|
119
|
+
|
|
120
|
+
The command registry is generated from your own copy of the R&S RTB2 user manual:
|
|
121
|
+
|
|
122
|
+
```bash
|
|
123
|
+
uv run --extra extract python scripts/extract_scpi.py "/path/to/R&S RTB2 User Manual.pdf"
|
|
124
|
+
uv run python scripts/gen_api_docs.py
|
|
125
|
+
```
|
|
126
|
+
|
|
127
|
+
## License: free for hobbyists, licensed for business
|
|
128
|
+
|
|
129
|
+
**Free for hobbyists.** Personal use, amateur radio, education and nonprofit use are free under the
|
|
130
|
+
[PolyForm Noncommercial License 1.0.0](https://github.com/sbrunner-atx/rs-scope-mcp/blob/main/LICENSE). The source is open to read, change and share.
|
|
131
|
+
|
|
132
|
+
**Commercial use needs a license.** Any use by or for a business, including internal use on a
|
|
133
|
+
company test bench, needs a commercial license. Support for more instruments, custom skills and
|
|
134
|
+
integrations, and support plans are available too. See [COMMERCIAL.md](https://github.com/sbrunner-atx/rs-scope-mcp/blob/main/COMMERCIAL.md), and buy
|
|
135
|
+
through **Westlake Professionals**: <https://westlakeprofessionals.com>.
|
|
136
|
+
|
|
137
|
+
Paid work is what keeps the free version going.
|