I turned a real OpenAPI into an MCP server in 5 min (without losing custom code on regen)
Описание и применение
Генератор MCP теперь группирует операции по тегам, создавая управляемое количество инструментов, поддерживает фильтрацию, инкрементальное обновление и сохранение пользовательского кода.
Задача
Generating an MCP server from a large OpenAPI spec produced too many tools (one per operation), making the server unusable.
Результат
The generator now produces a manageable number of tools, supports selective generation, preserves custom code across regenerations, and offers improved language support and validation.
Рабочий процесс
- 1. Run generator with grouping:
node dist/cli/index.js generate -i api.yaml -o ./out --group-by tag - 2. Optionally filter by tags or paths:
--include-tags pets --group-by tagor--path-prefix "/users/" - 3. Add custom code between markers (
// @@mcp-gen:start:…and// @@mcp-gen🔚…) to survive regeneration - 4. Regenerate incrementally:
node dist/cli/index.js generate -i api.yaml -o ./out --incremental - 5. Validate spec:
node dist/cli/index.js validate -i examples/petstore.yaml
Доказательства
200 operations across 8 tags become ~8 tools. Each group routes internally by action.
Your code lives between markers and survives regen with a 3‑way merge
- Дата записи: 2026-09-22T07:30:31.296Z