Skip to content

get_component answers "Available: ." in a project with no components #220

Closed

Description

@dgesteves

What happens

In a project where onsystem finds no design-system components, get_component answers with an empty list. Start the server in a folder with only a package.json and call get_component { "name": "Button" }. It returns No component named "Button". Available: . In the same project, list_components says No components found. Check the "components" globs in the config (root: ...).

Where

  • src/server/index.ts:516-532: the error text in a single project, built from ds.roots(), which is empty here
  • src/server/index.ts:486-494: the same pattern at a monorepo root, built from catalog.roots()
  • src/server/render.ts:176-185 and :240-244: what list_components says when there are no components, in a project and at a monorepo root
  • test/server.test.ts:152-163: "get_tokens says when the project has no tokens at all", the test to copy

Done when

  • With no components, get_component says the project has no design-system components and points at the components globs and the root, as list_components does (and, at a monorepo root, at onsystem inspect)
  • It still returns isError: true, and with components the "Did you mean" and "Available" text is unchanged
  • A new test in test/server.test.ts calls get_component on a fixture with only a package.json and checks the text
  • pnpm test, pnpm lint and pnpm typecheck pass, and the PR has a patch changeset (pnpm changeset)

Hint

Copy the fixture and client setup from the get_tokens test at test/server.test.ts:152. Put the sentence in a small helper next to renderComponentList in src/server/render.ts, so both tools say the same thing. #199 (in review) also edits src/server/render.ts: if it merges first, rebase onto it.

Out of scope

What search_components says when nothing matches.

Status: ready for a contributor. Comment before you start.

Activity

  1. added
    bugSomething isn't working
    area: mcpThe MCP server and its tools
    roadmapOn the public roadmap (ROADMAP.md)
    on Oct 22, 2026
  2. Aaqibhafeezkhan commented on Oct 22, 2026

    @Aaqibhafeezkhan
    Contributor

    I'd like to take this issue. I'll update get_component to explain
    clearly when no design-system components are available and point
    users to the component configuration and project root. I'll add
    the empty-project regression test while preserving the existing
    error behavior when components are present.

  3. dgesteves commented on Oct 22, 2026

    @dgesteves
    OwnerAuthor

    Thanks, it's yours: I've assigned you. Your plan matches the issue. Two reminders: put the sentence in one helper next to renderComponentList, so get_component and list_components say the same thing, and add a patch changeset. #199 also edits src/server/render.ts; if it merges first, rebase onto it. Open a draft PR early if you'd like feedback before it's done.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

area: mcpThe MCP server and its toolsbugSomething isn't workinggood first issueGood for newcomersroadmapOn the public roadmap (ROADMAP.md)

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions