Loop MCP Server
Enables LLMs to process array items sequentially with a specific task.
Loop MCP Server
An MCP (Model Context Protocol) server that enables LLMs to process arrays item by item with a specific task.
Overview
This MCP server provides tools for:
- Initializing an array with a task description
- Fetching items one by one or in batches for processing
- Storing results for each processed item or batch
- Retrieving all results (only after all items are processed)
- Optional result summarization
- Configurable batch size for efficient processing
Installation
npm install
Usage
Running the Server
npm start
Available Tools
-
initialize_array - Set up the array and task
array: The array of items to processtask: Description of what to do with each itembatchSize(optional): Number of items to process in each batch (default: 1)
-
get_next_item - Get the next item to process
- Returns: Current item, index, task, and remaining count
-
get_next_batch - Get the next batch of items based on batch size
- Returns: Array of items, indices, task, and remaining count
-
store_result - Store the result of processing
result: The processing result (single value or array for batch processing)
-
get_all_results - Get all results after completion
summarize(optional): Include a summary- Note: This will error if processing is not complete
-
reset - Clear the current processing state
Example Workflows
Single Item Processing
// 1. Initialize
await callTool('initialize_array', {
array: [1, 2, 3, 4, 5],
task: 'Square each number'
});
// 2. Process each item
while (true) {
const item = await callTool('get_next_item');
if (item.text === 'All items have been processed.') break;
// Process the item (e.g., square it)
const result = item.value * item.value;
await callTool('store_result', { result });
}
// 3. Get final results
const results = await callTool('get_all_results', { summarize: true });
Batch Processing
// 1. Initialize with batch size
await callTool('initialize_array', {
array: [1, 2, 3, 4, 5, 6, 7, 8, 9, 10],
task: 'Double each number',
batchSize: 3
});
// 2. Process in batches
while (true) {
const batch = await callTool('get_next_batch');
if (batch.text === 'All items have been processed.') break;
// Process the batch
const results = batch.items.map(item => item * 2);
await callTool('store_result', { result: results });
}
// 3. Get final results
const results = await callTool('get_all_results', { summarize: true });
Running the Example
node example-client.js
Integration with Claude Desktop
Add to your Claude Desktop configuration:
{
"mcpServers": {
"loop-processor": {
"command": "node",
"args": ["/path/to/loop_mcp/server.js"]
}
}
}
Related Servers
Scout Monitoring MCP
sponsorPut performance and error data directly in the hands of your AI assistant.
Alpha Vantage MCP Server
sponsorAccess financial market data: realtime & historical stock, ETF, options, forex, crypto, commodities, fundamentals, technical indicators, & more
Framer Plugin MCP Server
Create and manage Framer plugins with web3 capabilities.
Chainlink Feeds
Provides real-time access to Chainlink's decentralized on-chain price feeds.
Luzia Crypto API
Provides real-time cryptocurrency pricing data and market information from major exchanges like Binance, Coinbase, and Kraken via the Luzia API. It enables AI assistants to fetch ticker prices, compare exchange rates, and analyze market trends through specialized tools and prompts.
Sentinel Signal MCP
Agent tools via MCP for workflow scoring, limits/usage, and feedback (trial key supported)
MCP Chaos Rig
A local MCP server that breaks on demand. Test your client against auth failures, disappearing tools, flaky responses, and token expiry, all from a web UI.
Gemsuite
The ultimate open-source server for advanced Gemini API interaction with MCP, intelligently selects models.
Remote MCP Server for Odoo
An example of a remote MCP server for Odoo, deployable on Cloudflare Workers without authentication.
SitemapKit
SitemapKit is an API and MCP server that discovers and extracts sitemaps from any website. Developers and AI agents use it to get the full URL list of any domain instantly — useful for SEO audits, web crawling, content indexing, and AI workflows.
Package README MCP Servers
A collection of MCP servers for fetching READMEs from various package managers.
DevTools Debugger MCP
Exposes full Chrome DevTools Protocol debugging capabilities, including breakpoints, call stacks, and source maps.