@bytescope/mcp 0.0.0-stage → 0.1.0
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.
- package/README.md +126 -2
- package/THIRD_PARTY_LICENSES.txt +971 -0
- package/dist/cli.js +115646 -0
- package/package.json +63 -4
package/README.md
CHANGED
|
@@ -1,3 +1,127 @@
|
|
|
1
|
-
|
|
1
|
+
Fully offline: this server never touches the network — no telemetry, no API calls, no keys, no account.
|
|
2
|
+
|
|
3
|
+
# @bytescope/mcp
|
|
4
|
+
|
|
5
|
+
The [ByteScope](https://bytescope.dev) tools as an MCP server for coding agents: real byte-level
|
|
6
|
+
file analysis (pcap, ELF, X.509, Intel HEX / UF2, HID descriptors, EXIF, SQLite), real test files
|
|
7
|
+
(`generate_fixture`: PNG, ZIP, pcap, a certificate that expires in two days, MP4, SQLite, PDF, …)
|
|
8
|
+
and reference lookups (USB ids, BLE UUIDs, HID usages, MIDI, ports, HTTP status codes, file
|
|
9
|
+
signatures) that answer from real tables and say `found: false` instead of guessing.
|
|
10
|
+
|
|
11
|
+
It is the same code as the website — the `core-*` packages behind every ByteScope page — bundled
|
|
12
|
+
into one file with zero runtime dependencies. It speaks MCP over stdio.
|
|
13
|
+
|
|
14
|
+
## Install
|
|
15
|
+
|
|
16
|
+
Claude Code:
|
|
17
|
+
|
|
18
|
+
```sh
|
|
19
|
+
claude mcp add bytescope -- npx -y @bytescope/mcp
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
Any client that reads `.mcp.json` (Claude Code project scope, Cursor, …):
|
|
23
|
+
|
|
24
|
+
```json
|
|
25
|
+
{
|
|
26
|
+
"mcpServers": {
|
|
27
|
+
"bytescope": {
|
|
28
|
+
"command": "npx",
|
|
29
|
+
"args": ["-y", "@bytescope/mcp"]
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
Requires Node.js 20 or newer.
|
|
36
|
+
|
|
37
|
+
### Hosted endpoint (best effort)
|
|
38
|
+
|
|
39
|
+
The same tool list is also served over streamable HTTP at `https://bytescope.dev/api/mcp` —
|
|
40
|
+
stateless, anonymous, nothing stored:
|
|
41
|
+
|
|
42
|
+
```sh
|
|
43
|
+
claude mcp add --transport http bytescope https://bytescope.dev/api/mcp
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
Use it to try the tools, or for small inputs. It runs on Cloudflare Workers Free, so it has limits
|
|
47
|
+
the local server does not:
|
|
48
|
+
|
|
49
|
+
- **4 MB per call** — input, and a `generate_fixture` output — against 8 MB locally. Anything
|
|
50
|
+
larger gets an error that points back to `npx @bytescope/mcp`.
|
|
51
|
+
- **About 10 ms of CPU per request.** Lookups, small binaries and most default fixtures fit. Calls
|
|
52
|
+
that do real work may be cut off: hashing more than a few kilobytes, RSA certificate fixtures,
|
|
53
|
+
audio/video fixtures, large images or databases, and the first `sqlite_schema` or
|
|
54
|
+
`lookup_usb_vendor` call on a fresh instance (engine start-up, table parse).
|
|
55
|
+
- **Rate limited** per client IP (60 requests a minute). Over it you get HTTP 429 with a JSON-RPC
|
|
56
|
+
error and `Retry-After`.
|
|
57
|
+
|
|
58
|
+
The local `npx` server is the real product: offline, no CPU cap, and your bytes never leave the
|
|
59
|
+
machine. The hosted endpoint receives whatever you send it, so do not send it anything confidential.
|
|
60
|
+
|
|
61
|
+
## Input convention
|
|
62
|
+
|
|
63
|
+
Binary input is always a string in `data` plus `encoding`: `"base64"` (default; standard or
|
|
64
|
+
URL-safe, line breaks and `data:` URIs accepted) or `"hex"` (spaces, `:` and `,` separators
|
|
65
|
+
accepted). **File paths are never accepted.** One call may carry at most 8 MB of decoded input
|
|
66
|
+
(4 MB on the hosted endpoint); larger inputs get an explicit error instead of exhausting memory.
|
|
67
|
+
|
|
68
|
+
## Tools
|
|
69
|
+
|
|
70
|
+
| Tool | What it does | Source package |
|
|
71
|
+
|---|---|---|
|
|
72
|
+
| `detect_file_type` | Real file type from magic bytes, with confidence, MIME and an extension check | `core-magic` |
|
|
73
|
+
| `hash_bytes` | MD5, SHA-1, SHA-256, SHA-512, CRC-32 | `core-flash` (MD5), WebCrypto (SHA), `core-crc` (CRC-32) |
|
|
74
|
+
| `crc_calculate` | Any reveng-catalogue CRC model, or custom Rocksoft parameters | `core-crc` |
|
|
75
|
+
| `crc_reverse` | Recover the CRC model from known message/checksum pairs | `core-crc` |
|
|
76
|
+
| `decode_certificate` | PEM / DER X.509 and CSRs: subject, SANs, validity, signature, key, fingerprints | `core-cert` |
|
|
77
|
+
| `subnet_calc` | IPv4/IPv6 CIDR → network, hosts, masks, classification, subnet split | `core-ipcalc` |
|
|
78
|
+
| `parse_pcap` | pcap / pcapng → packet list, streams, statistics, display filters | `core-pcap` |
|
|
79
|
+
| `inspect_elf` | ELF header, program/section headers, symbols, dynamic section, notes | `core-elf` |
|
|
80
|
+
| `parse_intel_hex` | Intel HEX, S-record, UF2 → address segments, gaps, record errors | `core-ihex` |
|
|
81
|
+
| `decode_hid_descriptor` | HID report descriptor → annotated items, collections, reports | `core-hid` |
|
|
82
|
+
| `parse_exif` | JPEG / PNG / TIFF metadata; **GPS is masked unless `includeGps: true`** | `core-image` |
|
|
83
|
+
| `sqlite_schema` | SQLite file → tables, columns (type, PK, NOT NULL, default, FK), row counts, indexes, views, triggers, page size, versions | SQLite itself (sql.js WebAssembly, the engine /sqlite-viewer runs) |
|
|
84
|
+
| `convert_subtitle` | SRT ↔ WebVTT ↔ ASS, with a report of what the target cannot carry | `core-subtitle` |
|
|
85
|
+
| `generate_fixture` | Real test files (see below) | `core-fixture` |
|
|
86
|
+
| `lookup_usb_vendor` | VID → vendor and products (linux-usb.org `usb.ids`) | `core-usb-ids` |
|
|
87
|
+
| `lookup_usb_product` | VID:PID → vendor and product | `core-usb-ids` |
|
|
88
|
+
| `lookup_ble_uuid` | 16/32/128-bit UUID → GATT service, characteristic or descriptor | `core-ble` |
|
|
89
|
+
| `lookup_hid_usage` | Usage page + id → HID Usage Tables names | `core-hid` |
|
|
90
|
+
| `lookup_midi_cc` | CC 0-127 → MMA controller assignment | `core-midi` |
|
|
91
|
+
| `lookup_midi_manufacturer` | SysEx manufacturer id → company | `core-midi` |
|
|
92
|
+
| `lookup_port` | Port number → service, transport, security notes | ByteScope port reference |
|
|
93
|
+
| `lookup_http_status` | Status code → meaning and common confusions | ByteScope HTTP status reference |
|
|
94
|
+
| `lookup_file_signature` | Leading bytes → formats whose magic numbers match | `core-magic` |
|
|
95
|
+
|
|
96
|
+
Every `lookup_*` answer that is found carries `url` (the ByteScope page for that item) and `md`
|
|
97
|
+
(its Markdown), so an agent can cite a source. When a table has no entry the answer is exactly
|
|
98
|
+
`{ "found": false, … }` with the normalised query.
|
|
99
|
+
|
|
100
|
+
## `generate_fixture`
|
|
101
|
+
|
|
102
|
+
`generate_fixture({ kind, options })` returns `{ kind, files: [{ name, mime, bytes, base64 }] }`.
|
|
103
|
+
Usually that is one file; a certificate comes with its private key, a split ZIP with one file per
|
|
104
|
+
volume. Every generator is checked by reading its output back with an independent parser.
|
|
105
|
+
|
|
106
|
+
| Kind | Options (all optional) |
|
|
107
|
+
|---|---|
|
|
108
|
+
| `png` `jpeg` `bmp` `webp` | `width`, `height`, `color`; `withExif` (JPEG, PNG) |
|
|
109
|
+
| `gif` | size and colour, `frames`, `frameColors`, `delayMs`, `loop` |
|
|
110
|
+
| `zip` | `fileCount`, `names`, `contents`, `method`, `encrypted`, `volumeSize` (split), `corrupt` (one named field) |
|
|
111
|
+
| `pcap` `pcapng` | `packetCount`, `protocol` (TCP handshake, DNS query, HTTP GET), `host`, `startTime` |
|
|
112
|
+
| `x509` | `commonName`, `subjectAltNames`, `validity` (`valid`, `expires-soon`, `expired`, `not-yet-valid`, `custom`), `days`, `keyAlgorithm`, `isCa`, `format` |
|
|
113
|
+
| `mp4` `wav` `mp3` | `durationSeconds` and encoding; MP4 `moov` before or after the media data |
|
|
114
|
+
| `sqlite` | `tables` with columns and row counts |
|
|
115
|
+
| `elf` `intel-hex` `uf2` | minimal valid images: machine/class, address, payload size |
|
|
116
|
+
| `pdf` | `pageCount`, `encrypted`, `embeddedFile` |
|
|
117
|
+
|
|
118
|
+
The full schema of each kind is in the tool's input schema (`options.anyOf`, one entry per kind,
|
|
119
|
+
titled with the kind). Certificate validity is relative to `now`, which defaults to the current
|
|
120
|
+
time; pass `now` for a reproducible certificate.
|
|
121
|
+
|
|
122
|
+
## Resources
|
|
123
|
+
|
|
124
|
+
- `bytescope://tools` — the tool directory, identical to <https://bytescope.dev/tools.json>.
|
|
125
|
+
- `bytescope://tool/{slug}` — a Markdown digest of one tool page (description, about, FAQ), with a
|
|
126
|
+
link to the canonical `https://bytescope.dev/en/<slug>.md`.
|
|
2
127
|
|
|
3
|
-
This version is a temporary placeholder for this package. An operational version to replace this has been submitted for review and is awaiting a staged release.
|