The MCP BatchIt server acts as an aggregator for Model Context Protocol (MCP) tools, allowing you to batch multiple tool calls into a single request to reduce overhead and token usage for AI agents. Instead of making separate calls for each MCP tool operation, you can combine them in one efficient request.
To set up the MCP BatchIt server:
git clone https://github.com/ryanjoachim/mcp-batchit.git
cd mcp-batchit
npm install
npm run build
npm start
The server will start on STDIO by default, allowing your AI agent or any MCP client to spawn it:
mcp-batchit is running on stdio. Ready to batch-execute!
BatchIt exposes a single tool called batch_execute
that:
maxConcurrent
optionstopOnError
optiontimeoutMs
When working with operations that depend on previous results, you'll need to structure your requests in phases:
This example shows how to read multiple files in a single request:
{
"targetServer": {
"name": "filesystem",
"serverType": {
"type": "filesystem",
"config": {
"rootDirectory": "/path/to/your/project"
}
},
"transport": {
"type": "stdio",
"command": "cmd.exe",
"args": [
"/c",
"npx",
"-y",
"@modelcontextprotocol/server-filesystem",
"/path/to/your/project"
]
}
},
"operations": [
{
"tool": "read_file",
"arguments": {
"path": "/path/to/your/project/package.json"
}
},
{
"tool": "read_file",
"arguments": {
"path": "/path/to/your/project/README.md"
}
}
],
"options": {
"maxConcurrent": 2,
"stopOnError": true,
"timeoutMs": 30000
}
}
After processing the gathered information, you can create multiple files in another batch:
{
"targetServer": {
"name": "filesystem",
"serverType": {
"type": "filesystem",
"config": {
"rootDirectory": "/path/to/your/project"
}
},
"transport": {
"type": "stdio",
"command": "cmd.exe",
"args": [
"/c",
"npx",
"-y",
"@modelcontextprotocol/server-filesystem",
"/path/to/your/project"
]
}
},
"operations": [
{
"tool": "create_directory",
"arguments": {
"path": "/path/to/your/project/output-directory"
}
},
{
"tool": "write_file",
"arguments": {
"path": "/path/to/your/project/output-directory/file1.md",
"content": "# Generated Content\n\nThis content was created based on previous information..."
}
},
{
"tool": "write_file",
"arguments": {
"path": "/path/to/your/project/output-directory/file2.md",
"content": "# More Generated Content\n\nAdditional information processed from phase 1..."
}
}
],
"options": {
"maxConcurrent": 1,
"stopOnError": true,
"timeoutMs": 30000
}
}
If you encounter "Tool not found" errors, ensure your transport
configuration is pointing to the actual MCP server (like @modelcontextprotocol/server-filesystem
) rather than the BatchIt aggregator itself.
When using stopOnError: true
with concurrent operations, any operations already in progress will complete, but no new ones will start after a failure occurs.
To add this MCP server to Claude Code, run this command in your terminal:
claude mcp add-json "batchit" '{"command":"npx","args":["-y","mcp-batchit"]}'
See the official Claude Code MCP documentation for more details.
There are two ways to add an MCP server to Cursor. The most common way is to add the server globally in the ~/.cursor/mcp.json
file so that it is available in all of your projects.
If you only need the server in a single project, you can add it to the project instead by creating or adding it to the .cursor/mcp.json
file.
To add a global MCP server go to Cursor Settings > Tools & Integrations and click "New MCP Server".
When you click that button the ~/.cursor/mcp.json
file will be opened and you can add your server like this:
{
"mcpServers": {
"batchit": {
"command": "npx",
"args": [
"-y",
"mcp-batchit"
]
}
}
}
To add an MCP server to a project you can create a new .cursor/mcp.json
file or add it to the existing one. This will look exactly the same as the global MCP server example above.
Once the server is installed, you might need to head back to Settings > MCP and click the refresh button.
The Cursor agent will then be able to see the available tools the added MCP server has available and will call them when it needs to.
You can also explicitly ask the agent to use the tool by mentioning the tool name and describing what the function does.
To add this MCP server to Claude Desktop:
1. Find your configuration file:
~/Library/Application Support/Claude/claude_desktop_config.json
%APPDATA%\Claude\claude_desktop_config.json
~/.config/Claude/claude_desktop_config.json
2. Add this to your configuration file:
{
"mcpServers": {
"batchit": {
"command": "npx",
"args": [
"-y",
"mcp-batchit"
]
}
}
}
3. Restart Claude Desktop for the changes to take effect