agentcast-mcp
agentcast-mcp
AI 어시스턴트가 구조화된 출력을 강제할 수 있도록 지원하는 MCP 서버입니다. 지저분한 LLM 텍스트에서 JSON을 추출하고, 형태 사양(shape spec)에 따라 검증하며, 모델이 잘못된 형태를 반환할 경우 재시도 피드백 메시지를 생성합니다.
@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"
}source는 whole, fenced_json, fenced_plain, balanced_substring 또는 none 중 하나입니다.
validate_response
agentcast 형태 사양에 따라 파싱된 JSON 값을 검증합니다. 사양은 필드 이름을 string, number, boolean, array, object 유형에 매핑합니다. 선택 사항인 경우 ?를 접미사로 붙입니다.
{
"value": { "name": "ada" },
"shape": { "name": "string", "age": "number" }
}→
{
"valid": false,
"error": "missing required field 'age'"
}build_retry_prompt
시도 기록을 바탕으로, 모델이 잘못된 형태를 반환했을 때 agentcast가 대화에 추가하는 검증 오류 피드백 메시지를 생성합니다. 동일한 재시도 루프를 수동으로 실행하려는 비 Node.js 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: 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을 산문, 펜스(fences) 또는 환각된 필드로 감싸는 경우가 있습니다. 표준 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.
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.-