Generated banner for Mongodb Atlas Stream Processing
Generated logo for Mongodb Atlas Stream Processing

Mongodb Atlas Stream Processing

MongoDBOfficialPublished by MongoDB

  • Skill
  • Tool integration
  • Data and AI
  • Apache-2.0
  • No issues found

From the author

Manages MongoDB Atlas Stream Processing (ASP) workflows. Handles workspace provisioning, data source/sink connections, processor lifecycle operations, debugging diagnostics, and tier sizing. Supports Kafka, Atlas clusters, S3, HTTPS, and Lambda integrations for streaming data workloads and event processing. NOT for general MongoDB queries or Atlas cluster management. Requires MongoDB MCP Server with Atlas API credentials.
— the description by MongoDB

AutoGineer summary

Written by AutoGineer from the skill’s own files, not by the author

This skill provides a structured interface for managing MongoDB Atlas Stream Processing (ASP) workflows. It enables users to provision workspaces, configure data connections, build stream processing pipelines, and monitor processor health. The skill emphasizes a rigorous development lifecycle, including mandatory pre-deployment validation of connections and pipeline stages, to ensure reliable data streaming between sources like Kafka, Atlas clusters, S3, and Lambda.

What it does

  • Provisions and manages Atlas Stream Processing workspaces and tiers.
  • Configures connections for diverse data sources and sinks including Kafka, S3, and Atlas clusters.
  • Builds and deploys streaming pipelines with support for windowing, enrichment, and validation.
  • Provides diagnostic tools to monitor processor state, health, and performance metrics.
  • Handles lifecycle operations such as starting, stopping, modifying, and tearing down processors.
  • Enforces safety checks for workspace and connection deletion to prevent accidental data loss.

When to use it

  • When you need to build real-time data processing pipelines within the MongoDB Atlas ecosystem.
  • When you are setting up streaming integrations between Kafka, S3, AWS Lambda, and MongoDB.
  • When you need to perform health checks or debug existing stream processing workloads.
  • When you require a structured, repeatable workflow for deploying and managing stream processors.

Advantages

  • Reduces configuration errors through mandatory pre-deployment validation steps.
  • Provides a unified interface for complex streaming infrastructure management.
  • Supports safe lifecycle management with built-in state checks and teardown safeguards.
  • Facilitates easier debugging with integrated diagnostic reports and health monitoring.

Usage examples

“Create a new stream processing workspace in the US-East-1 region.”
The agent will use the build tool to provision a new workspace, ensuring the correct region mapping for AWS is applied.
“Diagnose why my Kafka-to-Atlas processor is failing.”
The agent will run a diagnostic report on the specified processor to identify errors, check partition status, and suggest remediation steps.

Install

  1. Download the skill as a ZIP:

    https://autogineer.com/agent-skills/mongodb/mongodb-atlas-stream-processing/download
  2. Unzip it into the cross-client skills folder of your project:

    mkdir -p .agents/skills && unzip mongodb-atlas-stream-processing.zip -d .agents/skills

Documentation by MongoDB

MongoDB Atlas Streams

Build, operate, and debug Atlas Stream Processing (ASP) pipelines using four MCP tools from the MongoDB MCP Server.

Prerequisites

This skill requires the MongoDB MCP Server connected with:

  • Atlas API credentials (apiClientId and apiClientSecret)

The 4 tools: atlas-streams-discover, atlas-streams-build, atlas-streams-manage, atlas-streams-teardown.

All operations require an Atlas project ID. If unknown, call atlas-list-projects first to find your project ID.

If MCP tools are unavailable

If the MongoDB MCP Server is not connected or the streams tools are missing, see references/mcp-troubleshooting.md for diagnostic steps and fallback options.

Tool Selection Matrix

atlas-streams-discover — ALL read operations
ActionUse when
list-workspacesSee all workspaces in a project
inspect-workspaceReview workspace config, state, region
list-connectionsSee all connections in a workspace
inspect-connectionCheck connection state, config, health
list-processorsSee all processors in a workspace
inspect-processorCheck processor state, pipeline, config
diagnose-processorFull health report: state, stats, errors
get-networkingPrivateLink and VPC peering details. Optional: cloudProvider + region to get Atlas account details for PrivateLink setup

