mcp-artifact-integration
O que ela faz
Esta skill explica como criar um artefato web que chama o Lightdash pelo MCP e exibe os resultados das consultas. É para desenvolvedores que querem uma página ou app personalizado que mostre dados ao vivo do Lightdash.
Quando usar
- ✓Quando você quer criar uma página web que mostre resultados de consultas do Lightdash.
- ✓Quando você precisa tratar os estados de carregamento, erro e vazio de uma consulta do Lightdash em um artefato.
- ✓Quando você quer usar como alternativa os dados CSV de uma consulta do Lightdash.
Link da skill
https://github.com/lightdash/lightdash/blob/main/packages/backend/src/ee/services/ai/skills/builtInSkills/mcp-artifact-integration/SKILL.mdCopie e cole na sua IA (Claude, ChatGPT ou Cursor) pedindo para seguir as instruções.
Como usar
O jeito mais fácil: copie a mensagem e cole na sua IA. Ela lê a skill e segue as instruções.
Mensagem pronta para colar
Para Claude Code, Codex ou Cursor: rode na pasta do projeto e a skill fica instalada.
Baixe o SKILL.md e coloque na pasta de skills do seu agente.
Exemplo do que pedir para a IA
“Crie um artefato HTML que mostre os resultados desta consulta de métricas do Lightdash como uma tabela, com estados de carregamento e erro.”
5 skills novas por semana. 1 minuto de leitura.
Como funciona
A skill explica como iniciar uma consulta, guardar seu ID e consultar o resultado repetidamente. Ela descreve como ler a resposta, incluindo o conteúdo estruturado e os indicadores de erro, e como exibir cada estado corretamente.
Conteúdo técnico (SKILL.md original)
Texto original do autor, em inglês, direto do 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
Perguntas frequentes
Ela adiciona um novo endpoint?
Não, a skill descreve o contrato de dados existente e não adiciona endpoint nem SDK.
Qual ferramenta de consulta devo usar?
Use a ferramenta de consulta de métricas para perguntas que a camada semântica responde, e a ferramenta de SQL para outras consultas somente leitura.
Isso é necessário para o chat comum?
Não, a descrição diz que não é necessário para o chat comum nem para o app de gráficos integrado do Lightdash.
Detalhes
Descrição original do autor
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
Popularidade
- Estrelas no GitHub
- 6,2 mil
- Posição no ranking
- #14398
- Licença
- —
- Atualizada em
- 02/11/2026
Comentários
- …
Mais skills deste repositório
breakup-pr
6,2 milAjuda seu agente a dividir um pull request grande em fatias menores e empilhadas, que podem ser revisadas e mescladas uma de cada vez.
lightdash-agent-slack-messaging
6,2 milAjuda seu agente a escrever relatórios de manutenção e de atividade claros e amigáveis para administradores do Lightdash, baseados apenas nas evidências disponíveis.
developing-in-lightdash
6,2 milAjuda seu agente a ler, criar e editar dashboards e gráficos do Lightdash como JSON, incluindo as configurações de cada tipo de gráfico.
filter-expressions
6,2 milAjuda seu agente a escrever expressões de filtro corretas para consultas de métricas do Lightdash, incluindo filtros em métricas personalizadas.
Skills parecidas
angular-developer
280 milAjuda seu agente a criar código Angular e a dar conselhos sobre a estrutura do projeto. É útil para iniciar novos projetos, criar partes do código ou melhorar a performance e acessibilidade.
frontend-a11y
280 milAjuda seu agente a tornar interfaces web acessíveis para todos. Ele garante que sites e apps funcionem bem com leitores de tela e navegação por teclado.
frontend-patterns
280 milFaz seu agente aplicar padrões modernos no desenvolvimento frontend. Ele otimiza performance, gerencia estado e segue boas práticas em React e Next.js.