Communitygithub.com

amplitude/builder-skills

Instrumenta un servidor MCP Node/TypeScript con el SDK @amplitude/mcp-analytics de Amplitude para rastrear llamadas a herramientas, sesiones y justificaciones como eventos de Amplitude.

¿Qué es builder-skills?

Este skill guía la instrumentación de un servidor MCP (Model Context Protocol) basado en Node/TypeScript con el SDK `@amplitude/mcp-analytics` de Amplitude. Su objetivo es convertir cada llamada a herramienta MCP en un evento de Amplitude que pueda unirse con el resto de los datos del producto (retención, ingresos, uso web/móvil), permitiendo análisis cross-platform. El skill cubre cuatro pasos: los dos primeros son obligatorios (instalación del SDK y configuración de identidad) y los dos siguientes son recomendados (captura de justificación o 'rationale' y etiquetado UTM de enlaces). Es útil porque los eventos generados por agentes (Claude, Cursor, ChatGPT) se atribuyen correctamente al tráfico de MCP, evitando poblaciones desconectadas. El skill enfatiza que la referencia autorizada es el README del paquete npm, el cual debe consultarse siempre para detalles actualizados de la API, ya que el SDK está en vista previa y evoluciona rápidamente. También advierte sobre errores comunes como envolver solo algunas herramientas, llamar a `instrumentServer()` después de `server.connect()`, o no coincidir el `user_id` con el usado en web/móvil.

Compatible con✓Claude Code~Codex CLI✓Cursor
npx skills add https://github.com/amplitude/builder-skills/tree/HEAD/engineering-skills/skills/instrument-mcp-server

Preguntar en tu IA favorita

Abre un nuevo chat con esta habilidad de agente ya precargada.

Documentación

Configuración de Amplitude MCP Analytics

Instrumenta un servidor MCP para que cada llamada a herramienta se convierta en un evento de Amplitude, unible con el resto de los datos de Amplitude del producto (retención, ingresos, uso web/móvil).

La referencia autorizada del SDK es el README del paquete: https://github.com/amplitude/Amplitude-MCP-Analytics-Node (npm: @amplitude/mcp-analytics). El SDK está en vista previa y evoluciona rápidamente — siempre obtén el README más reciente y síguelo para instalación, formas de la API, configuración y eventos predeterminados. No te bases en fragmentos memorizados ni en los resúmenes de este skill para los detalles de la API del SDK; el README prevalece en cualquier conflicto.

Hay cuatro pasos. Los pasos 1 y 2 son obligatorios y están documentados en el README — este skill te indica qué secciones seguir y qué invariantes verificar. Los pasos 3 y 4 son muy recomendados y están documentados completamente aquí, porque requieren cambios fuera del SDK (los esquemas de herramientas del servidor y la aplicación web del producto) que el README del SDK intencionalmente no cubre.

Hazlos en orden: Paso 1 (llamadas a herramientas) → Paso 2 (identidad) → Paso 3 (justificación) → Paso 4 (UTM, solo si el servidor devuelve enlaces). Acierta la identidad antes de dar nada por "terminado" — todo lo demás depende de ello.

Antes de empezar

Confirma:

  1. Este es un servidor MCP Node/TypeScript construido sobre @modelcontextprotocol/sdk. Este SDK no admite otros lenguajes/entornos de ejecución.
  2. El usuario tiene (o puede obtener) una clave de API de Amplitude para el proyecto donde quiere que lleguen los eventos.
  3. Qué gestor de paquetes usa el repositorio (pnpm/npm/yarn) — ajusta el comando de instalación en consecuencia.

Paso 1 — Instalar el SDK y rastrear llamadas a herramientas (obligatorio)

Obtén el README y sigue sus secciones Install y Quick start. Instala siempre la última versión publicada (ej. pnpm add @amplitude/mcp-analytics@latest) — nunca fijes una versión de memoria, ni reproduzcas comandos de instalación de este skill.

Invariantes a verificar una vez conectado (el README explica cada una):

  • analytics.instrumentServer(server, ...) se ejecuta antes de server.connect() — el orden importa.
  • Cada manejador de herramienta está envuelto con analytics.instrumentTool(...). Las herramientas sin envolver no se rastrean. El envoltorio tiene la misma forma que el manejador y es un paso directo sin operación si el servidor nunca fue vinculado, por lo que es seguro envolver de forma defensiva.
  • Todos los eventos predeterminados llevan el prefijo [MCP] , por lo que nunca chocan con los eventos de Amplitude existentes del producto. Consulta la tabla de Default events en el README (y docs/events.md en el repositorio) para conocer el conjunto actual de eventos y propiedades.

