# Agentcast Mcp

> MCP server: structured-output enforcer for any LLM. Wraps @mukundakatta/agentcast.

- **Type:** MCP server
- **Install:** `agentstack add mcp-mukundakatta-agentcast-mcp`
- **Verified:** Yes — security-reviewed for prompt injection and unsafe behavior
- **Seller:** [MukundaKatta](https://agentstack.voostack.com/s/mukundakatta)
- **Installs:** 0
- **Category:** [AI & ML](https://agentstack.voostack.com/c/ai-and-ml)
- **Latest version:** 0.1.0
- **License:** MIT
- **Upstream author:** [MukundaKatta](https://github.com/MukundaKatta)
- **Source:** https://github.com/MukundaKatta/agentcast-mcp
- **Website:** https://doi.org/10.5281/zenodo.20074702

## Install

```sh
agentstack add mcp-mukundakatta-agentcast-mcp
```

Requires the [AgentStack CLI](https://agentstack.voostack.com/docs/cli). Works with Claude Code, Cursor, and any MCP-compatible agent.

## About

# agentcast-mcp

[](https://www.npmjs.com/package/@mukundakatta/agentcast-mcp)
[](#)
[](https://modelcontextprotocol.io)

An [MCP](https://modelcontextprotocol.io) 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`](https://github.com/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-mcp
mcp-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 & license

This open-source MCP server is cataloged on AgentStack and links to its original source — we do not rehost the code.

- **Author:** [MukundaKatta](https://github.com/MukundaKatta)
- **Source:** [MukundaKatta/agentcast-mcp](https://github.com/MukundaKatta/agentcast-mcp)
- **License:** MIT
- **Homepage:** https://doi.org/10.5281/zenodo.20074702

Install and usage instructions live in the source repository linked above.

## Pricing

- **Free** — Free

## Security capabilities

Automated source analysis of v0.1.0 — what this tool can access:

- **Network access:** no
- **Filesystem access:** no
- **Shell / process execution:** no
- **Environment & secrets:** no
- **Dynamic code execution:** no

*"Yes" means the capability is present in the source — more access means more to trust, not that it is unsafe.*


## Versions

- **0.1.0** — security scan: passed — Imported from the upstream source.

## Links

- Listing page: https://agentstack.voostack.com/l/mcp-mukundakatta-agentcast-mcp
- Seller: https://agentstack.voostack.com/s/mukundakatta
- Browse the marketplace: https://agentstack.voostack.com/browse

---
Listed on AgentStack — the marketplace for AI agent skills and MCP servers. Every listing is security-reviewed. Creators keep 70%.