Pagination (all list actions): limit (1-100, default 20), pageNum (default 1). Response format: responseFormat — "concise" (default for list actions) or "detailed" (default for inspect/diagnose).

atlas-streams-build — ALL create operations
ResourceKey parameters
workspacecloudProvider, region, tier (default SP10), includeSampleData
connectionconnectionName, connectionType (Kafka/Cluster/S3/Https/Kinesis/Lambda/SchemaRegistry/Sample), connectionConfig
processorprocessorName, pipeline (must start with $source, end with $merge/$emit), dlq, autoStart
privatelinkprivateLinkConfig (project-level, not tied to a specific workspace)

Field mapping — only fill fields for the selected resource type:

  • resource = "workspace": Fill: projectId, workspaceName, cloudProvider, region, tier, includeSampleData. Leave empty: all connection and processor fields.

  • resource = "connection": Fill: projectId, workspaceName, connectionName, connectionType, connectionConfig. Leave empty: all workspace and processor fields. (See references/connection-configs.md for type-specific schemas.)

  • resource = "processor": Fill: projectId, workspaceName, processorName, pipeline, dlq (recommended), autoStart (optional). Leave empty: all workspace and connection fields. (See references/pipeline-patterns.md for pipeline examples.)

  • resource = "privatelink": Fill: projectId, privateLinkConfig. Note: PrivateLink is project-level, not workspace-level. workspaceName is not required — omit it. Leave empty: all connection and processor fields.

atlas-streams-manage — ALL update/state operations
ActionNotes
start-processorBegins billing. Optional tier override, resumeFromCheckpoint
stop-processorStops billing. Retains state 45 days
modify-processorProcessor must be stopped first. Change pipeline, DLQ, or name
update-workspaceChange tier or region
update-connectionUpdate config (networking is immutable — must delete and recreate)
accept-peering / reject-peeringVPC peering management

Field mapping — always fill projectId, workspaceName, then by action:

  • "start-processor" → resourceName. Optional: tier, resumeFromCheckpoint, startAtOperationTime (ISO 8601 timestamp to resume from a specific point)

  • "stop-processor" → resourceName

  • "modify-processor" → resourceName. At least one of: pipeline, dlq, newName

  • "update-workspace" → newRegion or newTier

  • "update-connection" → resourceName, connectionConfig. Exception: networking config (e.g., PrivateLink) cannot be modified after creation — delete and recreate.

  • "accept-peering" → peeringId, requesterAccountId, requesterVpcId

  • "reject-peering" → peeringId

State pre-checks:

  • start-processor → errors if processor is already STARTED

  • stop-processor → no-ops if already STOPPED or CREATED (not an error)

  • modify-processor → errors if processor is STARTED (must stop first)

Processor states: CREATED → STARTED (via start) → STOPPED (via stop). Can also enter FAILED on runtime errors. Modify requires STOPPED or CREATED state.

Teardown safety checks:

  • Processor deletion → auto-stops before deleting (no need to stop manually first)

  • Connection deletion → blocks if any running processor references it. Stop/delete referencing processors first.

  • Workspace deletion → See detailed workflow below (lines 108-111).

atlas-streams-teardown — ALL delete operations
ResourceSafety behavior
processorAuto-stops before deleting
connectionBlocks if referenced by running processor
workspaceCascading delete of all connections and processors
privatelink / peeringRemove networking resources

Field mapping — always fill projectId, resource, then:

  • resource: "workspace" → workspaceName

  • resource: "connection" or "processor" → workspaceName, resourceName

  • resource: "privatelink" or "peering" → resourceName (the ID). These are project-level resources, not tied to a specific workspace.

Before deleting a workspace, inspect it first:

  1. atlas-streams-discover → inspect-workspace — get connection/processor counts

  2. Present to user: "Workspace X contains N connections and M processors. Deleting permanently removes all. Proceed?"

  3. Wait for confirmation before calling atlas-streams-teardown

CRITICAL: Validate Before Creating Processors

You MUST call search-knowledge before composing any processor pipeline. This is not optional.

  • Field validation: Query with the sink/source type, e.g. "Atlas Stream Processing $emit S3 fields" or "Atlas Stream Processing Kafka $source configuration". This catches errors like prefix vs path for S3 $emit.

  • Pattern examples: Query with dataSources: [{"name": "devcenter"}] for working pipelines, e.g. "Atlas Stream Processing tumbling window example".

