Get the FREE Ultimate OpenClaw Setup Guide →

claude -scheduler

Use Claude API to prompt remote agents on a cron interval but use local MCPs to handle tool calls for context

Installation
Run this command in your terminal to add the MCP server to Claude Code.
Run in terminal:
Command
claude mcp add --transport stdio tonybentley-claude-mcp-scheduler npx -y @modelcontextprotocol/server-filesystem

How to use

This MCP server demonstrates how to schedule Claude AI prompts using a filesystem-based MCP server connection. The scheduler connects to the local filesystem MCP server to read/write data and execute prompts via Claude, enabling automated, unattended tasks. The example configuration focuses on the filesystem MCP server, but the architecture supports adding other MCP servers (like databases or APIs) by extending the mcp section. To use it, configure a cron-based schedule that sends a prompt to Claude and stores the results in the specified outputs directory, enabling you to manage and review results later. The included test utilities let you validate prompts before scheduling, ensuring your prompts, outputs, and error handling behave as expected. This setup is suitable for batch processing, daily analyses, or recurring file-based operations integrated with Claude’s capabilities.

How to install

Prerequisites:

  • Node.js v18.0.0 or higher
  • Anthropic API key
  • npm or yarn

Install and run:

  1. Clone the repository
git clone https://github.com/tonybentley/claude-mcp-scheduler.git
cd claude-mcp-scheduler
  1. Install dependencies
npm install
  1. Create a .env file with your Anthropic API key
ANTHROPIC_API_KEY=your-api-key-here
  1. Copy the example configuration (adjust paths as needed)
cp config/config.example.json config/config.json
  1. Start the scheduler
npm start

Optional: If you want to customize the MCP server integration, edit config/config.json to reference additional MCP servers and their connection details. The filesystem MCP server is demonstrated using npx and the server-filesystem package as shown in the example.

Additional notes

Tips and common issues:

  • Ensure Node.js is installed and the correct version is in use.
  • The Anthropic API key must be kept secure; store it in environment variables and avoid committing it to version control.
  • The filesystem MCP server example restricts access to configured directories (e.g., ./data, ./reports). Ensure these directories exist and have proper permissions.
  • When adding more MCP servers (e.g., database or API), keep the command and args consistent with MCP server expectations and update the config.json accordingly.
  • If prompts fail due to API rate limits, consider reducing schedule frequency or increasing delays between prompts.
  • Use the test-prompt utilities to validate prompts before enabling schedules to minimize runtime errors.
  • Review logs in the logs directory for troubleshooting, including connection issues to the MCP server and CAPTCHA-like prompts.

Related MCP Servers

Sponsor this space

Reach thousands of developers