Skip to content
Lenso UI

MCP server

Expose the matching contract to an MCP client through a read-only stdio server.

Availability and launch

@lenso/ui-mcp@0.1.0 is currently private and unpublished; the configuration below is a future example, not a currently runnable npm install. After publication, pin it to the release matching the installed UI, tokens and support packages:

{  "mcpServers": {    "lenso-ui": {      "command": "npx",      "args": ["--yes", "--package=@lenso/ui-mcp@<matching-version>", "lenso-ui-mcp"],    },  },}

Use the Node range reported by the matching contract; the current toolchain requires Node 26.10.0 or a later Node 26 release. This launches a stdio server, not an interactive prompt. Stdout carries JSON-RPC; diagnostics use stderr. The installed server needs no repository checkout, React, Next or TypeScript/StyleX compiler. The official MCP TypeScript SDK remains a runtime dependency. Source generation and builds are maintainer-only; see the package maintainer guide.

Discover the eight tools

ToolInputResult
get_component_sourcecomponentActual implementation and local supporting graph
get_theme_variablesNo theme argumentExact CSS, raw scoped declarations and editor metadata
list_componentsNo component argumentCanonical families and public parts
get_component_apicomponentNative signatures, state and resolved property rows
get_component_examplescomponent, optional localeLocal source and ordered supporting files
get_component_stylescomponentActual StyleX map source
search_documentationquery, optional locale, limitAuthored documentation matches
get_documentationslug, optional localeExact authored Markdown

Locales are en and cn, defaulting to en. Search limits are integers from 1 to 50, defaulting to 10. Every tool accepts optional lensoVersion and digest identity arguments, which must match the server's contract.

Responses include release metadata and digest. Discover schemas through the protocol and take canonical component names from list_components; menu is the public popup menu family.

Implementation queries do not bundle third-party dependency implementations. Theme declarations preserve raw CSS expressions and scopes, not computed color claims. These additions use contract format 3 and the same digest as API, examples and documentation; older tool contracts must be regenerated and rebuilt.

Read-only boundary

The server has no shell execution, file-writing, caller-selected filesystem path, remote transport or upstream request forwarding. Tools do not open network connections. Returned source and prose are reference data, not executable instructions.

Startup validates the encoded contract once. Individual tools resolve selected records on demand, and search stops at its requested result bound. A stale or mismatched contract is an error, not a reason to fall back to another cached release.