Update v5.0 - Preline MCP, AI Prompts, Animated Icons and more. Visit Changelog

TRAE Preline MCP Setup

Connect Preline UI MCP to TRAE IDE, then ask TRAE to build with real Preline components, blocks, documentation, and framework guidance.

Setup overview

The hosted Preline UI MCP server is ready to use from TRAE. It uses Streamable HTTP and requires an API key, sent as a bearer token.

MCP endpoint
https://mpc.preline.co
Transport
Streamable HTTP
Authentication
Authorization: Bearer TOKEN_KEY

Once connected, TRAE can discover Preline catalog items, fetch the matching source, and place HTML, CSS, scripts, and init code in the right files. For broader MCP prompting guidance, see the Preline UI MCP Server guide.

For the most up-to-date instructions for adding MCP servers in TRAE IDE, see the official TRAE MCP setup guide.

TRAE IDE

  1. Open the MCP settings

    In IDE mode, select the Settings icon in the upper-right corner. In SOLO mode, use the Settings icon in the upper-right corner of the chat panel. Then select MCP in the left navigation.

  2. Add the Preline server manually

    Select Add > Add Manually. Paste the JSON below into Configure Manually, replace TOKEN_KEY, and select Confirm.

    MCP server configuration
                          
                            {
                              "mcpServers": {
                                "preline": {
                                  "url": "https://mpc.preline.co",
                                  "headers": {
                                    "Authorization": "Bearer TOKEN_KEY"
                                  }
                                }
                              }
                            }
                          
                        

    TRAE's HTTP configuration uses url and optional headers. No separate transport field is required.

  3. Verify the connection

    Confirm that preline appears in the MCP server list, then inspect its connection status and available tools.

TRAE CLI: TRAE's official enterprise page currently labels its CLI as coming soon. This guide therefore covers TRAE IDE only and does not include unverified terminal commands.

Project-level configuration

  1. Create the project configuration

    To share the MCP definition with a project, create .trae/mcp.json under the project root and add the same configuration:

    .trae/mcp.json
                          
                            {
                              "mcpServers": {
                                "preline": {
                                  "url": "https://mpc.preline.co",
                                  "headers": {
                                    "Authorization": "Bearer TOKEN_KEY"
                                  }
                                }
                              }
                            }
                          
                        

    Keep the token private: this project file contains a credential. Do not commit a real API key to version control. For a personal setup, use Add Manually instead of storing the token in the repository.

  2. Enable project-level MCP

    Open Settings > MCP, enable project-level MCP with its toggle, and confirm the operation. TRAE loads relevant project servers automatically when their capabilities are needed.


Install Preline Agent Skills

MCP gives TRAE access to the Preline catalog. Agent Skills add Preline-specific workflow instructions, so TRAE is more likely to follow the right discovery, placement, theming, and validation habits.

Install the Preline skills from your project root:

Terminal
                      
                        npx skills add htmlstreamofficial/preline
                      
                    

Choose the shared .agents/skills/ project path when prompted. In TRAE, open Settings > Skills & Commands and enable the .agents/skills/ directory. TRAE also supports native project skills in .trae/skills/ and global skills in ~/.trae/skills/ on macOS/Linux or %userprofile%/.trae/skills on Windows. Each skill is a folder containing SKILL.md; when names collide, the native .trae/skills/ version takes precedence. For the full setup workflow, see How to set up Agent Skills.

Build with Preline

Prompt TRAE in plain language. Name Preline, describe the component or block you want, and mention the file or framework context when it matters.

Prompt
                      
                        Using Preline, add a pricing comparison section to app/pricing.html.
                        Use the default theme and keep the existing page header.
                      
                    
Prompt
                      
                        Use Preline MCP to add a modal with a form.
                        Wire the required scripts into the existing layout.
                        Keep my current Tailwind setup.
                      
                    
Prompt
                      
                        Show me the Preline dropdown JavaScript API.
                        Then update this dropdown to close after item selection.
                      
                    

Troubleshooting

TRAE does not list the Preline server.

Open Settings > MCP and check the server list. For a project server, confirm .trae/mcp.json is valid JSON, project-level MCP is enabled, and preline is nested under mcpServers.

TRAE says the server is unreachable or times out.

Review preline in Settings > MCP. Confirm the URL is https://mpc.preline.co and reopen the manual or raw JSON configuration to check the saved header.

The server responds with "Missing API key".

The request reached the server without a valid Authorization: Bearer TOKEN_KEY header. Confirm the header is inside the preline server entry and replace TOKEN_KEY with your actual Preline API key.

TRAE writes generic Tailwind CSS instead of using Preline.

Make the instruction explicit: say Use Preline MCP or Using Preline, then name the component, block, theme, and target file.

© 2026 Preline Labs.