Component Code

Code with live parameters that you can change and see the component update.

¿Debería usar esto?

Calidad y seguridad

A
Calidad de la descripción
100%
Integridad del esquema
100%
Calidad de los nombres
80%
Riesgo de envenenamiento
100%
Coincidencia de permisos
100%
Cumplimiento del protocolo
100%

Basado en el análisis automatizado de las definiciones de herramientas y el cumplimiento del protocolo.

Costo de contexto

~909Tokens (definiciones de herramientas)
~4.3 KBTamaño de respuesta típico
Impacto moderado en la atención (0.71% del contexto de 128k)

Este es el número aproximado de tokens que se consumen cada vez que las herramientas del servidor se cargan en el contexto de un modelo. Los recuentos más altos reducen la atención disponible para otras tareas.

Instalar

Instalación con un clic

Agrega esto a tu archivo `claude_desktop_config.json`:

{
  "mcpServers": {
    "component-code": {
      "command": "npx",
      "args": [
        "@fabiocv/component-code-mcp"
      ]
    }
  }
}

Paquetes ejecutables

npm@fabiocv/component-code-mcp0.6.4stdio

Puntos de conexión remotos

https://mcp.fabio.cv/component-code/mcpstreamable-http

Qué puede hacer

Inventario de herramientas

Herramientas (2)

🟢 Solo lectura🟡 Escritura🔴 Eliminación⚪ Desconocido
🟢component_code_show(source, code, file, controls)

Shows a React component in the chat in Component Code: a live preview beside the code that uses it. Each string, number and boolean in the code becomes a control the reader can change. Use it when someone asks to show a component in Component Code, or to see, preview or try one.

Esquema de entrada

{
  "type": "object",
  "properties": {
    "source": {
      "type": "string",
      "description": "The component's module in TSX. It may import only from 'react'. Its exports, the default one by its function's name, are what `code` can name. For each value the reader can change by using the component, such as `checked`, `open` or `value`, take a matching `onCheckedChange`, `onOpenChange` or `onValueChange` prop and call it with the new value, and give that value `{ change: true }` in `controls`. Component Code passes it then, so the change shows in the code. Keep state of its own only for when the prop is missing."
    },
    "code": {
      "type": "string",
      "description": "How the component is used, in JSX: elements, props and text only, with no hooks, calls or conditions. It is shown as code and rendered as the preview. Each string, number and boolean in it becomes a control."
    },
    "file": {
      "description": "The file named in the code's tab, such as `Card.tsx`.",
      "type": "string"
    },
    "controls": {
      "description": "How a prop is changed, by its name or by `Element.prop`: a list of options, `{ min, max, step }` for a number, or `false` to keep it as written. `{ change: true }` lets the component change it too, through its `on<Prop>Change`, and takes a list as `options`.",
      "type": "object",
      "propertyNames": {
        "type": "string"
      },
      "additionalProperties": {
        "anyOf": [
          {
            "type": "boolean",
            "const": false
          },
          {
            "type": "array",
            "items": {
              "type": [
                "string",
                "number"
              ]
            }
          },
          {
            "type": "object",
            "properties": {
              "min": {
                "type": "number"
              },
              "max": {
                "type": "number"
              },
              "step": {
                "type": "number"
              },
              "options": {
                "type": "array",
                "items": {
                  "type": [
                    "string",
                    "number"
                  ]
                }
              },
              "change": {
                "type": "boolean"
              }
            }
          }
        ]
      }
    }
  },
  "required": [
    "source",
    "code"
  ],
  "$schema": "https://json-schema.org/draft/2020-12/schema"
}
🟢component_code_show_html(files, controls)

Shows HTML, CSS and JS running in the chat in Component Code: the page beside its code, with a tab for each file. The values named in `controls` become controls the reader can change. Use it when someone asks to show HTML, CSS, JS, a canvas or an SVG in Component Code, or for an experiment without React.

Esquema de entrada

{
  "type": "object",
  "properties": {
    "files": {
      "type": "object",
      "propertyNames": {
        "type": "string"
      },
      "additionalProperties": {
        "type": "string"
      },
      "description": "The files by name, such as `index.html`, `style.css` and `script.js`, each in its own tab. They run together as one page in a sandboxed frame: the HTML is the page's body, with the CSS in a style element and the JS in a script element after it. The page cannot load anything from the network, so draw with canvas, SVG or the DOM."
    },
    "controls": {
      "description": "The values the reader can change, by name: an attribute, as `r` or `circle.r`, a CSS property or custom property, as `--speed`, or a JS `const` set to a number, string or boolean. Each takes `true`, a list of options, or `{ min, max, step }` for a number. CSS changes apply as the reader drags, while HTML and JS run the page again, so a script that reads custom properties each frame follows along.",
      "type": "object",
      "propertyNames": {
        "type": "string"
      },
      "additionalProperties": {
        "anyOf": [
          {
            "type": "boolean",
            "const": true
          },
          {
            "type": "array",
            "items": {
              "type": [
                "string",
                "number"
              ]
            }
          },
          {
            "type": "object",
            "properties": {
              "min": {
                "type": "number"
              },
              "max": {
                "type": "number"
              },
              "step": {
                "type": "number"
              }
            }
          }
        ]
      }
    }
  },
  "required": [
    "files"
  ],
  "$schema": "https://json-schema.org/draft/2020-12/schema"
}

Comunidad

Califica este servidor

Evidencia

Observaciones recientes

verificadoversión no registrada2 herramientas