Kiro Preline MCP Setup
Connect Preline UI MCP to Kiro CLI or the Kiro IDE, then ask Kiro to build with real Preline components, blocks, documentation, and framework guidance.
Setup overview
The hosted Preline UI MCP server uses Streamable HTTP and requires an API key sent as a bearer token. Kiro supports remote MCP servers with a URL and custom HTTP headers.
- MCP endpoint
https://mpc.preline.co- Transport
- Streamable HTTP
- Authentication
Authorization: Bearer TOKEN_KEY
Kiro CLI and Kiro IDE use the same MCP configuration locations: .kiro/settings/mcp.json for the current workspace and ~/.kiro/settings/mcp.json for all workspaces. Workspace entries take precedence when the same server name exists at both levels.
For the most up-to-date instructions for adding MCP servers in Kiro IDE and CLI, see the official Kiro configuration guide.
Setup
Choose the Kiro surface you use. Both setup paths connect to the hosted Preline MCP server.
-
Export your API key
Export your Preline API key in the shell that launches Kiro CLI:
Terminalexport PRELINE_MCP_TOKEN="TOKEN_KEY" -
Add the Preline MCP configuration
Create or update
.kiro/settings/mcp.jsonin your project. Use~/.kiro/settings/mcp.jsoninstead if you want Preline available in every workspace:.kiro/settings/mcp.json{ "mcpServers": { "preline": { "url": "https://mpc.preline.co", "headers": { "Authorization": "Bearer ${PRELINE_MCP_TOKEN}" } } } }Keep the token out of JSON. Kiro expands
${PRELINE_MCP_TOKEN}from the environment. If you commit a workspace config, commit only the variable reference, never the token value. -
Verify the connection
Kiro CLI hot-reloads MCP configuration after you save it. The updated server is reconciled at the next idle boundary, without restarting the session. In an interactive session, run
/mcpto see the active server, its connection status, and available tools.
-
Open and update the MCP configuration
Kiro IDE reads the same workspace and user MCP files. To open the correct file from the app:
- Open the Command Palette with
Cmd + Shift + Pon macOS orCtrl + Shift + Pon Windows and Linux. - Select Kiro: Open workspace MCP config (JSON) or Kiro: Open user MCP config (JSON).
- Add the same
prelineentry shown above and save the file. Kiro reconnects automatically.
Kiro must be able to read the environment variable. If
PRELINE_MCP_TOKENis missing or misspelled, the header cannot be expanded. Set the variable in the environment used by Kiro, then save the MCP config again so the server reconnects. - Open the Command Palette with
-
Enable MCP support
Open Settings, search for MCP, and make sure MCP support is enabled.
-
Verify the server and inspect logs
Open the Kiro panel, select the MCP servers tab, and confirm that Preline is connected.
For connection details, open the Kiro panel's Output tab and choose Kiro - MCP Logs.
Install Preline Agent Skills
MCP gives Kiro access to the Preline catalog. Agent Skills add Preline-specific instructions for discovery, placement, theming, and validation. Install the Preline skills from your project root:
npx skills add htmlstreamofficial/preline
When the installer asks for a target, select Kiro. Workspace skills live in .kiro/skills/; global skills live in ~/.kiro/skills/. Workspace skills take precedence when names conflict. Kiro can activate a matching skill automatically, or you can invoke it from the slash-command menu. In Kiro CLI, use /context show to confirm the skills loaded into the current session.
Build with Preline
Prompt Kiro in plain language. Name Preline, describe the component or block, and mention the target file or framework context.
Using Preline MCP, add a pricing comparison section to app/pricing.html.
Use the default theme and keep the existing page header.
Use Preline MCP to add a modal with a form.
Wire the required scripts into the existing layout and keep my Tailwind setup.
Troubleshooting
Preline does not appear in Kiro.
Validate the JSON, confirm the file is at .kiro/settings/mcp.json or ~/.kiro/settings/mcp.json, and save it again. In CLI, run /mcp. In the IDE, make sure MCP support is enabled and inspect the MCP servers tab.
The server responds with "Missing API key".
Kiro could not expand ${PRELINE_MCP_TOKEN}, or the header is missing. Confirm the variable is set in the environment that launched Kiro and that the header value begins with Bearer.
Kiro writes generic Tailwind CSS instead of using Preline.
Say Use Preline MCP, then name the component or block, theme, and target file. Check that the Preline skills appear in Agent Steering & Skills or in CLI output from /context show.
Agent Setup Guides
Switch to another coding agent setup guide.