MsgPack (LsMsgPack)
io.github.mlsomersv2026.10.10.2更新于 Oct 10, 2026
Decodes MsgPack (LsMsgPack schemas, type ids) as text and reads it from variables while debugging.
概览
将 MsgPack 二进制数据解码为可读的 JSON,并可读取在 VS Code 或 Visual Studio 调试器中暂停的程序的字节变量。
- 功能
- 该服务器把 MsgPack 数据转换为带注释的 JSON,并解析 LsMsgPack 索引式架构,使类型和属性编号变为名称。工具可从十六进制、base64、字节值、文件或先前解码的文档中解码数据;列出调试会话和暂停栈帧的变量;读取并解码暂停程序中某个表达式的字节;解释指定偏移处字节的含义;搜索文本或值;以及把数据读入已编译 .NET 程序集的类并报告不匹配之处。解码后的数据会获得文档编号,便于后续调用,输出可按路径、字节范围、视图和偏移选项进行筛选。
- 适用场景
- 当助手需要检查难以用十六进制或 base64 阅读的 MsgPack 数据时很有用,尤其是架构仅以 16 字节编号引用的 LsMsgPack 数据。也适用于在 VS Code 或 Visual Studio 中调试 .NET 程序,助手可以读取暂停栈帧中变量或成员的字节并解码。
- 运行要求
- 需要 .NET 运行时 8 或更高版本;以全局工具 LsMsgPack.Mcp 安装,命令为 lsmsgpack-mcp,通过 stdio 在本地运行。调试功能需要 VS Code 的 MsgPack Explorer 扩展或 Visual Studio 的 MsgPack Debugger Extension,它们监听 127.0.0.1,并在用户配置目录下写入包含端口和令牌的锁文件。未声明任何账户、API 密钥或环境变量。
安装
在 SourceWeft 中
- 打开 控制台中的 MsgPack (LsMsgPack),将其添加到工作区。
- 为需要使用其工具的对话启用该服务。
Desktop only,通过 STDIO。 STDIO 服务会启动本地进程,因此需要 SourceWeft 桌面宿主。
其他 MCP 客户端
参照 仓库 中的启动说明。
README
LsMsgPack MCP server
MsgPack for AI agents. An MCP server and a command line tool that decode MsgPack data into text an AI (or a person in a terminal) can read, and that read the bytes of a variable of a program paused in the debugger of VS Code or Visual Studio.
Language models read text, not bytes. Hex or base64 costs several tokens per byte, and decoding it by hand is slow and error-prone. Some data can't be decoded from the bytes at all: LsMsgPack's indexed schema writes property names as indexes, and a schema reference holds only the 16-byte id of the schema. This tool decodes the data with the LsMsgPack library itself (the code of MsgPack Explorer) and writes it as JSON with comments:
It reads any MsgPack, not only data written by LsMsgPack. Errors come with their offset, and the values read after an error are marked.
Install
Requires the .NET runtime 8 or later.
From source: dotnet publish LsMsgPackMcpServer -c Release -o <folder>, then run dotnet <folder>/LsMsgPackMcp.dll in place of lsmsgpack-mcp.
Add it to your agent
In VS Code, MsgPack: Copy MCP Server Configuration... copies these: for the tool when it is installed, otherwise for the server that comes with the extension (its path has the extension's version in it, so copy it again after an update).
Tools
Every decoded payload gets a document id (doc1, doc2...) for follow-up calls. The output can be narrowed and switched with these options:
view:objects(default),items(the MsgPack encodings with offsets) orboth.path(e.g.Lines[2]),from/to(a byte range),maxNodes,maxString.offsetsadds the offset of every value.issuestakeserrors,allornone.endianandcontinueOnError(on by default).
Debugging
The MsgPack extensions of VS Code (MsgPack Explorer) and Visual Studio (MsgPack Debugger Extension) listen on 127.0.0.1. They write a lock file with their port and a random token to ~/.lsmsgpack/ide (%USERPROFILE%\.lsmsgpack\ide). The MCP server uses the IDE that started it, otherwise the one whose workspace holds its working directory (ide picks one when several run).
- By default only variable and member paths are read (
buffer,this._payload,response.Content,items[2].Data), no method calls. The IDE setting can allow any expression:lsmsgpack.mcp.allowAnyExpressionin VS Code (user settings only), Tools > Options > MsgPack Explorer in Visual Studio. - A stream that can't seek is consumed by reading it, so the IDE asks the user first.
- The IDE settings can turn the bridge off:
lsmsgpack.mcp.enabledin VS Code, and the same options page in Visual Studio.
Command line
lsmsgpack-mcp --help lists the options. Without arguments it runs the MCP server on stdin/stdout.
More: docs/Mcp.md.
来源:LsMsgPackMcpServer/README.md,提交 7be5fc8
工具
0版本历史
1- v2026.10.10.2最新Oct 10, 2026


