Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Jul 26, 2025

This PR adds a comprehensive MCP (Model Context Protocol) command-line interface to batchata for managing batch requests. The CLI provides all the core functionality needed to create, monitor, and manage AI batch jobs from the command line.

New Features

MCP CLI Commands

  • batchata-mcp create - Create new batch requests with model and parameters
  • batchata-mcp list - Display all batch requests with status information
  • batchata-mcp results - Retrieve results for completed batches
  • batchata-mcp cancel - Cancel running batch requests

Parameter Support

  • Model specification with validation against supported providers
  • Message arrays in JSON format: --messages '[{"role":"user","content":"..."}]'
  • File processing: --file document.pdf --prompt "Summarize this"
  • Model parameters: --temperature, --max-tokens, --max-output-tokens
  • Custom state directory: --state-dir

Output Formats

  • Table format (human-readable, default for list)
  • JSON format (machine-readable, default for results)

Usage Examples

# Create batch with messages and parameters
batchata-mcp create --model claude-sonnet-4-20250514 \
  --messages '[{"role": "user", "content": "Hello"}]' \
  --temperature 0.7 --max-tokens 1000

# Create batch with file processing
batchata-mcp create --model gpt-4o-2024-08-06 \
  --file document.pdf --prompt "Summarize this document"

# List all batches with status
batchata-mcp list

# Get results for a specific batch
batchata-mcp results <batch_id>

# Cancel a running batch
batchata-mcp cancel <batch_id>

Implementation Details

The implementation leverages the existing batchata infrastructure with minimal changes to core functionality:

  • New CLI module in batchata/cli/ with clean separation from core logic
  • State management using local directory persistence (./.batchata by default)
  • Comprehensive error handling and parameter validation
  • Integration with existing Batch and BatchRun classes

Testing & Documentation

  • 7 unit tests covering all CLI functionality
  • 5 integration tests for end-to-end workflows
  • Comprehensive help system with examples
  • Updated README with MCP CLI documentation
  • Demo script showing all features

The CLI provides a robust interface for batch job management while maintaining the library's existing API and architecture.

Fixes #10.

Warning

Firewall rules blocked me from connecting to one or more addresses

I tried to connect to the following addresses, but was blocked by firewall rules:

  • astral.sh
    • Triggering command: curl -LsSf REDACTED (dns block)

If you need me to access, download, or install something from one of these locations, you can either:


💬 Share your feedback on Copilot coding agent for the chance to win a $200 gift card! Click here to start the survey.

Copilot AI and others added 2 commits July 26, 2025 15:45
Co-authored-by: yammesicka <1492939+yammesicka@users.noreply.github.com>
Co-authored-by: yammesicka <1492939+yammesicka@users.noreply.github.com>
Copilot AI changed the title [WIP] MCP Add MCP CLI for batch request management Jul 26, 2025
Copilot AI requested a review from yammesicka July 26, 2025 15:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

MCP

2 participants