CSS
Style your xmcp MCP tools with Tailwind CSS, CSS Modules, or plain CSS, including class management and theming for tool-rendered UI components.
For the complete documentation index, see llms.txt. Markdown variants of every page are available by appending .md to the URL.If you're using MCP Apps, xmcp provides your application multiple ways to use CSS:
xmcp automatically detects and imports a globals.css file if it exists in
globals.css, src/globals.css, or src/tools/globals.css (in priority
order). You don't need to manually import it in every tool.
Tailwind CSS
A CSS framework that provides utility classes like flex, pt-4, text-center, and rotate-90. You use these classes directly in your component to build layouts and designs.
Install Tailwind CSS:
Add the PostCSS plugin to your postcss.config.mjs file:
Create a globals.css file in your project root (or src/globals.css) and import Tailwind:
Now you can use Tailwind classes in your tools:
UI package
If you want a schema-driven UI layer or React MCP App helpers on top of xmcp,
use @xmcp-dev/ui.
It gives you:
- a packaged
renderJsontool contract for schema-driven MCP app rendering - a packaged
Renderedpreview component for custom tool wrappers - an
Apprenderer for fully custom rendering flows useMcpApp()anduseAutoMcpAppSize()for handwritten React MCP Apps- a package-owned stylesheet import so you do not need to point Tailwind at package internals directly
Minimal CSS setup:
That import is important because @xmcp-dev/ui components are Tailwind-styled. The package stylesheet handles the internal Tailwind scanning, so you do not need a manual @source entry that points into node_modules or a monorepo path.
Minimal tool setup:
With this setup, the normal path is:
- import the package stylesheet once in
globals.css - expose a tiny local
render-jsontool - let the package own parsing, progressive preview, validation hardening, and theme fallback
The renderer defaults to transportMode: "auto", which prefers the MCP App
host and falls back to HTTP for standalone previews. To require a host, use:
The full @xmcp-dev/ui rendering flow, customization levels, and theme
behavior are documented in UI rendering.
CSS
Write standard CSS to style your components without any framework or tooling.
Create a globals.css file:
Use the styles in your tool:
CSS Modules
Scoped styles that are tied to a specific tool file.
Create a CSS module file with the .module.css extension:
Import the styles object and use it in your tool:
Summary
Pick the approach that fits your project. You can also mix them, for example, use Tailwind for layout and CSS Modules for component-specific styles.
If you're building schema-driven MCP app UIs, @xmcp-dev/ui is the package-owned path that sits on top of these styling options and uses the same globals.css entrypoint.
