You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Scaffold does not escape --name/--description in generated JSON, HTML, and Python #103
The scaffold inserts --name and --description raw into JSON, HTML, YAML and Python output.
An ordinary description containing a double quote, such as Tools for "Foo" engine, produces invalid plugin.json, package.json and site.json.
< or & in a name produces broken HTML.
The result is confusing downstream failures. It also becomes unsafe if the scaffold is ever driven by less-trusted input, for example through an MCP createTool path.
Evidence
scaffold/generator.py:98-104 builds the Jinja Environment without autoescape, and no template uses |tojson or |e.
scaffold/templates/plugin.json.j2:3-4 contains "name": "{{ name }}" and "description": "{{ description }}". site.json.j2 and package.json.j2 follow the same pattern.
scaffold/templates/mcp-server/server.py.j2:14 contains FastMCP("{{ name }}").
Reproduced: a " in the description made all three JSON files fail to parse. Markup in the name was emitted unescaped into <title> and <h1> of the generated docs/index.html.
Suggested approach
Use {{ value|tojson }} for values inside JSON templates and Python string literals.
Turn on autoescaping for HTML templates, with select_autoescape or an explicit |e.
Validate CLI input in create-tool.py: reject control characters and set a sensible maximum length.
Add a test that scaffolds with a hostile fixture (quotes, angle brackets, backslash, newline) and parses every generated JSON, YAML and HTML file.
Done when
Special characters in name and description produce valid, correctly escaped output in every file type, and a test covers it.
Activity