Skip to content

Add batch operation support to MCP server#73

Merged
titouanmathis merged 4 commits intomainfrom
feature/68-batch-operations
Feb 27, 2026
Merged

Add batch operation support to MCP server#73
titouanmathis merged 4 commits intomainfrom
feature/68-batch-operations

Conversation

@titouanmathis
Copy link
Contributor

Implements #68 — adds a batch resource with run action to execute multiple read operations in parallel.

Changes

Core

  • Added batch to RESOURCES constant

MCP

  • New handleBatch() handler with validation (max 10 ops, read-only, required fields)
  • Parallel execution via Promise.allSettled with per-operation error isolation
  • _batch summary with total/succeeded/failed counts
  • Added operations parameter to forge tool input schema
  • Updated help and schema handlers for batch resource
  • Comprehensive test coverage

Usage

{
  "resource": "batch",
  "action": "run",
  "operations": [
    { "resource": "servers", "action": "list" },
    { "resource": "sites", "action": "list", "server_id": "123" },
    { "resource": "databases", "action": "list", "server_id": "123" }
  ]
}

Closes #68

Add a batch resource with run action that executes multiple read
operations in a single MCP call. Operations run in parallel with
Promise.allSettled, max 10 per batch. Only read actions allowed.

Closes #68

Co-authored-by: Claude <claude@anthropic.com>
@codecov
Copy link

codecov bot commented Feb 27, 2026

Codecov Report

❌ Patch coverage is 98.24561% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 99.80%. Comparing base (d3c0f6f) to head (76d53fb).
⚠️ Report is 3 commits behind head on main.
✅ All tests successful. No failed tests found.

Files with missing lines Patch % Lines
packages/mcp/src/handlers/batch.ts 97.87% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main      #73      +/-   ##
==========================================
- Coverage   99.82%   99.80%   -0.03%     
==========================================
  Files         218      219       +1     
  Lines        3462     3519      +57     
  Branches      799      827      +28     
==========================================
+ Hits         3456     3512      +56     
- Misses          6        7       +1     
Flag Coverage Δ
unittests 99.80% <98.24%> (-0.03%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

titouanmathis and others added 3 commits February 27, 2026 16:46
Add test for non-object operation validation and e2e batch test
through the full executeToolWithCredentials pipeline.

Co-authored-by: Claude <claude@anthropic.com>
Add tests for: non-object operation, results without structuredContent,
non-Error rejection reason, batch via forge_write rejection, and full
e2e pipeline coverage.

Co-authored-by: Claude <claude@anthropic.com>
Co-authored-by: Claude <claude@anthropic.com>
@titouanmathis titouanmathis merged commit 01cbf8a into main Feb 27, 2026
6 checks passed
@titouanmathis titouanmathis deleted the feature/68-batch-operations branch February 27, 2026 16:01
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.

Add batch operation support to MCP server

1 participant