Streamparse

io.github.MukundaKatta由 GitHub 账号 MukundaKatta 发布v1.0.1更新于 Oct 24, 2026

Parse partial / truncated / messy JSON for LLM tool calls and structured outputs.

已验证STDIO仅桌面开发者工具AI 与机器学习

概览

AI 生成的概览

一个本地 MCP 服务器,让助手解析不完整、被截断或格式混乱的 JSON,从文本中提取 JSON,并进行严格校验。

可以做什么
从可能被截断的 JSON 中恢复值,对未闭合的字符串、数组和对象做合成补全,并给出完整性、路径、已消耗字节数和置信度信息。从 LLM 输出中提取第一个可解析的 JSON 值,去除说明文字、代码围栏和注释。按 RFC 8259 严格校验 JSON,成功时返回解析值,失败时返回字节位置和错误信息。
适用场景
适用于助手处理半成品或被截断的 JSON 时,例如中断的工具调用或夹杂在说明文字中的结构化输出,需要得到可用值而不是解析错误。
运行要求
作为本地进程通过 stdio 运行,从 npm 包 @mukundakatta/streamparse-mcp 安装,通常用 npx 或全局 npm 安装启动。需要 Node.js;未声明账户、API 密钥或环境变量。
安装前请注意
未声明凭据或写入操作。对截断输入的解析结果是合成补全,恢复出的值应视为近似,使用前请查看完整性和置信度信息。

安装

在 SourceWeft 中

  1. 打开 控制台中的 Streamparse,将其添加到工作区。
  2. 为需要使用其工具的对话启用该服务。

Desktop only,通过 STDIO。 STDIO 服务会启动本地进程,因此需要 SourceWeft 桌面宿主。

其他 MCP 客户端

参照 仓库 中的启动说明。

README

streamparse-mcp

[npm] [tests] [mcp]

An MCP server that gives AI assistants the ability to parse partial / messy / truncated JSON.

Built on top of @mukundakatta/streamparse. Works with Claude Desktop, Cursor, Cline, Windsurf, Zed, and any other MCP client.

Tools exposed

parse_partial_json

Recover a JSON value from a possibly-truncated string. Always returns a valid value with synthetic closure of any open strings, arrays, or objects.

json
{  "text": "{\"type\":\"tool_use\",\"name\":\"edit_file\",\"input\":{\"path\":\"a/b.ts\",\"cont"}

→

json
{  "value": {    "type": "tool_use",    "name": "edit_file",    "input": { "path": "a/b.ts", "cont": null }  },  "complete": false,  "path": ["input", "cont"],  "bytes_consumed": 67,  "confidence": 0.65}

extract_json_from_text

Strip prose, ```json fences, and comments around a JSON value embedded in LLM output. Returns the first parseable value.

Sure, here you go:```json{ "answer": 42 }

Let me know!


→ `{ "answer": 42 }`
### `validate_json`
Strict-mode RFC 8259 validator. Returns `ok=true` and the parsed value onsuccess, or `ok=false` with a precise byte position and error message onfailure.
## Install
### Claude Desktop
Add to `claude_desktop_config.json`:
```json{  "mcpServers": {    "streamparse": {      "command": "npx",      "args": ["-y", "@mukundakatta/streamparse-mcp"]    }  }}

Cursor / Cline / Windsurf / Zed

Same shape, in the appropriate mcp.json for your client. Most clients auto-discover via npx -y @mukundakatta/streamparse-mcp.

Local install

bash
npm install -g @mukundakatta/streamparse-mcpmcp-streamparse        # listens on stdio

Why this matters

When an LLM is mid-tool-call and you need the assistant to reason about the half-formed JSON it just wrote, no other tool gives a usable answer. Standard JSON.parse throws. Regex extraction misses nested structure. This MCP server gives Claude (or whichever model is driving) a real handle on partial JSON, right where it lives.

License

MIT.

来源:README.md,提交 0ecba62

工具

0
SourceWeft 尚未在沙箱中启动过该软件包,因此其工具未知。

版本历史

1
  1. v1.0.1最新Sep 16, 2026

评分

已满足适用检查项的 50%

该评分衡量此收录条目的完整程度,依据注册中心条目、端点与公开来源计算得出。它不是对服务器本身的评价,也不表示服务器安全或当前可用:可连通性是带日期的检查结果,评分也不包含安装量或用户评价。

  • 近 30 天内可连通25 分

    请保持端点能够响应 MCP 握手;SourceWeft 每 30 天探测一次。

  • 已声明认证方式10 分

    请在注册中心条目中声明凭据请求头,或保持端点能够响应探测,以便判定其认证方式。

  • 已列出工具15 分

    请让服务器在无凭据时响应 tools/list,或发布可在沙箱中无凭据启动的软件包。

  • 描述必需15 分
  • 图标10 分
  • 文档15 分
  • 许可证10 分