Also fetch examples from the official ASP examples repo when building non-trivial processors: https://github.com/mongodb/ASP_example (quickstarts, example processors, Terraform examples). Start with example_processors/README.md for the full pattern catalog.

Key quickstarts:

QuickstartPattern
00_hello_world.jsonInline $source.documents with $match (zero infra, ephemeral)
01_changestream_basic.jsonChange stream → tumbling window → $merge to Atlas
03_kafka_to_mongo.jsonKafka source → tumbling window rollup → $merge to Atlas
04_mongo_to_mongo.jsonChained processors: rollup → archive to separate collection
05_kafka_tail.jsonReal-time Kafka topic monitoring (sinkless, like tail -f)

Pipeline Rules & Warnings

Invalid constructs — these are NOT valid in streaming pipelines:

  • $$NOW, $$ROOT, $$CURRENT — NOT available in stream processing. NEVER use these. Use the document's own timestamp field or _stream_meta metadata for event time instead of $$NOW.

  • HTTPS connections as $source — HTTPS is for $https enrichment or sink only, NOT as a data source

  • Kafka $source without topic — topic field is required

  • Pipelines without a sink — terminal stage ($merge, $emit, $https, or $externalFunction async) required for deployed processors (sinkless only works via sp.process())

  • Lambda as $emit target — Lambda uses $externalFunction (mid-pipeline enrichment), not $emit

  • $validate with validationAction: "error" — crashes processor; use "dlq" instead

Required fields by stage:

  • $source (change stream): include fullDocument: "updateLookup" to get the full document content

  • $source (Kinesis): use stream (NOT streamName or topic)

  • $emit (Kinesis): MUST include partitionKey

  • $emit (S3): use path (NOT prefix)

  • $https: must include connectionName, path, method, as, onError: "dlq"

  • $externalFunction: must include connectionName, functionName, execution, as, onError: "dlq"

  • $validate: must include validator with $jsonSchema and validationAction: "dlq"

  • $lookup: include parallelism setting (e.g., parallelism: 2) for concurrent I/O

  • AWS connections (S3, Kinesis, Lambda): IAM role ARN must be registered via Atlas Cloud Provider Access first. Always confirm this with user. See references/connection-configs.md for details.

See references/pipeline-patterns.md for stage field examples with JSON syntax.

SchemaRegistry connection: connectionType must be "SchemaRegistry" (not "Kafka"). Schema type values are case-sensitive (use lowercase avro, not AVRO). See references/connection-configs.md for required fields and auth types.

MCP Tool Behaviors

Elicitation: When creating connections, the build tool auto-collects missing sensitive fields (passwords, bootstrap servers) via MCP elicitation. Do NOT ask the user for these — let the tool collect them.

Auto-normalization:

  • bootstrapServers array → auto-converted to comma-separated string

  • schemaRegistryUrls string → auto-wrapped in array

  • dbRoleToExecute → defaults to {role: "readWriteAnyDatabase", type: "BUILT_IN"} for Cluster connections

Workspace creation: includeSampleData defaults to true, which auto-creates the sample_stream_solar connection.

Region naming: The region field uses Atlas-specific names that differ by cloud provider. Using the wrong format returns a cryptic dataProcessRegion error.

ProviderCloud RegionStreams region Value
AWSus-east-1VIRGINIA_USA
AWSus-east-2OHIO_USA
AWSeu-west-1DUBLIN_IRL
GCPus-central1US_CENTRAL1
GCPeurope-west1EUROPE_WEST1
Azureeastuseastus
Azurewesteuropewesteurope

See references/connection-configs.md for the full region mapping table. If unsure, inspect an existing workspace with atlas-streams-discover → inspect-workspace and check dataProcessRegion.region.

Connection Capabilities — Source/Sink Reference

Know what each connection type can do before creating pipelines:

