Guide · Amazon QuickSight · SDK Overview & Key Concepts

Amazon QuickSight for MCP Servers — SDK Overview, Data Sources, Dashboards, and Embedding

Amazon QuickSight is AWS's cloud-native business intelligence service. It lets you connect to dozens of data sources, build in-memory SPICE datasets, create drag-and-drop analyses and dashboards, and embed those dashboards in any web application without exposing underlying data credentials. For MCP server teams, QuickSight closes the gap between raw operational data and actionable analytics: your agents can query QuickSight APIs to publish dashboards from code, refresh SPICE ingestions on demand, and serve embedded analytics to end users — all through the same IAM boundaries that protect your other AWS resources.

TL;DR

QuickSight uses a single npm package (@aws-sdk/client-quicksight) for all management operations — account setup, data sources, datasets, analyses, dashboards, users, and permissions. For embedding, you additionally need @amazon-quicksight/embedding-sdk on the browser side and two server-side commands: GenerateEmbedUrlForAnonymousUserCommand (no login required, requires Capacity Pricing add-on) or GenerateEmbedUrlForRegisteredUserCommand (IAM or Cognito users). The five-layer hierarchy — data source → dataset → analysis → dashboard → embed URL — matches how the QuickSight console works. Every layer is addressable via API and deployable via assets-as-code using ExportAssetBundleToS3Command.

Why MCP servers benefit from embedded analytics

MCP servers accumulate rich operational data: uptime logs, latency distributions, schema drift events, authentication failures, and tool call traces. Without a visualization layer, that data lives in S3 or CloudWatch where only engineers can query it. QuickSight closes that gap without requiring a separate BI team:

Account subscription

QuickSight requires an explicit subscription before any other API call works. The DescribeAccountSubscriptionCommand tells you the current status; CreateAccountSubscriptionCommand activates the service:

import { QuickSightClient, DescribeAccountSubscriptionCommand, CreateAccountSubscriptionCommand } from "@aws-sdk/client-quicksight";

const qs = new QuickSightClient({ region: "us-east-1" });
const accountId = process.env.AWS_ACCOUNT_ID;

// Check subscription status first
try {
  const sub = await qs.send(new DescribeAccountSubscriptionCommand({ AwsAccountId: accountId }));
  console.log("Edition:", sub.AccountInfo.Edition);
  // "STANDARD" | "ENTERPRISE" | "ENTERPRISE_AND_Q"
} catch (err) {
  if (err.name === "ResourceNotFoundException") {
    // Not yet subscribed — activate
    await qs.send(new CreateAccountSubscriptionCommand({
      AwsAccountId: accountId,
      Edition: "ENTERPRISE",
      AuthenticationMethod: "IAM_AND_QUICKSIGHT",
      AccountName: "alivemcp-prod",
      NotificationEmail: "ops@example.com",
    }));
    console.log("QuickSight subscription created");
  }
}

Editions: Standard includes core BI at $9/author/month. Enterprise adds row-level security, private VPC connectivity, encryption at rest, and sharing with reader accounts at $18/author/month + $0.30/reader/session. Enterprise + Q adds the natural-language query bar. For MCP server teams building multi-tenant embedded analytics, Enterprise is the minimum viable tier.

The AuthenticationMethod choices are IAM_AND_QUICKSIGHT (users registered directly in QuickSight plus IAM federation), IAM_ONLY (all users are IAM identities), or ACTIVE_DIRECTORY (Microsoft AD via AWS Directory Service). For programmatic access from MCP servers, IAM_AND_QUICKSIGHT gives the most flexibility — your automation role uses IAM while end-users authenticate through Cognito or identity federation.

SDK quick start

npm install @aws-sdk/client-quicksight

All QuickSight operations use the same client. The AwsAccountId parameter is required on nearly every command — set it once and reuse:

import { QuickSightClient } from "@aws-sdk/client-quicksight";

const qs = new QuickSightClient({ region: "us-east-1" });
const ACCOUNT_ID = process.env.AWS_ACCOUNT_ID; // "123456789012"

// Helper to avoid repeating AwsAccountId
function qsParams(extra) {
  return { AwsAccountId: ACCOUNT_ID, ...extra };
}

QuickSight is a regional service. All resources — data sources, datasets, analyses, dashboards, users — exist within a single region. Cross-region replication is not available natively; use ExportAssetBundleToS3Command + ImportAssetBundleFromS3Command to copy assets across regions.

The five-layer hierarchy

