Agentcast

io.github.MukundaKattaPublished by GitHub account MukundaKattav0.1.0Updated Oct 24, 2026

Structured-output enforcer: extract and validate JSON from messy LLM text.

VerifiedSTDIODesktop onlyDeveloper ToolsAI & ML

Overview

AI-generated overview

Local MCP server that helps an assistant pull JSON out of messy LLM text, check it against a shape spec, and build retry feedback.

What you can do
  • Extract a JSON value from messy model output, trying the whole text, a fenced block, then the largest balanced object or array, and report which strategy worked.
  • Validate a parsed value against a shape spec mapping field names to string, number, boolean, array or object, with optional fields marked by a suffix.
  • Build a retry feedback message from an attempt history and expected shape, so a client can drive the validation-error-as-feedback loop itself.
When to use it
Useful when an assistant or agent pipeline expects structured JSON from a model that sometimes wraps it in prose or fences, or returns the wrong fields, and you want extraction, shape checking and retry prompts handled by a tool rather than ad hoc parsing.
Requirements
Runs as a local stdio process, typically launched with npx from the npm package or installed globally; needs Node.js and an MCP client such as Claude Desktop, Cursor, Cline, Windsurf or Zed. No authentication, environment variables or headers are declared.
Before you install
The tools only parse, validate and format text; they do not call a model themselves, so the retry loop must be driven by the client. Extracted values are returned as-is, so validate before acting on them.

Installation

In SourceWeft

  1. Open Agentcast in the dashboard and add it to a workspace.
  2. Enable the server for the chats that should use its tools.

Desktop only via STDIO. STDIO servers start a local process, so they need the SourceWeft desktop host.

Other MCP clients

Follow the launch instructions in the repository.

README

agentcast-mcp

[npm] [tests] [mcp]

An MCP server that gives AI assistants the ability to enforce structured output: extract JSON from messy LLM text, gate it against a shape spec, and produce the retry feedback message when the model returns the wrong shape.

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

Tools exposed

extract_json

Pull a JSON value out of messy LLM output. Tries the whole text, then a fenced ```json ``` block, then the largest balanced {...} / [...] substring. Returns the parsed value plus which strategy succeeded.

json
{  "text": "Sure, here you go:\n```json\n{\"answer\": 42}\n```\nLet me know!"}

→

json
{  "value": { "answer": 42 },  "found": true,  "source": "fenced_json"}

source is one of whole, fenced_json, fenced_plain, balanced_substring, or none.

validate_response

Validate a parsed JSON value against an agentcast shape spec. Spec maps field name to type: string, number, boolean, array, object. Suffix with ? for optional.

json
{  "value": { "name": "ada" },  "shape": { "name": "string", "age": "number" }}

→

json
{  "valid": false,  "error": "missing required field 'age'"}

build_retry_prompt

Given an attempt history, produce the validation-error feedback message agentcast appends to the conversation when the model returned the wrong shape. Codifies the "validation error as feedback" pattern for non-Node MCP clients that want to drive the same retry loop manually.

json
{  "attempts": [    { "text": "{\"name\":\"ada\"}", "error": "missing required field 'age'" }  ],  "expected_shape": { "name": "string", "age": "number" }}

→

json
{  "feedback": "Your previous response did not match the required shape. Error: missing required field 'age'\n\nTry again. Respond with ONLY valid JSON that fixes the error above.\n\nExpected shape: {\"name\":\"string\",\"age\":\"number\"}"}

Install

Claude Desktop

Add to claude_desktop_config.json:

json
{  "mcpServers": {    "agentcast": {      "command": "npx",      "args": ["-y", "@mukundakatta/agentcast-mcp"]    }  }}

Cursor / Cline / Windsurf / Zed

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

Local install

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

Why this matters

When an LLM is supposed to return structured data, it sometimes wraps the JSON in prose, fences, or hallucinated fields. Standard JSON.parse throws. Hand-rolled regex misses nested structure. This MCP server gives any model driving an agent a real handle on (1) pulling JSON out of the response, (2) checking it matches the expected shape, and (3) building the exact retry prompt that nudges the model to fix it on the next turn.

License

MIT.

Source: README.md at commit f9f4eb8

Tools

0
SourceWeft has not started this package in its sandbox yet, so its tools are not known.

Version history

1
  1. v0.1.0LatestSep 16, 2026

Score

50% of the applicable checks met

How complete this listing is, computed from the registry entry, the endpoint and public sources. Not a rating of the server and not a statement that it is safe or working today: reachability is a dated check, and no installs or reviews go into the score.

  • Reached in the last 30 days25 pts

    Keep the endpoint answering the MCP handshake; SourceWeft probes it every 30 days.

  • Auth declared10 pts

    Declare the credential headers in the registry entry, or keep the endpoint answering the probe so its auth can be classified.

  • Tools listed15 pts

    Answer tools/list without a credential, or ship a package that starts in a sandbox without one.

  • DescriptionRequired15 pts
  • Logo10 pts
  • Documentation15 pts
  • License10 pts