Connection TypeAs Source ($source)As Sink ($merge / $emit)Mid-PipelineNotes
Cluster✅ Change streams✅ $merge to collections✅ $lookupChange streams monitor insert/update/delete/replace operations
Kafka✅ Topic consumer✅ $emit to topics❌Source MUST include topic field
Sample Stream✅ Sample data❌ Not valid❌Testing/demo only
S3❌ Not valid✅ $emit to buckets❌Sink only - use path, format, compression. Supports AWS PrivateLink.
Https❌ Not valid✅ $https as sink✅ $https enrichmentCan be used mid-pipeline for enrichment OR as final sink stage
AWSLambda❌ Not valid✅ $externalFunction (async only)✅ $externalFunction (sync or async)Sink: execution: "async" required. Mid-pipeline: execution: "sync" or "async"
AWS Kinesis✅ Stream consumer✅ $emit to streams❌Similar to Kafka pattern
SchemaRegistry❌ Not valid❌ Not valid✅ Schema resolutionMetadata only - used by Kafka connections for Avro schemas

Common connection usage mistakes to avoid:

  • ❌ Using $externalFunction as sink with execution: "sync" → Must use execution: "async" for sink stage

  • ❌ Forgetting change streams exist → Atlas Cluster is a powerful source, not just a sink

  • ❌ Using $merge with Kafka → Use $emit for Kafka sinks

See references/connection-configs.md for detailed connection configuration schemas by type.

Core Workflows

Setup from scratch
  1. atlas-streams-discover → list-workspaces (check existing)

  2. atlas-streams-build → resource: "workspace" (region near data, SP10 for dev)

  3. atlas-streams-build → resource: "connection" (for each source/sink/enrichment)

  4. Validate connections: atlas-streams-discover → list-connections + inspect-connection for each — verify names match targets, present summary to user

  5. Call search-knowledge to validate field names. Fetch relevant examples from https://github.com/mongodb/ASP_example

  6. atlas-streams-build → resource: "processor" (with DLQ configured)

  7. atlas-streams-manage → start-processor (warn about billing)

Workflow Patterns

Incremental pipeline development (recommended): See references/development-workflow.md for the full 5-phase lifecycle.

  1. Start with basic $source → $merge pipeline (validate connectivity)

  2. Add $match stages (validate filtering)

  3. Add $addFields / $project transforms (validate reshaping)

  4. Add windowing or enrichment (validate aggregation logic)

  5. Add error handling / DLQ configuration

Modify a processor pipeline:

  1. atlas-streams-manage → action: "stop-processor" — processor MUST be stopped first

  2. atlas-streams-manage → action: "modify-processor" — provide new pipeline

  3. atlas-streams-manage → action: "start-processor" — restart

Debug a failing processor:

  1. atlas-streams-discover → diagnose-processor — one-shot health report. Always call this first.

  2. Commit to a specific root cause. Match symptoms to diagnostic patterns:

    • Error 419 + "no partitions found" → Kafka topic doesn't exist or is misspelled

    • State: FAILED + multiple restarts → connection-level error (bypasses DLQ), check connection config

    • State: STARTED + zero output + windowed pipeline → likely idle Kafka partitions blocking window closure; add partitionIdleTimeout to Kafka $source (e.g., {"size": 30, "unit": "second"})

    • State: STARTED + zero output + non-windowed → check if source has data; inspect Kafka offset lag

    • High memoryUsageBytes approaching tier limit → OOM risk; recommend higher tier

    • DLQ count increasing → per-document errors; use MongoDB find on DLQ collection See references/output-diagnostics.md for the full pattern table.

  3. Classify processor type before interpreting output volume (alert vs transformation vs filter).

  4. Provide concrete, ordered fix steps specific to the diagnosed root cause. Do NOT present a list of hypothetical scenarios.

  5. If detailed logs are needed, direct the user to the Atlas UI: Atlas → Stream Processing → Workspace → Processor → Logs tab.

Chained processors (multi-sink pattern)

CRITICAL: A single pipeline can only have ONE terminal sink ($merge or $emit). When users request multiple output destinations (e.g., "write to Atlas AND emit to Kafka"), you MUST acknowledge the single-sink constraint and propose chained processors using an intermediate destination. See references/pipeline-patterns.md for the full pattern with examples.

Pre-Deploy & Post-Deploy Checklists

See references/development-workflow.md for the complete pre-deploy quality checklist (connection validation, pipeline validation) and post-deploy verification workflow.

Tier Sizing & Performance

See references/sizing-and-parallelism.md for tier specifications, parallelism formulas, complexity scoring, and performance optimization strategies.