Every QuickSight deployment follows the same layers, each building on the previous:

  1. Data source — a connection to an external system (Redshift, RDS, Athena, S3, MySQL, Salesforce, etc.). Stores credentials or IAM role ARN, VPC connection ID, and SSL settings. Created with CreateDataSourceCommand.
  2. Dataset — defines which tables or SQL query to pull from the data source, plus any joins, calculated fields, and column-level security. Can be SPICE (in-memory, requires scheduled refresh) or DIRECT_QUERY (live queries). Created with CreateDataSetCommand.
  3. Analysis — the interactive workspace where you build visuals. References one or more datasets. Created with CreateAnalysisCommand; not shareable directly — you publish it as a dashboard.
  4. Dashboard — a read-only published snapshot of an analysis. Each publish creates a new version. Created with CreateDashboardCommand and published with UpdateDashboardPublishedVersionCommand.
  5. Embed URL — a one-time, time-limited URL that embeds a specific dashboard (or visual, or Q bar) in an iframe. Generated server-side with GenerateEmbedUrlForAnonymousUserCommand or GenerateEmbedUrlForRegisteredUserCommand.

The separation between analysis and dashboard matters: analyses can be freely edited without affecting the published dashboard viewers see. Only an explicit UpdateDashboardPublishedVersionCommand call promotes changes to production. This makes analysis the right workspace for iterative development and dashboard the stable output.

IAM setup for MCP server automation

QuickSight has its own IAM action namespace (quicksight:*) separate from the resource namespaces of its data sources. Your MCP server automation role needs permissions in both:

{
  "Version": "2012-10-17",
  "Statement": [
    {
      "Effect": "Allow",
      "Action": [
        "quicksight:CreateDataSource",
        "quicksight:CreateDataSet",
        "quicksight:CreateAnalysis",
        "quicksight:CreateDashboard",
        "quicksight:UpdateDashboard",
        "quicksight:UpdateDashboardPublishedVersion",
        "quicksight:GenerateEmbedUrlForAnonymousUser",
        "quicksight:GenerateEmbedUrlForRegisteredUser",
        "quicksight:RegisterUser",
        "quicksight:DescribeDataSet",
        "quicksight:DescribeDataSource",
        "quicksight:DescribeAnalysis",
        "quicksight:DescribeDashboard",
        "quicksight:RefreshDataset",
        "quicksight:CreateIngestion",
        "quicksight:DescribeIngestion",
        "quicksight:ListIngestions",
        "quicksight:ExportAssetBundle",
        "quicksight:ImportAssetBundle"
      ],
      "Resource": "arn:aws:quicksight:us-east-1:*:*"
    },
    {
      "Effect": "Allow",
      "Action": [
        "redshift:GetClusterCredentials",
        "redshift:DescribeClusters"
      ],
      "Resource": "*"
    },
    {
      "Effect": "Allow",
      "Action": [
        "s3:GetObject",
        "s3:ListBucket"
      ],
      "Resource": [
        "arn:aws:s3:::your-qs-bucket",
        "arn:aws:s3:::your-qs-bucket/*"
      ]
    }
  ]
}

QuickSight also requires a service role that it assumes to access your data sources on its behalf — distinct from your automation role. Create this with the quicksight.amazonaws.com trust principal and attach the AmazonS3ReadOnlyAccess and AWSQuicksightAthenaAccess managed policies (or scope them down to specific buckets and workgroups).

Key gotchas at a glance

Namespace basics for multi-tenancy

QuickSight namespaces partition users, groups, and assets within a single account. Each tenant gets its own namespace, preventing data or permission leakage between customers. The default namespace is always "default":

import { CreateNamespaceCommand, DescribeNamespaceCommand } from "@aws-sdk/client-quicksight";

await qs.send(new CreateNamespaceCommand(qsParams({
  Namespace: "tenant-acme",
  IdentityStore: "QUICKSIGHT",
})));

// Poll until ready
let ns;
do {
  await new Promise(r => setTimeout(r, 5000));
  ns = await qs.send(new DescribeNamespaceCommand(qsParams({ Namespace: "tenant-acme" })));
} while (ns.Namespace.CreationStatus !== "CREATED");

console.log("Namespace ready:", ns.Namespace.Arn);

Namespaces are free to create and have no per-namespace cost. Users registered within a namespace are isolated — an author in tenant-acme cannot see datasets or dashboards owned by authors in tenant-globex unless you explicitly share them.

Continue in this series

Related AWS analytics guides: Redshift with MCP servers · Athena workgroups for MCP servers · Glue Data Catalog for MCP servers · Amazon Forecast for MCP servers