agentcast-mcp
agentcast-mcp
MCP-сервер (MCP), который дает ИИ-ассистентам возможность обеспечивать структурированный вывод: извлекать JSON из «грязного» текста LLM, проверять его на соответствие спецификации формы и создавать сообщение с обратной связью для повторной попытки, когда модель возвращает неверную форму.
Построен на базе @mukundakatta/agentcast. Работает с Claude Desktop, Cursor, Cline, Windsurf, Zed и любым другим MCP-клиентом.
Предоставляемые инструменты
extract_json
Извлекает значение JSON из «грязного» вывода LLM. Сначала пытается обработать весь текст, затем блок ```json ```, затем самую большую сбалансированную подстроку {...} / [...]. Возвращает разобранное значение и стратегию, которая сработала.
{
"text": "Sure, here you go:\n```json\n{\"answer\": 42}\n```\nLet me know!"
}→
{
"value": { "answer": 42 },
"found": true,
"source": "fenced_json"
}source может принимать значения whole, fenced_json, fenced_plain, balanced_substring или none.
validate_response
Проверяет разобранное значение JSON на соответствие спецификации формы agentcast. Спецификация сопоставляет имя поля с типом: string, number, boolean, array, object. Добавьте ? для необязательных полей.
{
"value": { "name": "ada" },
"shape": { "name": "string", "age": "number" }
}→
{
"valid": false,
"error": "missing required field 'age'"
}build_retry_prompt
На основе истории попыток создает сообщение с обратной связью об ошибке валидации, которое agentcast добавляет в диалог, когда модель возвращает неверную форму. Кодифицирует паттерн «ошибка валидации как обратная связь» для MCP-клиентов не на Node, которые хотят управлять тем же циклом повторных попыток вручную.
{
"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: genpark-structured-extract-schema-validator-skill
Установка
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.
Available Tools
3 toolsbuild_retry_promptA
Given an attempt history, produce the retry feedback message agentcast would append to the conversation when the model returned the wrong shape. Codifies the "validation error as feedback" pattern for non-Node MCP clients.
Inputs: attempts (required), expected_shape.
extract_jsonA
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.
Inputs: text (required).
validate_responseA
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. Returns valid=true on success, or valid=false with a human-readable error string suitable for retry feedback.
Inputs: shape (required), value (required).
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 3 tools
Each tool has a clear, distinct purpose: build_retry_prompt handles feedback generation, extract_json extracts JSON from text, and validate_response checks JSON against a spec. There is no functional overlap.
All tool names follow a consistent verb_noun pattern in snake_case (build_retry_prompt, extract_json, validate_response), making them predictable and easy to understand.
With only 3 tools, the server is slightly underpopulated but still appropriately scoped for the narrow domain of agent response validation and retry feedback. It covers the core workflow without unnecessary bloat.
The tools cover the essential pipeline of extracting JSON, validating it against a spec, and generating retry feedback. A minor gap is the lack of explicit handling of attempt history beyond what build_retry_prompt expects, but that is assumed provided by the client.
Maintenance
Related MCP Connectors
Deterministic JSON repair, validate, example-gen, schema-coerce for agents. Zero LLM, sub-10ms.
Repair broken JSON from LLM output and validate it against a JSON Schema.
Repair broken LLM JSON and check it against a JSON Schema. Flags cut-off output. Free trial.
Turn messy text into strict JSON schemas agents can trust (invoice, receipt, contact, resume).
Related MCP Servers
- AlicenseNot gradedqualityDmaintenanceDeterministic 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
- FlicenseNot gradedqualityNot gradedmaintenanceEnables deterministic extraction and validation of structured JSON data from inputs using a defined schema. It plugs into MCP-compatible clients like Claude Desktop, Cursor, and Windsurf to return standardized, schema-validated results.-
- AlicenseNot gradedqualityBmaintenanceProvides deterministic JSON repair and JSON Schema validation for malformed AI agent outputs, safely fixing unambiguous errors without an LLM and refusing ambiguous cases.49 PyPIMIT
- FlicenseNot gradedqualityNot gradedmaintenanceEnables agents and MCP clients to deterministically extract and repair JSON/schema issues such as truncated braces, markdown wrappers, and invalid types without LLM round-trips.-