Troubleshooting

See references/development-workflow.md for the complete troubleshooting table covering processor failures, API errors, configuration issues, and performance problems.

Billing & Cost

Atlas Stream Processing has no free tier. All deployed processors incur continuous charges while running.

  • Charges are per-hour, calculated per-second, only while the processor is running

  • stop-processor stops billing; stopped processors retain state for 45 days at no charge

  • For prototyping without billing: Use sp.process() in mongosh — runs pipelines ephemerally without deploying a processor

  • See references/sizing-and-parallelism.md for tier pricing and cost optimization strategies

Safety Rules

  • atlas-streams-teardown and atlas-streams-manage require user confirmation — do not bypass

  • BEFORE calling atlas-streams-teardown for a workspace, you MUST first inspect the workspace with atlas-streams-discover to count connections and processors, then present this information to the user before requesting confirmation

  • BEFORE creating any processor, you MUST validate all connections per the "Pre-Deployment Validation" section in references/development-workflow.md

  • Deleting a workspace removes ALL connections and processors permanently

  • After stopping a processor, state is preserved 45 days — then checkpoints are discarded

  • resumeFromCheckpoint: false drops all window state — warn user first

  • Moving processors between workspaces is not supported (must recreate)

  • Dry-run / simulation is not supported — explain what you would do and ask for confirmation

  • Always warn users about billing before starting processors

  • Store API authentication credentials in connection settings, never hardcode in processor pipelines

Reference Files

FileRead when...
references/pipeline-patterns.mdBuilding or modifying processor pipelines
references/connection-configs.mdCreating connections (type-specific schemas)
references/development-workflow.mdFollowing lifecycle management or debugging decision trees
references/output-diagnostics.mdProcessor output is unexpected (zero, low, or wrong)
references/sizing-and-parallelism.mdChoosing tiers, tuning parallelism, or optimizing cost

Files

references/development-workflow.md

Development Workflow Reference

Pipeline Stage Categories

Understanding stage categories helps compose valid pipelines. Stages must appear in this order:

CategoryStagesRules
Source (1, required)$sourceMust be first. One per pipeline.
Stateless Processing$match, $project, $addFields, $unset, $unwind, $replaceRoot, $redactCan appear anywhere after source. No state or memory overhead.
Enrichment$lookup, $httpsI/O-bound. Use parallelism setting. Place $https after windows to batch.
Stateful/Window$tumblingWindow, $hoppingWindow, $sessionWindowAccumulates state in memory. Monitor memoryUsageBytes.
Validation$validateSchema enforcement. Use validationAction: "dlq" (not "error"). Place early to catch bad data.
Custom Code$functionJavaScript UDFs. Requires SP30+.
Output (1+, required for deployed)$merge, $emitMust be last. Required for persistent processors. Sinkless = ephemeral only.

Key ordering principle: Place $match as early as possible (reduces volume for all downstream stages). Place $project after $match (reduces document size). Place $https after windows (batches API calls).

5-Phase Development Lifecycle

Phase 1: Project Setup

Goal: Workspace and connections ready.

  1. Discover existing resources:

    • atlas-streams-discover → list-workspaces — see what already exists

    • If workspace exists, inspect-workspace to review config

  2. Create workspace (if needed):

    • atlas-streams-build → resource: "workspace"

    • Choose region close to your data sources

    • Start with tier: "SP10" for development

    • includeSampleData: true (default) gives you sample_stream_solar for testing

  3. Verify workspace:

    • atlas-streams-discover → inspect-workspace — confirm state and region

Phase 2: Connection Development

Goal: All data sources and sinks connected and verified.

  1. Identify required connections:

    • Source connections (Kafka, Cluster change streams, Kinesis, Sample)

    • Sink connections (Cluster for $merge, Kafka for $emit, S3, Kinesis)

    • Enrichment connections (Https for $https, Cluster for $lookup)

  2. Create each connection:

    • atlas-streams-build → resource: "connection" for each

    • Let the tool elicit missing sensitive fields (passwords, bootstrap servers)

    • See connection-configs.md for type-specific schemas

  3. Verify connections:

    • atlas-streams-discover → list-connections — confirm all created

    • atlas-streams-discover → inspect-connection for each — verify state and config

Phase 3: Processor Development

