diff --git a/mcp/types-generator/README.md b/mcp/types-generator/README.md index c2cd403f45..dda1c49df6 100644 --- a/mcp/types-generator/README.md +++ b/mcp/types-generator/README.md @@ -1,7 +1,8 @@ # Types Generator This subproject contains helper scripts used in the development of the -Penpot MCP server for generate the types yaml. +Penpot MCP server, specifically for the generation of a YAML file containing +Penpot plugin API types and their documentation. ## Setup @@ -12,15 +13,36 @@ Install the environment via (optional, already handled by `build` script) pixi install +## Running the API Documentation Preparation Script -### Buld API types - -The script `prepare_api_docs.py` reads API documentation from the Web -and collects it in a single yaml file, which is then used by an MCP +The script `prepare_api_docs.py` reads API documentation from a Web URL +and collects it in a single YAML file, which is then used by an MCP tool to provide API documentation to an LLM on demand. +Successful execution will generate the output file `../packages/server/data/api_types.yml`. + +### Generating the YAML File for a Given URL + Running the script: - ./build + pixi run python prepare_api_docs.py -This will generate `../packages/server/data/api_types.yml`. +You can alternatively run `./build `, which additionally performs pixi environment installation. + +For example, to generate the API documentation based on the current PROD Penpot API documentation, +use the URL + + https://doc.plugins.penpot.app + +### Generating the YAML File Based on the Current Documentation in the Repository + +Requirement: [Caddy](https://caddyserver.com/download) must be installed and available in the system path. + +To generate the API documentation based on the current documentation in the repository, +run the `build:types` script in the parent directory, i.e. + + cd .. + pnpm run build:types + +This will spawn a local HTTP server on port 9090 and run the `prepare_api_docs.py` script with the +URL `http://localhost:9090`.