MsgPack Explorer for VS Code
Inspect MsgPack data while debugging, and in .msgpack files. At the top low level MsgPack items tree with HEX viewer and exact type information. The bottom half (may be toggled on or off) shows higher level objects with their properties.
Requires the .Net 8 (or higher) runtime.
Install it from the Visual Studio Marketplace, or with code --install-extension mlsomers.lsmsgpack-explorer.

While debugging
Pause the program, then:
- right-click a variable in the Variables or Watch view and choose View as MsgPack,
- right-click a variable in the code (or select an expression) and choose View as MsgPack: it takes the member path up to the part you clicked (
this._buffer in this._buffer.Length), or
- run MsgPack: Inspect Expression... from the Command Palette and type an expression (evaluated in the stack frame selected in the Call Stack view).
For .Net:
| Value |
How it is read |
byte[] |
|
MemoryStream |
ToArray(): the whole stream, its position does not change |
other Streams |
seekable: from the start, then the position is put back. Not seekable: from the current position, after you confirm (the program cannot read those bytes any more) |
List<byte>, ArraySegment<byte> and other IEnumerable<byte>, Memory<byte>, ReadOnlyMemory<byte>, ReadOnlySequence<byte> |
converted to an array |
HttpResponseMessage, ByteArrayContent and other HttpContent |
ReadAsByteArrayAsync().Result |
string |
base64, hex or delimited values |
Other debuggers:
- JavaScript (Node.js, Chrome, Edge):
Uint8Array, Buffer, ArrayBuffer, DataView and other typed arrays, arrays of numbers, strings.
- Python (debugpy):
bytes, bytearray, memoryview, io.BytesIO, lists of ints, strings.
- Any debugger: the elements the Variables view shows for an array (also in groups like
[0..99]), or a string holding the bytes.
Large values are read up to lsmsgpack.maxBytes (16 MB by default).
AI agents (MCP)
AI agents can read MsgPack while you debug, through the MCP server that comes with the extension (LsMsgPack MCP server). It decodes the data into JSON with comments (types from the indexed schema and type ids, timestamps, decimals, errors with their offsets), so the agent doesn't have to decode hex.
- VS Code chat (agent mode): the server "MsgPack (LsMsgPack)" is listed in the MCP servers, nothing to configure.
- Other agents (Claude Code, Cursor, Claude Desktop...): MsgPack: Copy MCP Server Configuration... copies the command or JSON for them. With the .NET tool installed (
dotnet tool install -g LsMsgPack.Mcp) it uses lsmsgpack-mcp, which stays valid when the extension is updated. Otherwise it uses the server that comes with the extension, whose path changes with every update. Their server finds this window through a lock file in ~/.lsmsgpack/ide, and uses the window whose folder holds its working directory.
The agent asks where the program is paused (msgpack_debug_status), which variables hold bytes (msgpack_debug_locals), and reads one (msgpack_debug_read), the same values as View as MsgPack. It only reads variable and member paths (buffer, this._payload, items[2].Data), unless lsmsgpack.mcp.allowAnyExpression allows any expression. A stream that cannot seek is only read after you confirm. A notification shows what is being read, and you can cancel it.
Streams
Streams written by LsMsgPack's MsgPackStreamWriter (or the TypeScript client) are shown as such: arrays, maps, strings and bin of unknown length (the escape sequences C1 90 ... C1 C0 in red in the hex view, the chunks of a string in the tree), the index of the stream with its entries and fields (idx), its tail (tail, the CRC-32 is checked) and sidecars. In the objects pane the payloads are named after their entries.
Files and text
.msgpack, .MsgPack and .mpk files open in the explorer (Reopen Editor With... switches to the text or hex editor). Other files: MsgPack: Open File.... The view follows changes of the file.
- MsgPack: Explore Bytes from Clipboard and Explore Selected Text as MsgPack (editor context menu) read bytes written as text: hex (
0x81A3..., 81 A3 ..., 81-A3-...), base64, delimited decimal values ([129, 163, ...], e.g. copied from a debugger) or a Python bytes literal (b'\x81\xa3').
Requirements
The data is read by the LsMsgPackDebug library itself (the same code as the Visual Studio visualizer), in small .NET programs that come with the extension (the inspector, and the MCP server for AI agents). It needs the .NET runtime 8 or later (dotnet on the PATH, or set lsmsgpack.dotnetPath).
Settings
| Setting |
Default |
|
lsmsgpack.dotnetPath |
dotnet |
The dotnet executable that runs the inspector. |
lsmsgpack.displayLimit |
1000 |
The number of items shown at first (0: no limit). |
lsmsgpack.showObjectsAt |
high |
When the objects pane opens by itself: certain (an indexed schema or type ids of LsMsgPack), high (also maps with the same names as keys, e.g. a list of objects from Python or JavaScript), medium (also one map with names as keys and values of different kinds), low (any map with text keys). |
lsmsgpack.maxBytes |
16777216 |
The most bytes read from the debugged program. |
lsmsgpack.chunkSize |
49152 |
Bytes per evaluation in the debugger (made smaller automatically when the debugger shortens long strings). |
lsmsgpack.mcp.enabled |
true |
Lets AI agents read from the debugger through the MCP server (the bridge on 127.0.0.1 with a random token, and its lock file). |
lsmsgpack.mcp.allowAnyExpression |
false |
Lets AI agents read any expression, including method calls that can change the program. User settings only. |
Views:
- MsgPack items: the tree of the data, every item with its MsgPack type and value. Keys and values of maps are marked, items of the indexed schema are shown in blue, items read after an error in gray.
- Bytes: the hex view. The type byte of each item is red, the bytes holding a length are blue, bytes after the data are gray. The selected item is highlighted, clicking a byte selects its item.
- Properties: what the explorer's property grid shows for the selected item (type, offset, length, count, value...), with the description of the selected property.
- Validation: issues of the data (a smaller encoding would have saved bytes, keys of different types, duplicate keys, where reading stopped, timestamps, big integers and decimals that are not valid, the indexed schema and the type ids). Security vulnerabilities (🛡) mark places where the data picks the type that a reader creates: values in properties declared as
object, type names that could load assemblies, known gadget types (see docs/security.md). Clicking one selects the item.
- Objects: the objects the data was written from, reconstructed without the types: type names and property names from the indexed schema of LsMsgPack, names from the keys of maps (data without a schema, e.g. from other languages), or the values by position. Shown automatically when the data looks like objects (
lsmsgpack.showObjectsAt, the tooltip of the Objects button tells why). Selecting an object selects its bytes.
- Search: strings containing the text, and values the text converts to (numbers, true/false, null, Guids, dates and times). Enter for the next, Shift+Enter for the previous.
- Limit, Endian and Ignore errors like the Visual Studio visualizer: show more items, read numbers in another byte order, keep reading after a breaking error (best effort).
- LsMsgPack extensions (on by default): extension type 1 is read as a decimal, and the streams LsMsgPack writes (values of unknown length, the index and sidecars of a stream) as such. Switch it off to see plain MsgPack as the specification defines it, for data of other writers that use these extension types for something else. The Windows explorer (Visual Studio, Fiddler) has the same switch in its View menu.
- Values that are too large for practical debugging (a str, bin or ext above 16 MiB, up to the 4 GB of the specification) keep their first and last 100 characters or bytes: the icon gets a mark, the properties show the original length and the hex view has a row of dots for the bytes in between. Files can be larger than 2 GB. Of a file above 256 MiB the hex view shows at most 256 MiB after leaving out such values.
- Save, Copy hex, Copy base64 and Refresh (read the value again while the program is paused, or the file again).
License
Apache License 2.0, © Matheu Louis Somers.
| |