Opcional: adjunta dimensiones personalizadas estables (nivel de plan, equipo, flags de funcionalidad) a través de extra en instrumentTool/instrumentServer — consulta la sección Custom event properties del README.

Paso 2 — Configurar la identidad correctamente (obligatorio, haz esto antes de dar el Paso 1 por "terminado")

Los eventos MCP deben llevar el mismo user_id que el producto ya envía a Amplitude desde web/móvil. Si omites esto, el uso de MCP aparece como una población desconectada que no se puede unir a los datos del producto — esto anula la mayor parte del valor de la integración.

Sigue la sección Identity del README para la API actual: ofrece vinculación a nivel de servidor, setIdentity() por solicitud dentro de un manejador, y un mapeo resolveIdentity opcional a partir de las afirmaciones authInfo de la solicitud. Elige el que se ajuste al modelo de autenticación del servidor.

Un comportamiento que debes comunicar al usuario: los eventos completamente anónimos, sin anclaje, se descartan por defecto (no se cuentan como usuarios) a menos que se opte explícitamente por emitAnonymousEvent: true para rastreo solo agregado — pregunta antes de activar esto, ya que cambia lo que se cuenta.

Paso 3 — Capturar la justificación (recomendado)

A diferencia de un humano que hace clic en un botón, un agente puede decirte por qué llamó a una herramienta. Capturar esto convierte los datos de "qué sucedió" a "qué intentaba hacer el usuario".

El lado del SDK es una llamada (analytics.setRationale(...) — consulta la sección Rationale del README), pero el SDK nunca lee la justificación directamente de las entradas de la herramienta: cómo llega la justificación al servidor es una convención del lado del servidor que este skill implementa. El patrón probado en batalla es la inyección de esquema: agrega un campo rationale opcional al esquema de entrada de cada herramienta. Como el parámetro se describe en el esquema que los agentes ya leen, lo completan sin que se les pida, en todos los clientes, sin cambios del lado del cliente:

// Agregar al esquema de entrada de cada herramienta (ejemplo con zod):
rationale: z
  .string()
  .optional()
  .describe(
    'Breve explicación de por qué estás llamando a esta herramienta y qué ' +
    'esperas aprender del resultado.',
  ),

Luego léelo dentro del manejador instrumentado y pásalo al SDK:

analytics.instrumentTool(async (args, extra) => {
  if (typeof args.rationale === 'string') {
    analytics.setRationale(args.rationale);
  }
  return doWork(args);
}, { name: 'search' });

Hacer el campo opcional significa que nada se rompe cuando un agente lo omite. Se emite como la propiedad reservada [MCP] Rationale (truncada a 1000 caracteres; la última escritura gana). Vale la pena hacerlo en todas las herramientas, no solo en una muestra.

Paso 4 — Etiquetar UTM en enlaces salientes (recomendado, solo si el servidor devuelve URLs)

Este paso está completamente fuera del SDK — cambia cómo el servidor construye URLs y depende del análisis del lado web del producto. No está cubierto en el README del SDK.

Si alguna respuesta de herramienta incluye un enlace (panel, documento, página de producto), etiquétalo antes de que salga del servidor para que los clics sean atribuibles al tráfico MCP/agente en lugar de aparecer como directos:

function addUtmParams(url: string, clientName?: string): string {
  const u = new URL(url);
  u.searchParams.append('utm_source', 'mcp');
  u.searchParams.append('utm_medium', 'referral');
  // El cliente conectado (ej. "Claude", "Cursor"), si lo conoces:
  u.searchParams.append('utm_content', clientName ?? 'unknown');
  return u.toString();
}

Enruta cada ruta de construcción de URL en las respuestas de herramientas a través de una función central como esta — un solo enlace sin etiquetar rompe la historia de atribución para ese flujo.

Prerrequisito (dile esto al usuario explícitamente): esto solo funciona si su análisis web captura los parámetros UTM en los eventos de vista de página (o cualquier evento que su sitio dispare al aterrizar). El SDK 2 de Amplitude para navegador hace esto por defecto — consulta Track marketing attribution (los parámetros UTM, referente y click ID se capturan de fábrica). Si usan un rastreador de vista de página personalizado, deben confirmar que los valores UTM también lleguen a esos eventos, o no habrá con qué unir los clics etiquetados por MCP.

Documentación relevante de Amplitude:

Después de instrumentar

Una vez que los eventos fluyen, dirige un agente de codificación al skill analyze-mcp-server publicado de Amplitude para ejecutar agrupación de intenciones y detectar patrones de error de llamadas a herramientas por intención. (Si este proyecto tiene instalado el skill mcp-intent-error-analysis, ese es el indicado — úsalo una vez que el usuario tenga datos fluyendo y quiera analizarlos, en lugar de duplicar ese análisis aquí.)

