npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2025 – Pkg Stats / Ryan Hefner

@chinchillaenterprises/mcp-lambda-cron

v1.0.4

Published

MCP server for managing AWS Lambda cron jobs with EventBridge

Readme

MCP Lambda Cron

An MCP server for managing AWS Lambda cron jobs and scheduled events using EventBridge. This tool allows you to create, manage, and monitor scheduled executions of your Lambda functions with both simple cron expressions and advanced scheduling features.

Features

  • Multi-Account Support: Manage cron jobs across multiple AWS accounts
  • Cron & Rate Schedules: Create both cron-based and rate-based schedules
  • EventBridge Integration: Full integration with AWS EventBridge for reliable scheduling
  • Advanced Scheduling: Support for time zones, flexible time windows, and date ranges
  • Lambda Management: List functions, manage permissions automatically
  • Secure Credential Storage: Uses system keychain (Keytar) with encrypted file fallback

Installation

npm install -g @chinchillaenterprises/mcp-lambda-cron

Or use with Claude:

claude mcp add lambda-cron @chinchillaenterprises/mcp-lambda-cron

AWS Setup

Before using this tool, ensure you have:

  1. AWS credentials with permissions for:

    • EventBridge (events:*)
    • Lambda (lambda:*)
    • EventBridge Scheduler (scheduler:*) - for advanced schedules
    • STS (sts:GetCallerIdentity)
  2. Lambda functions already deployed that you want to schedule

Usage

Account Management

// Add a new AWS account
await add_account({
  name: "Production",
  accessKeyId: "AKIAIOSFODNN7EXAMPLE",
  secretAccessKey: "wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY",
  region: "us-east-1"
});

// List all configured accounts
await list_accounts();

// Switch to a different account
await switch_account({ accountId: "account-id" });

// Get current active account
await get_active_account();

Creating Cron Jobs

// Create a cron job (runs daily at noon UTC)
await create_cron_rule({
  ruleName: "daily-report-generator",
  cronExpression: "0 12 * * ? *",
  functionName: "generateDailyReport",
  description: "Generate daily reports at noon",
  enabled: true,
  input: JSON.stringify({ reportType: "daily" })
});

// Create a rate-based schedule (runs every 5 minutes)
await create_rate_rule({
  ruleName: "health-check",
  rateExpression: "5 minutes",
  functionName: "healthCheck",
  description: "Regular health check"
});

Cron Expression Examples

  • 0 12 * * ? * - Daily at noon UTC
  • 0 0 * * ? * - Daily at midnight UTC
  • 0 */2 * * ? * - Every 2 hours
  • 0 9 ? * MON-FRI * - Weekdays at 9 AM UTC
  • 0 0 1 * ? * - First day of every month

Rate Expression Examples

  • 5 minutes - Every 5 minutes
  • 1 hour - Every hour
  • 7 days - Weekly
  • 30 days - Monthly

Managing Rules

// List all rules
await list_rules();

// List rules for a specific function
await list_rules({ targetFunction: "myFunction" });

// Get detailed information about a rule
await get_rule_details({ ruleName: "daily-report-generator" });

// Disable a rule temporarily
await disable_rule({ ruleName: "daily-report-generator" });

// Enable a disabled rule
await enable_rule({ ruleName: "daily-report-generator" });

// Update a rule's schedule
await update_rule_schedule({
  ruleName: "daily-report-generator",
  scheduleExpression: "cron(0 14 * * ? *)"  // Change to 2 PM
});

// Delete a rule
await delete_rule({
  ruleName: "daily-report-generator",
  functionName: "generateDailyReport"  // Optional, for cleaning permissions
});

Advanced Scheduling (Time Zones & Flexible Windows)

// Create schedule with timezone support
await create_advanced_schedule({
  scheduleName: "business-hours-task",
  scheduleExpression: "cron(0 9 ? * MON-FRI *)",
  functionArn: "arn:aws:lambda:us-east-1:123456789012:function:myFunction",
  timezone: "America/New_York",  // Runs at 9 AM ET instead of UTC
  flexibleTimeWindow: 15,  // Can run up to 15 minutes after scheduled time
  startDate: "2024-01-01T00:00:00Z",
  endDate: "2024-12-31T23:59:59Z",
  input: JSON.stringify({ mode: "business-hours" })
});

Lambda Function Management

// List all Lambda functions
await list_lambda_functions();

// List functions with a specific prefix
await list_lambda_functions({ functionNamePrefix: "prod-" });

Tool Reference

Account Management Tools

  • add_account - Add a new AWS account configuration
  • list_accounts - List all configured AWS accounts
  • switch_account - Switch to a different AWS account
  • remove_account - Remove an AWS account configuration
  • get_active_account - Get the currently active AWS account
  • set_default_account - Set an account as the default

Scheduling Tools

  • create_cron_rule - Create a cron-based schedule
  • create_rate_rule - Create a rate-based schedule
  • create_advanced_schedule - Create advanced schedule with timezone and flexible windows
  • delete_rule - Delete a scheduling rule
  • list_rules - List all EventBridge rules
  • get_rule_details - Get details about a specific rule
  • enable_rule - Enable a disabled rule
  • disable_rule - Disable an active rule
  • update_rule_schedule - Update the schedule expression
  • list_lambda_functions - List available Lambda functions

Security Considerations

  • Credentials are stored securely using the system keychain (via Keytar)
  • Fallback to encrypted file storage using AES-256-CBC encryption
  • Never commit AWS credentials to version control
  • Use IAM roles with minimal required permissions
  • Regular credential rotation is recommended

Troubleshooting

Common Issues

  1. "Policy contains a statement with one or more invalid principals"

    • Ensure your Lambda function exists in the specified region
    • Check that the function name is correct
  2. "Rule already exists"

    • EventBridge rule names must be unique per region
    • Delete the existing rule or use a different name
  3. "Access Denied"

    • Verify your AWS credentials have the required permissions
    • Check the account and region settings
  4. Advanced Schedules Not Working

    • Ensure you have created the required IAM role for EventBridge Scheduler
    • The role needs permission to invoke Lambda functions

Contributing

Contributions are welcome! Please submit issues and pull requests on GitHub.

License

MIT