Goal: Working processor with validated pipeline.

Pre-Deployment Connection Validation (MANDATORY)

BEFORE creating any processor, you MUST validate all connections referenced in your pipeline. This prevents silent failures and confusion about data destinations.

Step 1: List all connections in workspace

atlas-streams-discover → action: "list-connections", workspaceName: "<your-workspace>"

Verify all required connections exist.

Step 2: Inspect EACH connection referenced in pipeline

For EVERY connectionName in your pipeline (source, sink, enrichment), inspect it:

atlas-streams-discover → action: "inspect-connection",
                         workspaceName: "<your-workspace>",
                         resourceName: "<connection-name>"

Verify for each connection:

  • [ ] Connection exists and state is READY

  • [ ] Connection type matches intended usage:

    • Cluster: valid for $source (change streams), $merge, $lookup

    • Kafka: valid for $source, $emit

    • S3: valid for $emit only

    • Https: valid for $https enrichment or sink

    • Lambda: valid for $externalFunction only

  • [ ] Connection name matches actual target (avoid confusion):

    • ⚠️ BAD: connection "atlascluster" → actual target "ClusterRestoreTest"

    • ✅ GOOD: connection "cluster-restore-test" → actual target "ClusterRestoreTest"

  • [ ] For Cluster connections: verify the clusterName field points to the intended cluster

Step 3: Present validation summary to user

Always show the user what connections will be used:

"Before creating processor '<name>', I've verified your connections:
 - ✅ sample_stream_solar → Sample data (READY)
 - ⚠️ atlascluster → ClusterRestoreTest (READY)
      Warning: Connection name 'atlascluster' doesn't match actual cluster 'ClusterRestoreTest'
 - ✅ open-meteo-api → https://api.open-meteo.com/v1/... (READY)

Proceed with processor creation?"

Step 4: Wait for user confirmation if warnings exist

If any connection name doesn't match its target, ask the user to confirm before proceeding.

Step 5: Only then create the processor

This validation workflow prevents:

  • Creating processors with non-existent connections (fails immediately)

  • Writing data to unexpected clusters (e.g., "atlascluster" → "ClusterRestoreTest" instead of "AtlasCluster")

  • Confusion when verifying output data later

Incremental Pipeline Development

Follow incremental pipeline development — test at each step:

Step 1: Basic connectivity

[
  {"$source": {"connectionName": "my-source"}},
  {"$merge": {"into": {"connectionName": "my-sink", "db": "test", "coll": "step1"}}}
]

Create with autoStart: true. Verify documents flow. Stop processor.

Step 2: Add filtering

[
  {"$source": {"connectionName": "my-source"}},
  {"$match": {"status": "active"}},
  {"$merge": {"into": {"connectionName": "my-sink", "db": "test", "coll": "step2"}}}
]

Modify pipeline (stop → modify-processor → start). Verify filtered output.

Step 3: Add transformations

[
  {"$source": {"connectionName": "my-source"}},
  {"$match": {"status": "active"}},
  {"$addFields": {"processed_at": "$$NOW_NOT_VALID"}},
  {"$project": {"userId": 1, "amount": 1, "processed_at": 1}},
  {"$merge": {"into": {"connectionName": "my-sink", "db": "test", "coll": "step3"}}}
]

Remember: $$NOW is NOT valid in streaming. Use a field from the source document or omit.

Step 4: Add windowing or enrichment (if needed)

Step 5: Add error handling

  • Configure DLQ: {"dlq": {"connectionName": "my-sink", "db": "streams_dlq", "coll": "failed_docs"}}

  • Add $ifNull for optional enrichment fields

  • Set onError: "dlq" on $https stages

Phase 4: Testing & Validation

Goal: Processor verified working correctly.

  1. Confirm processor state:

    • atlas-streams-discover → inspect-processor — state should be STARTED

  2. Run diagnostics:

    • atlas-streams-discover → diagnose-processor — full health report

  3. Verify data flow:

    • Use MongoDB count tool on output collection — documents arriving?

    • Use MongoDB find tool on output collection — data looks correct?

    • Use MongoDB count tool on DLQ collection — any errors?

    • If DLQ has documents, use MongoDB find tool to inspect failure reasons

  4. Classify output volume:

    • See output-diagnostics.md for the full decision framework

    • Alert processors: low output is expected

    • Transformation processors: low output is a red flag