Errores comunes a señalar

  • Seguir fragmentos de API desactualizados en lugar del README actual — obténlo fresco; el SDK está en vista previa y se mueve rápido.
  • Instalar una versión fijada/antigua en lugar de la última versión.
  • Llamar a instrumentServer() después de server.connect() — debe ser antes.
  • Envolver algunos manejadores de herramientas pero no otros — cada herramienta necesita instrumentTool.
  • Enviar un user_id que no coincide con el usado en web/móvil — rompe la unibilidad, el punto central de la integración.
  • Activar emitAnonymousEvent: true sin que el usuario entienda que infla los conteos agregados con tráfico sin anclaje.
  • Olvidar el prerrequisito de UTM (captura del lado web) y asumir que etiquetar enlaces por sí solo es suficiente.

Individual skills in this repo

This repo contains 20 individual skills — each has its own dedicated page.

amplitude/builder-skills

Performs deep analysis of a specific Amplitude chart to explain trends, anomalies, and likely drivers. Use when a metric looks unusual, investigating a spike or drop, or understanding the "why" behind numbers.

amplitude/builder-skills

Deeply analyze Amplitude dashboards by analyzing key charts, surfacing top areas for concern and takeaways, identify anomalies, then explain changes using customer feedback trends.

amplitude/builder-skills

Designs A/B tests with proper metrics and variants, analyzes running or completed experiments, and interprets results with statistical rigor. Use when setting up experiments, checking experiment status, analyzing results, or making ship decisions.

amplitude/builder-skills

Synthesizes customer feedback into actionable themes including feature requests, bugs, pain points, and praise. Use when planning product roadmap, understanding user sentiment, investigating specific issues, or preparing voice-of-customer reports.

amplitude/builder-skills

Analyze MCP server usage instrumented with Amplitude's MCP Analytics SDK: break usage and errors down by tool, read the rationales within each tool to see what callers are trying to do, and produce a prioritized write-up of actionable fixes. Use this skill whenever the user asks to understand how their MCP server is being used, what agents/users are trying to do with it, why tool calls are failing, what to fix or improve in their MCP server, or asks for an "MCP usage report", "tool error analysis", "intent analysis", "rationale clustering", or "MCP insights". Also trigger when the user mentions [MCP]-prefixed events, tool rationale, tool call errors, or just finished instrumenting their MCP server and wants to see what the data says. Requires the Amplitude MCP connector.

amplitude/builder-skills

Read lost deals and churned accounts from your CRM, extract reasons clustered by theme (missing features, pricing, competitors, UX), and write a prioritized weekly analysis with product improvement recommendations. Use before roadmap planning or to build the case for prioritizing retention work.

amplitude/builder-skills

Creates Amplitude charts from natural language descriptions, handling event selection, filters, groupings, and visualization choices. Use when you know what you want to measure but prefer not to build the chart manually.

amplitude/builder-skills

Guide an Amplitude user through building a custom agent by suggesting use cases grounded in their role and data, shaping the idea into a well-formed spec, and generating a ready-to-run Global Agent deeplink that creates it. Use to create, build, or set up a custom agent, automate a recurring analysis, or put a repeated report on a schedule.

amplitude/builder-skills

Builds comprehensive Amplitude dashboards from requirements or goals, organizing charts into logical sections with appropriate layouts. Use when creating a complete dashboard from scratch or assembling existing charts into a cohesive view.

amplitude/builder-skills

Monitors all active and recently completed experiments across Amplitude projects, triages them by importance, then runs deep analysis and reporting on the most impactful ones. Use when the user asks to "check on experiments", "experiment status", "experiment review", "what experiments are running", or wants a periodic experiment health report.

amplitude/builder-skills

Pull Intercom tickets and Slack support messages from the past 7 days, classify each signal, enrich with CRM data (ARR, plan, renewal), score by customer value and churn risk, and output a tiered priority report saved to Drive. Use when you need a fast, data-driven view of what support signals matter most.

amplitude/builder-skills

Use this skill whenever a user wants to improve existing pages on their website to get cited more by AI models — whether they say "our pages aren't getting cited", "improve this page for AI visibility", "which of our pages should we update", "make this article more cite-worthy", "our competitors are getting cited instead of us", "update our content for AI search", or any variation where the goal is improving an existing asset rather than creating something new. This skill pulls owned pages from AI Visibility, identifies which ones have citation potential but are underperforming, compares them against the external pages that are winning citations on the same topics, and produces section-level rewrites or a full-page update — then pushes the revision to the CMS as a draft. Trigger even if the user just says "help me get cited more" or "why is [competitor] getting cited instead of us".

