Polyester ships an MCP server so AI assistants can create, validate, and compile .poly documents.
The Polyester MCP server gives AI assistants direct access to the component system. Instead of guessing at syntax, an AI can look up components, validate its output, and compile documents—all through structured tool calls.
Tool | Parameters | Returns |
|---|---|---|
list_components | category (optional) | Component names and descriptions |
get_component_help | name (required) | Full docs: args, flags, examples |
validate_document | source (required) | Parse errors and warnings with line numbers |
compile_document | source (required) | Standalone HTML string |
Browse all 27 components, optionally filtered by category: layout, content, style, or interactive.
Get the full spec for a component—arguments, flags with descriptions, and usage examples. Pass the name with or without the leading /.
Parse a .poly source string and report any errors or unknown-command warnings with line numbers. Returns "Document is valid" when clean.
Compile a .poly source string to a complete standalone HTML document with embedded CSS and syntax highlighting.
Pre-built prompt templates that guide the AI toward good Polyester output.
Generates a starter document for a given type. The AI receives type-specific hints:
Converts HTML, Markdown, or LaTeX source into Polyester syntax. The AI receives mapping guidelines for translating constructs from the source format.
The MCP server exposes read-only resources that AI clients can fetch for context.
URI | Type | Content |
|---|---|---|
polyester://syntax-guide | text/markdown | Full language reference |
polyester://components | application/json | Complete component registry |
polyester://examples/{name} | text/plain | Example files from the examples directory |
Add to your project's .mcp.json (or your editor's MCP config):
{
"mcpServers": {
"polyester": {
"command": "node",
"args": ["dist/mcp/server.js"]
}
}
}The server uses stdio transport. Point the args path to your Polyester installation's dist/mcp/server.js.
The MCP server works with any client that supports the Model Context Protocol:
.mcp.json