Skip to main content
Glama
MukundaKatta

streamparse-mcp

by MukundaKatta

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.

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

{
  "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 on
success, or `ok=false` with a precise byte position and error message on
failure.

## 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

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

Related MCP server: json-promptor-mcp

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.

Available Tools

3 tools
extract_json_from_textA

Extract and parse a JSON value embedded in messy LLM output. Strips ```json fences, leading/trailing prose, code comments, and tolerates other LLM-isms. Returns the first parseable value and where in the text it started.

ParametersJSON Schema
NameRequiredDescriptionDefault
textYesFree-form text that contains a JSON value somewhere inside.

TDQS

A4.1/5.0
Behavior3/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

Without annotations, the description must fully disclose behavior. It details input processing (stripping fences, comments) and output (first parseable value and start position). However, it omits failure behavior when no JSON is found, which is a notable gap for a parsing tool.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Three sentences, each serving a distinct purpose: stating the action, listing transformations, and describing the return. Front-loaded with the main verb, no wasted words.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

With no output schema, the description partially covers the output (first parseable value and start position). It lacks detail on edge cases (e.g., multiple JSON objects, non-JSON input), which reduces completeness for a utility tool.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 100% for the single 'text' parameter, and the description adds value by explaining how the text is preprocessed (stripping fences, comments), which goes beyond the schema's simple 'contains a JSON value' description.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description explicitly states the tool's purpose: to extract and parse a JSON value from messy LLM output, detailing specific transformations (stripping ```json fences, prose, comments). It clearly distinguishes from sibling tools 'parse_partial_json' and 'validate_json' by focusing on messy text rather than partial or valid JSON.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description implies usage for cleaning LLM output to extract JSON, but does not explicitly state when not to use it or provide direct comparisons to siblings. The context and examples (fences, comments) give practical guidance, though more explicit exclusions would improve clarity.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

parse_partial_jsonA

Parse a JSON string that may be truncated mid-stream (e.g. a partial LLM tool call). Always returns a valid JSON value with synthetic closure of any open strings, arrays, or objects. Reports whether the input represented a complete top-level value, plus the cursor path where parsing stopped.

ParametersJSON Schema
NameRequiredDescriptionDefault
textYesThe JSON text to parse. May be truncated.
lenientNoWhen true (default), tolerates trailing commas, single quotes, unquoted keys, ```json fences, comments, and prose padding.

TDQS

A4.1/5.0
Behavior4/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations, the description carries full burden. It discloses synthetic closure, lenient mode tolerances, and return info (completeness flag and cursor path). However, it does not specify error behavior if input is completely malformed beyond lenient capabilities (though it claims 'always returns a valid JSON').

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Two succinct sentences: first states core purpose and key behavior, second adds return value details. No wasted words.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given 2 parameters, no output schema, and low complexity (no nested objects), the description sufficiently covers behavior, input constraints (truncation, lenient flags), and return information (synthetic closure, completeness, cursor path).

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100%, so baseline is 3. The description adds no new parameter meaning beyond the schema; it merely repeats that text 'may be truncated' and describes lenient tolerances, which are already in the schema.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the tool parses a potentially truncated JSON string and always returns a valid JSON with synthetic closure. It distinguishes from sibling tools like extract_json_from_text and validate_json by focusing on partial input handling.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description implies usage when JSON may be truncated but does not explicitly state when to use this tool over siblings (extract_json_from_text, validate_json) or provide conditions for using the lenient parameter.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

validate_jsonA

Strict-mode RFC 8259 validator. Returns ok=true and the parsed value if the input is valid JSON; otherwise returns ok=false with a precise byte position and human-readable message.

ParametersJSON Schema
NameRequiredDescriptionDefault
textYesThe JSON text to validate.

TDQS

A4.1/5.0
Behavior4/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations provided, the description fully discloses behavior: strict RFC 8259 validation, return structure with ok boolean, and on success returns parsed value, on failure returns precise byte position and human-readable message. This is thorough for a validation tool.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Two efficient sentences: first declares purpose and mode, second details the return behavior. No extraneous words.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a simple validation tool with one parameter and no output schema, the description fully explains input, validation mode, and the two possible outcomes (success/failure) with specific details (parsed value, byte position, message). Complete.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 100% with a single 'text' parameter described as 'The JSON text to validate.' The description adds no further semantics beyond the schema, but the tool's simplicity means the schema suffices.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

Describes itself as a 'Strict-mode RFC 8259 validator' specifying both the standard and mode, and distinguishes from siblings like parse_partial_json and extract_json_from_text by emphasizing strict compliance and precise error reporting.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description mentions 'strict-mode' implying a specific validation standard but does not explicitly state when to use this tool versus its alternatives (parse_partial_json, extract_json_from_text). Use is implied rather than clearly guided.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections. Dates show when Glama detected each change.

  1. 3 tool updatesv1.0.1
    • First observedextract_json_from_text
    • First observedparse_partial_json
    • First observedvalidate_json

TDQS

A4.4/5.0

Scored across 3 tools

Disambiguation5/5

Each tool targets a distinct JSON scenario: partial/truncated input, embedded in LLM text, and strict validation. No overlap in purpose.

Naming Consistency5/5

All tools follow a consistent verb_noun pattern (parse_partial_json, extract_json_from_text, validate_json), making the set predictable.

Tool Count5/5

Three tools is well-scoped for a focused JSON parsing and validation server—each tool serves a clear need without excess or deficiency.

Completeness5/5

The surface covers the key JSON handling tasks: parsing partial streams, extracting from messy text, and strict validation. No obvious gaps given the domain.

Maintenance

ActivityInactive
ResponsivenessNo issues

Resources

Unclaimed servers have limited discoverability.

Looking for Admin?

If you are the server author, to access and configure the admin panel.

Related MCP Connectors

Related MCP Servers

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/MukundaKatta/streamparse-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server