mcpField
A
agent-loop-mcp

agent-loop-mcp

Local
github.com/meharajMMemory & Knowledge0Updated 15w ago

About agent-loop-mcp

agent-loop-mcp combines an MCP server for persistent state management with an Agent Skill for orchestration in long-running workflows. It monitors word counts to trigger compaction and applies a recovery strategy after failures.

Key features

  1. 01Persistent state management
  2. 02Word-count-based compaction triggers
  3. 03Failure recovery strategy
  4. 04Agent Skill for orchestration

Use cases

  1. 01Maintain state across long-running agent workflows
  2. 02Compact context when word counts reach a threshold
  3. 03Recover an agent workflow after failures

MCP support

The MCP server manages agent state and is configured as a local server using npx. The project also requires installing its Agent Skill for orchestration.

Configuration

Local server config is the same for every client. Copy it into your client’s MCP config file.

mcp.json · Universal config
{
"mcpServers": {
"meharajm-agent-loop": {
"command": "npx",
"args": [
"-y",
"@mhrj/mcp-agent-loop"
]
}
}
}
Run commandnpx -y @mhrj/mcp-agent-loop

Local servers need a runtime on your machine (e.g. Node.js 18+). Config file locations differ by client; see your client’s docs.

Packages
npm@mhrj/mcp-agent-loop1.0.3

Tools

6

Saved tool list · updated 2w ago

ParameterTypeRequiredDescription
objectivestringYesThe overarching objective for the agent to achieve
session_idstringYesA unique identifier for this loop session

Details

From the project README

Agentic Loop Memory Server ♾️

Agent Skills skills.sh

The industry-standard persistent memory and state manager for long-running agentic workflows.

Enable any AI model—especially smaller ones with limited context windows—to function with the persistence of high-end models. This project works as a two-part ecosystem: an MCP Server for state management and an Agent Skill for orchestration.

🛠 Complete Setup (Required)

For the best experience, you must install both the orchestration skill and the MCP server.

1. Install the Skill

Install the agentic-loop skill into your AI agent (Codex, Claude Code, Cursor, Gemini CLI, GitHub Copilot, and other Agent Skills hosts):

npx skills add meharajM/agent-loop-mcp@agentic-loop -g -y

Preview the skill before activation:

gh skill preview meharajM/agent-loop-mcp agentic-loop
2. Configure the MCP Server

Add the following to your `mcp_config.json`:

{
  "mcpServers": {
    "agent-loop": {
      "command": "npx",
      "args": ["-y", "@mhrj/mcp-agent-loop"]
    }
  }
}

🌟 Why this approach is unique

Unlike passive memory tools, this is an Active State Manager. It monitors word counts to trigger compaction cycles and enforces a "Self-Healing Strategy" on every failure, preventing AI agents from getting stuck in mindless loops.

📂 Project Structure

  • src/: TypeScript source for the MCP server.
  • skills/agentic-loop/SKILL.md: The instruction manual for the AI.
  • build/: JavaScript artifacts.

📄 License

ISC

Comments

Markdown supported

New to MCP?

From what the protocol is to installing your first server, these answers cover most first questions.

An open protocol that defines how AI applications connect to external tools and data in a uniform way. Clients talk to the model; MCP servers provide tools, resources and prompt templates. They exchange standard messages, so one server can be reused by many clients.