Phase 5: Production Deployment

Goal: Processor running at appropriate tier with monitoring.

  1. Right-size the tier:

    • See sizing-and-parallelism.md for tier selection

    • Review memoryUsageBytes from diagnostics

    • Consider parallelism needs for $merge, $lookup, $https

    • Upgrade tier: atlas-streams-manage → stop-processor, then start-processor with tier override

  2. Ensure DLQ is configured (mandatory for production)

  3. Use descriptive processor names (e.g., fraud-detector, order-enricher, iot-rollup)

Debugging Decision Trees

Connection Failures
  1. atlas-streams-discover → inspect-connection — check state

  2. If Kafka: verify bootstrapServers is a comma-separated string (not array)

  3. If Cluster: verify cluster exists in project (atlas-list-clusters)

  4. If AWS (S3/Kinesis/Lambda): verify IAM role ARN is registered in Cloud Provider Access

  5. If Https: verify URL is reachable and auth headers are in connection config

Processor Startup Failures
  1. atlas-streams-discover → diagnose-processor — check state and errors

  2. If FAILED: read the error message in diagnostics

  3. Common causes:

    • Invalid pipeline syntax (missing $source, missing sink)

    • $$NOW/$$ROOT/$$CURRENT used (not valid in streaming)

    • Kafka $source missing topic field

    • Referenced connection doesn't exist — validate with list-connections first

    • Connection name doesn't match expected target — inspect connection to verify actual cluster/resource

    • OOM — tier too small for pipeline complexity

Processing Errors (Running but DLQ filling up)
  1. Use MongoDB find tool on DLQ collection — inspect error messages

  2. Common causes:

    • Schema mismatches in source data

    • $https enrichment failures (API down, auth expired)

    • Type errors in $addFields or $project expressions

  3. Fix: stop-processor → modify-processor (fix pipeline) → start-processor

Performance Issues (Running but slow)
  1. atlas-streams-discover → diagnose-processor — check stats

  2. Check memoryUsageBytes — if near 80% of tier RAM, upgrade tier

  3. Check if $match is early in pipeline (reduces downstream volume)

  4. Check if $https has parallelism setting (increase for I/O-bound enrichment)

  5. Check if windows have partitionIdleTimeout (idle Kafka partitions block windows)

  6. Consider upgrading tier or increasing stage parallelism

Operational Monitoring Cadence

Daily
  • Check processor states via atlas-streams-discover → list-processors

  • Verify DLQ collections aren't growing via MongoDB count tool

  • Confirm output collections are receiving data

Weekly
  • Run diagnose-processor for each production processor

  • Review memoryUsageBytes trends — approaching 80%?

  • Check connection health across all connections

Monthly
  • Evaluate tier appropriateness — over-provisioned or under-provisioned?

  • Review DLQ patterns — recurring errors that need pipeline fixes?

  • Consider parallelism adjustments based on throughput trends

Troubleshooting

SymptomLikely causeAction
Processor FAILED on startInvalid pipeline syntax, missing connection, $$NOW useddiagnose-processor → read error → fix pipeline
DLQ filling upSchema mismatch, $https failures, type errorsfind on DLQ → fix pipeline or connection
Zero output (transformation)Connection issue, wrong topic, filter too strictCheck source health → verify connections → check $match
Zero output (alert)Probably normal — no anomalies detectedVerify with known test event
Windows not closingIdle Kafka partitionsAdd partitionIdleTimeout to $source (e.g., {"size": 30, "unit": "second"})
OOM / processor crashTier too small for window statediagnose-processor → check memoryUsageBytes → upgrade tier
Slow throughputLow parallelism on I/O stagesIncrease parallelism on $merge/$lookup/$https
404 on workspaceDoesn't exist or misspelleddiscover → list-workspaces
409 on createName already existsInspect existing resource or pick new name
402 error on startNo billing configuredDo NOT retry. Add payment method in Atlas → Billing. Use sp.process() in mongosh as free alternative
"processor must be stopped"Tried to modify running processormanage → stop-processor first
bootstrapServers formatPassed as array instead of stringUse comma-separated string: "broker1:9092,broker2:9092"
"must choose at least one role"Cluster connection without dbRoleToExecuteDefaults to readWriteAnyDatabase — or specify custom role
"No cluster named X"Cluster doesn't exist in projectatlas-list-clusters to verify
IAM role ARN not foundARN not registered in projectRegister via Atlas → Cloud Provider Access
dataProcessRegion formatWrong region formatSee region table above. If unsure, inspect an existing workspace
Processor PROVISIONING for minutesRestart cycle with exponential backoffWait for FAILED state, or stop → restart. Check logs for repeated error
Parallelism exceededTier too small for requested parallelismStart with higher tier (see sizing-and-parallelism.md)
Networking change neededNetworking is immutable after creationDelete connection and recreate with new networking config
401 / 403 on API callInvalid or expired Atlas API credentialsVerify apiClientId/apiClientSecret and project-level permissions
429 rate limitToo many API callsWait and retry; avoid tight loops of discover calls

