Skip to main content
Glama

agentcast-mcp

npm tests mcp

一个 MCP 服务器,使 AI 助手能够强制执行结构化输出:从混乱的 LLM 文本中提取 JSON,根据形状规范进行门控,并在模型返回错误形状时生成重试反馈消息。

构建于 @mukundakatta/agentcast 之上。适用于 Claude Desktop、Cursor、Cline、Windsurf、Zed 以及任何其他 MCP 客户端。

公开的工具

extract_json

从混乱的 LLM 输出中提取 JSON 值。尝试整个文本,然后是带围栏的 ```json ``` 块,最后是最大的平衡 {...} / [...] 子字符串。返回解析后的值以及成功的策略。

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

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

sourcewholefenced_jsonfenced_plainbalanced_substringnone 之一。

validate_response

根据 agentcast 形状规范验证解析后的 JSON 值。规范将字段名称映射到类型:stringnumberbooleanarrayobject。后缀加 ? 表示可选。

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

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

build_retry_prompt

给定尝试历史记录,生成当模型返回错误形状时 agentcast 附加到对话中的验证错误反馈消息。为希望手动驱动相同重试循环的非 Node MCP 客户端编纂了“验证错误作为反馈”模式。

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

{
  "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\"}"
}

Related MCP server: JSONShelf

安装

Claude Desktop

添加到 claude_desktop_config.json

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

Cursor / Cline / Windsurf / Zed

相同的形状,在您客户端对应的 mcp.json 中。大多数客户端通过 npx -y @mukundakatta/agentcast-mcp 自动发现。

本地安装

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

为什么这很重要

当 LLM 应该返回结构化数据时,它有时会用散文、围栏或幻觉字段包裹 JSON。标准的 JSON.parse 会抛出错误。手动编写的正则表达式会错过嵌套结构。此 MCP 服务器为驱动代理的任何模型提供了真正的控制权,用于 (1) 从响应中提取 JSON,(2) 检查它是否符合预期的形状,以及 (3) 构建精确的重试提示,引导模型在下一轮中修复它。

许可证

MIT。

Install Server
A
license - permissive license
A
quality
C
maintenance

Maintenance

Maintainers
Response time
Release cycle
Releases (12mo)
Commit activity

Resources

Unclaimed servers have limited discoverability.

Looking for Admin?

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

Related MCP Servers

  • A
    license
    -
    quality
    C
    maintenance
    Deterministic JSON validation and repair for AI agents. Validates, repairs, schema-checks, and diffs JSON so long-running agents don't corrupt their session state with malformed writes.
    MIT
  • A
    license
    A
    quality
    D
    maintenance
    Fact-checks and fixes AI outputs by catching hallucinations, repairing broken JSON, and correcting errors before they reach users, with tools for verification, validation, and correction.
    4
    44
    MIT

View all related MCP servers

Related MCP Connectors

  • Deterministic JSON repair, validate, example-gen, schema-coerce for agents. Zero LLM, sub-10ms.

  • Repair malformed JSON from LLM/agent output; optional JSON Schema coercion. Free + x402 paid.

  • Deterministic validation for AI-generated artifacts: JSON Schema, OpenAPI response, SQL syntax.

View all MCP Connectors

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/agentcast-mcp'

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