amplitude/builder-skills

Use this skill whenever a user wants to win AI citations on prompts that competitors currently dominate — whether they say "competitors are getting cited instead of us", "we're losing on these prompts", "how do I outrank [competitor] in AI answers", "find prompts where we should be winning", "create content to beat [competitor]", or any variation where the goal is capturing AI share on prompts a competitor currently owns. This skill pulls competitor visibility data from AI Visibility, identifies the specific prompts where competitors win and Amplitude is absent, clusters them by intent, and produces targeted comparison pages, alternatives content, or rebuttal assets — then pushes drafts to CMS. Trigger on any mention of competitor, prompt hijack, outrank, or "why is [competitor] getting cited instead of us".

amplitude/builder-skills

Use this skill whenever a user wants to turn AI Visibility data into published content — whether they say "find content gaps", "what should we write about", "which topics have low visibility", "help me get cited by AI models", "create a blog post from our AI Visibility gaps", "we're losing to competitors on these prompts", or any variation where they want to go from AI visibility weakness to a draft article, landing page, or FAQ. This skill connects directly to Amplitude AI Visibility data (topics, prompts, visibility scores, citations, competitor data, full LLM responses and sources) and produces a publish-ready content brief plus full article draft. If the user mentions CMS (WordPress, Webflow, Contentful, Sanity, HubSpot, Ghost, Shopify), also trigger this skill to push the draft directly. Trigger even if they just say something vague like "what content should we create?" in an AI Visibility context.

amplitude/builder-skills

Use this skill whenever a user wants to test content variants before publishing to find which one will get cited most by AI models — whether they say "which version of this content will perform better", "test this article before we publish", "simulate how AI will respond to this content", "which angle should we use", "generate content variants and pick the winner", "run a simulation before publishing", or any variation where the goal is data-driven content selection rather than gut-feel publishing. This skill takes an identified content opportunity, generates 2–3 distinct variants with different angles or structures, scores them against actual AI model responses from AI Visibility, references the Simulate Changes feature for pre-publish validation, and produces a clear recommendation on which variant to publish — then pushes the winner to CMS. Trigger on any mention of "simulate", "test variants", "which performs better", "A/B content", or "before we publish".

amplitude/builder-skills

Use this skill whenever a user wants to understand which external sources are being cited by AI models on topics relevant to their brand, and wants to create content that will outrank those sources — whether they say "what sources are AI models citing", "why is [third-party site] being cited instead of us", "we want to be the definitive source on X", "build something that gets cited more than G2 or TechRadar", "create an authoritative asset", or any variation where the goal is producing a new reference asset (definition page, benchmark, methodology, glossary, comparison hub) designed to beat existing top-cited sources. This skill analyzes AI Visibility source data, reverse-engineers what makes top-cited pages authoritative, and produces a superior source asset — then pushes it to CMS as a draft. Trigger on any mention of "sources", "third-party citations", "authoritative content", "definitional pages", or "outrank".

amplitude/builder-skills

Instruments a pull request with Amplitude analytics that conform to the project's existing taxonomy. Reads the tracking plan via the Amplitude MCP server (events, properties, naming conventions), analyzes the PR diff to find the few user actions genuinely worth tracking, detects the codebase's SDK and tracking patterns, and adds instrumentation that matches both. Optionally (opt-in) stages new events and properties on an Amplitude tracking-plan branch for data-governance review. Use when asked to "instrument this PR", "add analytics to this change", "add tracking", "add Amplitude events", "instrument this feature", or "what should I track here".

amplitude/builder-skills

Diagnoses product health by cross-referencing Amplitude analytics (dashboards, charts, funnels, feedback, AI agent analytics), optionally Datadog (errors, latency, stack traces), and optionally Slack (qualitative feedback, bug reports, feature requests). Identifies what's broken, what's working, and what to do about it — with root causes, not just symptoms. Use when asked to "diagnose my product", "what's going on", "product health check", "what's broken", "where are users struggling", "give me a product diagnosis", or "what should I focus on".

amplitude/builder-skills

Turn one or more meeting transcripts, notes, or Slack threads into concise takeaways and clear action items with DRIs. Works with a single meeting or a batch from the whole week.

amplitude/builder-skills

Summarizes B2B account health by analyzing usage patterns, engagement trends, risk signals, and expansion opportunities. Use for customer success reviews, renewal preparation, QBRs, or account prioritization.

Skills relacionados