Pre-Deploy Quality Checklist

Before creating a processor, verify:

Connection Validation (MANDATORY - Always do this first)
  • [ ] CRITICAL: Call atlas-streams-discover → action: "list-connections" to list all connections in workspace

  • [ ] CRITICAL: Call atlas-streams-discover → action: "inspect-connection" for EACH connection referenced in pipeline

  • [ ] CRITICAL: Verify connection names clearly indicate their actual targets (avoid generic names like "atlascluster" pointing to "ClusterRestoreTest")

  • [ ] CRITICAL: Present connection summary to user: "Connection 'X' → Actual target 'Y'" for each connection

  • [ ] CRITICAL: Warn user if connection names don't match their targets and ask for confirmation

  • [ ] All connections are in READY state

  • [ ] Connection types match usage (Cluster for $source/$merge, Kafka for topics, etc.)

Pipeline Validation
  • [ ] search-knowledge was called to validate sink/source field names

  • [ ] Pipeline starts with $source and ends with $merge, $emit, $https, or $externalFunction (async)

  • [ ] No $$NOW, $$ROOT, or $$CURRENT in the pipeline

  • [ ] Kafka $source includes a topic field

  • [ ] Kafka $source with windowed pipeline includes partitionIdleTimeout (prevents windows from stalling on idle partitions)

  • [ ] HTTPS connections are only used in $https enrichment or sink stages, not in $source

  • [ ] DLQ is configured (recommended for production)

  • [ ] $https stages use onError: "dlq" (not "fail")

  • [ ] $externalFunction stages use onError: "dlq" and execution is explicitly set

  • [ ] API auth is stored in connection settings, not hardcoded in the pipeline

Post-Deploy Verification Workflow

After creating and starting a processor:

  1. atlas-streams-discover → action: "inspect-processor" — confirm state is STARTED

  2. atlas-streams-discover → action: "diagnose-processor" — check for errors in the health report

  3. Use MongoDB count tool on the DLQ collection — verify no errors accumulating

  4. Use MongoDB find tool on the output collection — verify documents are arriving

  5. If output is low/zero, classify processor type before assuming a problem (see Debug section)

Requirements and compatibility

Works with: Claude Code, Claude apps, OpenAI Codex, GitHub Copilot, Cursor, Gemini CLI, Kiro, OpenCode, Goose, Amp, Roo Code, JetBrains Junie, Factory Droid, Devin (ex-Windsurf), Mistral Vibe, OpenHands, Letta

“Works with” means the tool reads the open Agent Skills format; a skill written for one tool may use features others lack.

Needs: Needs an MCP server

Security

No issues found by our static scan· No issues found

A static scan is not a guarantee. Skills are third-party content: review a skill before you let an agent use it.

Attribution and licence

Published by
MongoDB
Publisher
MongoDB (Official)
Source
mongodb/agent-skills · skills/mongodb-atlas-stream-processing · commit 155bb9c
Licence
Apache License 2.0 (redistribution allowed)
  • LICENSE (added by AutoGineer from LICENSE)
  • ATTRIBUTION.md (written by AutoGineer)
Synced
Also distributed in
mongodb/agent-skills, mongodb/agent-skills

AutoGineer is not affiliated with or endorsed by MongoDB or MongoDB.

Download ZIP

The ZIP holds the skill’s files, its licence files and an ATTRIBUTION.md. Download mongodb-atlas-stream-processing.zip