{
  "markdown": "<h1 align=\"center\">Rocket.Chat MCP Server Generator</h1>\n\n<p align=\"center\">\n  An <a href=\"https://modelcontextprotocol.io/\">MCP</a> server that generates other MCP servers — scoped to only the API operations a project actually needs.\n</p>\n\n<p align=\"center\">\n  <a href=\"https://nodejs.org/\"><img src=\"https://img.shields.io/badge/node-%3E%3D22-brightgreen.svg\" alt=\"Node.js >= 22\"></a>\n  <a href=\"https://www.typescriptlang.org/\"><img src=\"https://img.shields.io/badge/TypeScript-5.9-blue.svg\" alt=\"TypeScript 5.9\"></a>\n  <a href=\"https://github.com/modelcontextprotocol/typescript-sdk\"><img src=\"https://img.shields.io/badge/MCP%20SDK-1.x-purple.svg\" alt=\"MCP SDK 1.x\"></a>\n  <a href=\"https://github.com/RocketChat/MCPServerGenerator_GSoC2026/actions/workflows/ci.yml\"><img src=\"https://github.com/RocketChat/MCPServerGenerator_GSoC2026/actions/workflows/ci.yml/badge.svg\" alt=\"CI\"></a>\n</p>\n\n## Overview\n\nRocket.Chat's public OpenAPI surface spans 12 domains and several hundred operations. An MCP server that wraps all of them has to declare all of them as tools, and a client re-sends those declarations on every turn — so a project pays context cost proportional to the tools it declares, not the ones it calls.\n\nThis generator takes a different approach. It exposes the API surface as discovery tools, so an AI client can find the operations a goal needs, describe them as multi-step **workflow tools**, and have a complete, runnable MCP server project written to disk. A generated server exposes one tool per workflow rather than one tool per endpoint.\n\nEach workflow chains API calls, LLM reasoning, human confirmation, data transforms, and conditional branching behind a single tool call. The workflow engine is copied into the output, so a generated project has no runtime dependency on this generator.\n\n## Features\n\n- **Workflow tools, not endpoint wrappers** — five step types (`api_call`, `sampling`, `elicitation`, `transform`, `conditional`) composed into one MCP tool per workflow.\n- **Live OpenAPI specs** — fetched from the [Rocket.Chat Open API repository](https://github.com/RocketChat/Rocket.Chat-Open-API) at runtime and cached for 24 hours, so new endpoints appear without hand-written definitions.\n- **Fail-closed generation** — if any referenced `operationId` cannot be resolved against the spec, nothing is written.\n- **Sandboxed expressions** — `transform` and `conditional` bodies are validated against an AST allowlist before they run.\n- **Two transports** — stdio, or Streamable HTTP with closed-by-default network settings.\n- **Additive regeneration** — add workflows to an existing project without overwriting files you have edited.\n- **Derived permissions** — for Rocket.Chat, the generated README lists the permissions the server's account needs.\n- **Self-contained output** — generated projects ship their own tests, README, and workflow diagram.\n\nRocket.Chat is the supported target. A `PlatformAdapter` seam keeps the generator core free of platform specifics, and an experimental generic OpenAPI adapter exists behind it, but it is not wired to a user-facing option yet.\n\n## How it works\n\nThe generator is an MCP server exposing three tools, called in sequence:\n\n| Tool                   | Purpose                                                          |\n| ---------------------- | ---------------------------------------------------------------- |\n| `get_capability_guide` | Lists the available REST API operations with their operationIds  |\n| `get_endpoint_schemas` | Returns the request and response schemas the spec documents      |\n| `generate`             | Validates the workflows and writes a complete MCP server project |\n\n### `generate` parameters\n\n| Parameter   | Type                          | Default       | Purpose                            |\n| ----------- | ----------------------------- | ------------- | ---------------------------------- |\n| `dsl`       | `string`                      | required      | The workflow DSL document          |\n| `outputDir` | `string`                      | `generated/`  | Where to write the project         |\n| `writeMode` | `\"overwrite\"` \\| `\"additive\"` | `\"overwrite\"` | See [Write modes](#write-modes)    |\n| `transport` | `\"stdio\"` \\| `\"http\"`         | `\"stdio\"`     | Transport for the generated server |\n\nThe project is written to `<outputDir>/<project-name>`, where the name is sanitized for use as a directory and identifier (`release-notifier` becomes `release_notifier`).\n\n## Installation\n\n### Prerequisites\n\n- [Node.js](https://nodejs.org/) v22 or newer\n- An MCP-compatible client (Antigravity CLI, Claude Desktop, Cursor, VS Code, or any other)\n\n### Setup\n\n```bash\ngit clone https://github.com/RocketChat/MCPServerGenerator_GSoC2026.git\ncd MCPServerGenerator_GSoC2026\nnpm install\n```\n\n### Register with an MCP client\n\nThe generator speaks MCP over stdio, so any MCP client can drive it:\n\n```jsonc\n{\n  \"mcpServers\": {\n    \"mcp-server-generator\": {\n      \"command\": \"node\",\n      \"args\": [\"--import\", \"tsx\", \"src/index.ts\"],\n      \"cwd\": \"/absolute/path/to/MCPServerGenerator_GSoC2026\",\n    },\n  },\n}\n```\n\nAntigravity CLI reads workspace MCP servers from `.agents/mcp_config.json`; Claude Desktop uses `claude_desktop_config.json`. The block above is the same shape in both.\n\n## Usage\n\nDescribe what you need, and the client drives the three tools:\n\n```\n> I need an MCP server that drafts a release announcement,\n  asks me to approve it, then posts it to a channel\n```\n\nTo run the generator directly instead:\n\n```bash\nnpm run dev                  # from source via tsx\nnpm run build && npm start   # compiled\n```\n\n### Example\n\nThe DSL passed to `generate`:\n\n```\nPROJECT release-notifier\nDESCRIPTION Drafts a release announcement, gets human sign-off, then posts it\n\nWORKFLOW announce_release\n  DESCRIPTION Draft an announcement, confirm it with a human, then post it\n  PARAM channel : string : Target channel, e.g. #announcements\n  PARAM highlights : string : Raw release notes to turn into an announcement\n\n  STEP draft : sampling\n    LABEL Draft the announcement\n    PROMPT <<<\n      Write a short release announcement from these highlights:\n      {{params.highlights}}\n    >>>\n\n  STEP confirm : elicitation\n    LABEL Human sign-off before posting\n    MESSAGE Post this announcement? {{steps.draft}}\n    SCHEMA {\"type\":\"object\",\"properties\":{\"approved\":{\"type\":\"boolean\"}}}\n    ON_DECLINE abort\n\n  STEP post : api_call\n    LABEL Post to the channel\n    OPERATION post-api-v1-chat_postMessage\n    MAP channel = {{params.channel}}\n    MAP text = {{steps.draft}}\n```\n\nThis produces one MCP tool, `announce_release`, taking `channel` and `highlights`. Behind that single call the engine asks the model for a draft, pauses for human approval, and posts the approved text — with `ON_DECLINE abort` stopping the run if approval is refused.\n\n### Write modes\n\n**`overwrite`** (default) writes the project fresh.\n\n**`additive`** adds workflows to an existing generated project without clobbering files you have edited. Generated files are fingerprinted in `.mcp-gen-manifest.json`; on a re-run the generator compares fingerprints and reports what was added, refreshed, preserved, and where a conflict, stale scaffold, or orphan needs attention. A missing or unparseable manifest is treated as \"not a generated project\", and everything is preserved.\n\n## Workflow DSL\n\nThe DSL is flat and line-oriented — every meaningful line is `KEYWORD value`, and indentation is cosmetic.\n\n```\nPROJECT <name>\nDESCRIPTION <text>\n\nWORKFLOW <name>            -> becomes one MCP tool\n  DESCRIPTION <text>\n  PARAM <name> : <type>    -> becomes a tool input\n  STEP <id> : <type>       -> one unit of work\n    <step keywords...>\n```\n\n### Step types\n\n| Type          | Purpose                        | Required field                   |\n| ------------- | ------------------------------ | -------------------------------- |\n| `api_call`    | Call a REST endpoint           | `OPERATION`                      |\n| `sampling`    | LLM reasoning over prior state | `PROMPT`                         |\n| `elicitation` | Ask the user and wait          | `MESSAGE`                        |\n| `transform`   | Reshape data with JavaScript   | `EXPRESSION`                     |\n| `conditional` | Branch execution               | `CONDITION` + (`THEN` or `ELSE`) |\n\nSee the **[DSL Reference](docs/DSL_REFERENCE.md)** for the full grammar, template and `MAP` rules, iteration, and the complete error catalog.\n\n> `WEBHOOK` blocks are parsed and validated but not yet emitted into generated servers.\n\n## Generated output\n\n```\n<project-name>/\n├── src/\n│   ├── server.ts              # MCP server, tool registration, transport\n│   ├── endpoints.ts           # operationId -> { method, path }\n│   ├── rc-client.ts           # REST client\n│   ├── engine/                # workflow runtime, copied in verbatim\n│   │   ├── types.ts\n│   │   ├── expression-security.ts\n│   │   ├── templates.ts\n│   │   ├── api-call.ts\n│   │   ├── sampling.ts\n│   │   ├── executor.ts\n│   │   └── index.ts\n│   ├── tools/<workflow>.ts    # one per workflow: step data + handler\n│   └── tests/\n│       ├── setup.ts           # network-free mocks\n│       └── <workflow>.test.ts # one smoke test per workflow\n├── .env.example\n├── .gitignore\n├── .mcp-gen-manifest.json\n├── package.json\n├── tsconfig.json\n└── README.md\n```\n\n```bash\ncd generated/<project-name>\nnpm install\ncp .env.example .env    # fill in credentials\nnpm start\n```\n\nSee **[Generated Project Anatomy](docs/GENERATED_PROJECT.md)** for a file-by-file walkthrough.\n\n## Development\n\n```bash\nnpm test         # full suite\nnpm run check    # format:check + lint + typecheck + test + build\n```\n\n| Script                     | Does                          |\n| -------------------------- | ----------------------------- |\n| `npm run dev`              | Run from source via tsx       |\n| `npm start`                | Run compiled `dist/`          |\n| `npm run build`            | Compile + copy engine sources |\n| `npm test`                 | Full suite via `node:test`    |\n| `npm run test:unit`        | Unit tests only               |\n| `npm run test:integration` | Integration tests only        |\n| `npm run typecheck`        | `tsc --noEmit`                |\n| `npm run lint`             | ESLint                        |\n| `npm run format`           | Prettier, write mode          |\n\nTests run on `node:test` via `tsx`. Unit tests are network-free; integration tests exercise the real OpenAPI fetch and cache path. See the **[Testing Guide](docs/TESTING.md)** for the suite map and conventions.\n\nSee **[Contributing](CONTRIBUTING.md)** for setup and workflow.\n",
  "bytes": 10651,
  "sha": "5be1c935ec6b9783cc415e25089fd5e51759cf811e1ae24f8d18162a5c79338b",
  "repo_slug": "rocketchat/mcpservergenerator_gsoc2026",
  "fonte": "repo",
  "truncated": false,
  "api": "https://agentalog.com/api/listings/plg_rocketchat_mcpservergenerator_gsoc2026_cc6faff2/readme"
}