Skip to content

feat(core): once-ui-mcp, a local MCP server over the ai/ harness - #371

Merged
lorant-one merged 2 commits into
feat/3-0-breaking-cleanupfrom
feat/mcp-server
Oct 31, 2026
Merged

lorant-one merged 2 commits into
feat/3-0-breaking-cleanupfrom
feat/mcp-server

Conversation

@lorant-one

Copy link
Copy Markdown
Member

Before: Once UI had no MCP server of its own. The docs and the .well-known/mcp server card sent agents to Context7, which indexes the docs but knows nothing about props, types or the validator.

After: @once-ui-system/core ships once-ui-mcp. One config line gives an agent six tools that answer from the installed version's ai/ files:

{ "mcpServers": { "once-ui": { "command": "npx", "args": ["-y", "-p", "@once-ui-system/core@next", "once-ui-mcp"] } } }
Tool Returns
search_components Components for a need, with the entry point to import each from (LineChart (@once-ui-system/core/data))
get_component Import line, props with types and defaults, inherited prop groups, pairs-with, gotchas. A typo gets "Closest: Button, IconButton…"
get_type TShirtSizes, IconName, SpacingProps and the like, one alias deep
get_task The task list, or one task's bundle
get_rules rules.compact.md, or rules.md with full
validate_code The once-ui-validate-ai-code checks on a source string

How: packages/core/scripts/mcp.cjs speaks MCP's stdio transport (newline-delimited JSON-RPC 2.0) directly. That adds no dependency to core. It handles initialize (with protocol version negotiation), ping, tools/list, tools/call, batches and notifications. It reuses validate-ai-code.cjs's exports. It is registered in bin and files, so the existing package test covers it shipping as a .cjs bin.

The docs changes:

  • The "AI Coding (MCP)" page's MCP section now documents this server, with Context7 as a footnote for open docs questions.
  • buildMcpServerCard describes once-ui-mcp at the core version the docs are built against.

Checked: mcp-server.test.ts (9 tests) runs the server as a child process through initialize, tools/list and a call, and covers each tool. Biome is clean on the new files. The real tools/list and calls were also exercised by hand.


Generated by Claude Code

A stdio MCP server that ships in @once-ui-system/core as the once-ui-mcp
bin and answers from the installed version's ai/ files. It has six tools:
search_components, get_component, get_type, get_task, get_rules and
validate_code (the once-ui-validate-ai-code checks). It speaks
newline-delimited JSON-RPC directly, so it adds no dependency.

The AI coding docs page and the .well-known MCP server card now point at
it instead of Context7.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01YJHdG7ZbpQS64MtL5PVbT1

Copy link
Copy Markdown
Member Author

Docs build fails here on /form-controls/datePicker (React #418). This PR didn't cause it. The failure reproduces on the base branch: a DatePicker with no date hydrates the build's month against the check's clock, 25 hours later, and that clock has crossed into November. The fix is #376. Once it merges, I'll merge the base branch into this PR so CI re-runs.


Generated by Claude Code

@lorant-one
lorant-one merged commit 152b869 into feat/3-0-breaking-cleanup Oct 31, 2026
8 checks passed
@lorant-one
lorant-one deleted the feat/mcp-server branch October 31, 2026 21:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants