mcp-artifact-integration
하는 일
이 스킬은 MCP를 통해 Lightdash를 호출하고 쿼리 결과를 보여 주는 웹 아티팩트를 만드는 방법을 설명합니다. 실시간 Lightdash 데이터를 보여 주는 사용자 정의 페이지나 앱을 만드는 개발자를 위한 스킬입니다.
사용하는 경우
- ✓Lightdash 쿼리 결과를 보여 주는 웹 페이지를 만들고 싶을 때.
- ✓아티팩트에서 Lightdash 쿼리의 로딩, 오류, 빈 상태를 처리해야 할 때.
- ✓Lightdash 쿼리에서 CSV 데이터로 대체하고 싶을 때.
스킬 링크
https://github.com/lightdash/lightdash/blob/main/packages/backend/src/ee/services/ai/skills/builtInSkills/mcp-artifact-integration/SKILL.md복사해서 AI(Claude, ChatGPT, Cursor)에 붙여넣고 지침을 따르도록 요청하세요.
사용 방법
가장 쉬운 방법입니다. 메시지를 복사해 AI에 붙여넣으세요. AI가 스킬을 읽고 지침을 따릅니다.
바로 붙여넣을 수 있는 메시지
Claude Code, Codex, Cursor용입니다. 프로젝트 폴더에서 실행하면 스킬이 설치됩니다.
SKILL.md를 다운로드해 에이전트의 스킬 폴더에 넣으세요.
AI에게 요청하는 예시
“이 Lightdash 지표 쿼리의 결과를 표로 보여 주는 HTML 아티팩트를 만들어 주세요. 로딩 상태와 오류 상태도 넣어 주세요.”
매주 새 스킬 5개. 읽는 데 1분.
작동 방식
스킬은 쿼리를 시작하고, 쿼리 ID를 보관하며, 결과를 폴링하는 방법을 설명합니다. 구조화된 콘텐츠와 오류 플래그를 포함해 응답을 읽고, 각 상태를 올바르게 보여 주는 방법을 설명합니다.
기술 내용 (원본 SKILL.md)
작성자의 영어 원문을 GitHub에서 그대로 가져왔습니다.
Lightdash query results in HTML/React artifacts
Use this skill when creating an HTML/React artifact or app that calls Lightdash through Model Context Protocol (MCP). It describes the existing data contract; it does not add a new endpoint, SDK or browser bridge.
Choose and start the query
Choose run_metric_query for questions expressible in the semantic layer. Discover field IDs with grep_fields / get_metadata, and supply required parameters explicitly: omitted parameters may silently use defaults. Use run_sql for other read-only SELECT queries in the warehouse's dialect. Read each tool's schema for its effective row limit; deployment configuration can change the maximum.
Call the query-start tool once. Keep its query UUID and original project/agent scope for subsequent polling. The artifact should track its own loading, success, empty and error states; a pending query is not an empty dataset.
Read the result envelope
A full MCP CallToolResult can contain:
content: an array of typed content blocks. Query tools put CSV or status/error text in the first text block. Additional blocks can contain an applied-parameters note,queryUuid: <id>,[Scope: ...]or a compatibility warning.structuredContent.result: the typed result, when exposed by the host. Prefer this over parsing CSV.isError: a tool failure flag. Check it, but also inspectstructuredContent.result.status: terminal query statuses can arrive withoutisError._meta: host/app metadata. Do not assume your artifact bridge exposes it.
Do not concatenate every content block into CSV. Do not parse an entire CallToolResult as row data. When the host exposes text only, follow the status text and parse only the data block with a real CSV parser (quoted delimiters, quotes and line breaks are legal). If the bridge discards necessary status or UUID information, show an integration error rather than guessing.
The companion result contracts gives the exact completed/running/terminal shapes and link semantics. Native MCP clients can read the resource; fallback clients can call read_skill_resource with name: "mcp-artifact-integration" and path: "resources/result-contracts.md".
Poll without re-executing
- Start the query once with
run_sqlorrun_metric_query. - Check
isErrorfirst. For structured results, branch onresult.status. running: retain the returnedqueryUuid, show "Query still running…", waitnextPollAfterMs, then callget_query_resultwith that same UUID and scope. Text-only clients use the UUID and wait instructions in the returned text. Never invent an ID or restart the original query to check progress.done: stop polling and render the data. An emptyrowsarray is successful completion with zero rows, not a parsing failure.error,cancelledorexpired: stop polling and display the returned error/status. These can be normal MCP results withoutisError: true.
Both the initial query-start call and each polling call can wait up to approximately 50 seconds server-side. Allow for that in the host bridge's timeout. This is not the warehouse execution timeout; warehouse timeouts come from the Lightdash connection. heartbeatAt records the latest Lightdash check that confirmed the query was still running, not a warehouse progress percentage.
If a polling call loses its connection or times out, retry only get_query_result with the same UUID, using bounded retries/backoff. Avoid overlapping polls; stop on terminal state, artifact teardown or user cancellation. Stopping local polling does not cancel warehouse execution. Ignore stale responses if the user starts a different query while an earlier call is in flight.
If the initial query-start call loses its response before you receive a UUID, do not automatically resubmit: the warehouse may already be executing it. Report that the outcome is unknown; a retry can duplicate execution.
Validation failures should be corrected before another query is started. Application/warehouse errors are terminal until corrected; do not put them into the transient polling retry loop.
Build your artifact's own visualization
Use completed query rows as data for your HTML table or React chart library. For metric results, rows use stable field IDs and fields provides metadata; CSV headers instead use display labels. Keep stable IDs for data access, use labels for presentation, and do not treat labels as un
자주 묻는 질문
새 엔드포인트를 추가하나요?
아니요, 스킬은 기존 데이터 계약을 설명하며 엔드포인트나 SDK를 추가하지 않습니다.
어떤 쿼리 도구를 써야 하나요?
시맨틱 레이어가 답할 수 있는 질문에는 지표 쿼리 도구를, 그 밖의 읽기 전용 쿼리에는 SQL 도구를 사용합니다.
일반 채팅에도 필요한가요?
아니요, 일반 채팅이나 Lightdash의 내장 차트 앱에는 필요하지 않다고 설명에 나와 있습니다.
상세 정보
작성자의 원본 설명
Integrate Lightdash MCP query results into Claude-created HTML or React artifacts. Covers host bridges, response envelopes, polling, errors, CSV fallback and chart data. Not needed for ordinary chat or Lightdash's built-in chart app.
repo: lightdash/lightdash
인기도
- GitHub 스타
- 6.2k
- 순위
- #14398
- 라이선스
- —
- 업데이트
- 2026. 11. 2.
댓글
- …
이 저장소의 다른 스킬
breakup-pr
6.2k에이전트가 큰 풀 리퀘스트를 검토하고 병합할 수 있는 작은 스택형 조각으로 나누도록 돕습니다.
lightdash-agent-slack-messaging
6.2k에이전트가 제공된 근거만 바탕으로, Lightdash 관리자를 위한 명확하고 친근한 유지 보수 및 활동 보고서를 작성하도록 돕습니다.
developing-in-lightdash
6.2k에이전트가 Lightdash 대시보드와 차트를 JSON으로 읽고, 만들고, 수정하도록 돕습니다. 차트 종류별 설정도 포함합니다.
filter-expressions
6.2k에이전트가 Lightdash 지표 쿼리에 쓸 필터 식을 올바르게 작성하도록 돕습니다. 사용자 정의 지표에 대한 필터도 포함합니다.
비슷한 스킬
angular-developer
280k에이전트가 Angular 코드를 만들고 프로젝트 구조를 조언하도록 돕습니다. 새 프로젝트 시작, 코드 부분 생성, 성능과 접근성 개선에 유용합니다.
frontend-a11y
280k모든 사람이 웹 인터페이스를 쓸 수 있도록 에이전트를 돕습니다. 웹사이트와 앱이 화면 읽기 프로그램과 키보드 탐색에서 잘 작동하도록 합니다.
frontend-patterns
280k프론트엔드 개발의 현대적인 패턴을 적용하도록 에이전트를 돕습니다. React와 Next.js에서 성능을 최적화하고, 상태를 관리하며, 모범 사례를 따릅니다.