proactive-agent-mcp
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@proactive-agent-mcpPoll the event queue for unhandled high-severity alerts and summarize them."
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
Proactive Agent MCP Server (proactive-agent-mcp)
A production-grade Model Context Protocol (MCP) server built in Python, designed to equip autonomous AI agents (OpenClaw, Claude Desktop, Cursor) with proactive task execution, automated document compliance evaluation, semantic RAG retrieval, and strict Human-in-the-Loop (HITL) safety guardrails.
๐๏ธ Architecture Overview
Unlike passive chatbots that only respond to manual user queries, proactive-agent-mcp enables autonomous agents to actively poll ingestion queues, evaluate incoming documents, consult internal knowledge bases, and triage operations independently while enforcing cost caps and cryptographic approval gates.
+------------------------------------------+
| Frontier LLM / Agent Orchestrator |
| (OpenClaw / Claude / Gemini) |
+--------------------+---------------------+
|
| JSON-RPC 2.0 (stdio / SSE)
v
+--------------------------------------------------------------------------------+
| proactive-agent-mcp Server |
| |
| [Tools Engine] |
| * poll_event_queue --> Autonomous event bus polling & dispatch |
| * evaluate_document_compliance--> Schema validation & regex confidence score |
| * query_rag_knowledge --> Dense vector search (<7ms latency) |
| * request_human_approval --> HMAC-signed approval tickets (HITL) |
| * verify_approval_token --> Action execution authorization gate |
| * track_cost_budget --> Real-time multi-model spend guardrails |
| |
| [Resources] [Prompts] [Daemon Resilience] |
| * system://health * autonomous_triage * systemd service unit |
| * compliance://standards * compliance_audit * journald logging |
+--------------------------------------------------------------------------------+Related MCP server: cortex
โจ Key Features
1. Proactive Event Discovery & Autonomous Triage
Agents don't wait to be prompted. With
poll_event_queue, background agents independently identify unhandled document intake drops, infrastructure policy drifts, and system alerts.State-managed event claiming prevents duplicate processing across distributed agent instances.
2. Document Compliance & Policy Auditing
Validates extracted document payloads against strict organizational schemas (
asset_handover,it_security_audit).Computes deterministic confidence scores (0.0 to 1.0), isolates missing mandatory fields, and flags regex pattern anomalies before routing to human queues.
3. Grounded Semantic Retrieval (RAG)
Built-in semantic retrieval pipeline designed alongside DocuMind AI.
Returns similarity-scored chunks with source citations and metadata to eliminate model hallucination.
4. Human-in-the-Loop (HITL) Security Gates
Autonomous agents should never execute destructive mutations unchecked.
The
request_human_approvaltool generates cryptographically secured HMAC tickets for high-stakes operations (e.g. system wipes, policy overrides). Execution is halted untilverify_approval_tokenreceives valid supervisor authorization.
5. Multi-Model Token & Spend Guardrails
Real-time token consumption tracking across providers: Claude 3.5 Sonnet, GPT-4o, Gemini 1.5, and local Ollama instances.
Automatically halts execution with
HALT_BUDGET_EXCEEDEDif a session breaches configured financial limits.
6. Unattended Daemonization & Production Resilience
Ships with production-ready
systemdservice units featuring auto-restart policies (Restart=always, exponential backoff) and non-root execution sandbox.Fully compatible with 24/7 background operation on AWS EC2, VPS, or local Linux servers.
๐ ๏ธ MCP Tools Reference
Tool Name | Description | Key Parameters |
| Polls unhandled events requiring autonomous action. |
|
| Evaluates document payload against validation schemas. |
|
| Performs grounded vector search across enterprise knowledge bases. |
|
| Generates an HMAC-signed approval ticket for sensitive actions. |
|
| Validates supervisor confirmation code before execution. |
|
| Tracks token usage and enforces financial session budgets. |
|
๐ Quickstart
1. Installation
Clone the repository and install dependencies:
git clone https://github.com/MishaelOliva/proactive-agent-mcp.git
cd proactive-agent-mcp
pip install -e .2. Run Locally via stdio
python -m proactive_agent_mcp.server3. Run the Interactive Client Demo
python examples/run_client_demo.py๐ Client Configurations
Claude Desktop Integration
Add the following to your claude_desktop_config.json:
{
"mcpServers": {
"proactive-agent": {
"command": "python",
"args": ["-m", "proactive_agent_mcp.server"],
"env": {
"PYTHONUNBUFFERED": "1"
}
}
}
}OpenClaw Autonomous Agent Runtime
In your OpenClaw agent deployment configuration (agent_config.json):
{
"runtime": "openclaw-v2",
"agent_id": "proactive-ops-sentinel",
"heartbeat_interval_sec": 30,
"mcp_servers": [
{
"name": "proactive_agent_mcp",
"transport": "stdio",
"command": "python",
"args": ["-m", "proactive_agent_mcp.server"]
}
]
}๐ง Linux / AWS Production Deployment (systemd)
To keep the agent runtime operating unattended 24/7 across reboots and logouts:
Copy the service unit to systemd directory:
sudo cp deploy/systemd/proactive-agent-mcp.service /etc/systemd/system/
sudo systemctl daemon-reloadEnable and start the service:
sudo systemctl enable --now proactive-agent-mcp.serviceMonitor live execution logs:
journalctl -u proactive-agent-mcp.service -f๐งช Testing
The repository includes a comprehensive unit test suite validating JSON-RPC protocol compliance, tool execution, and security verification:
python -m unittest discover -s tests -vOutput:
test_initialize_handshake ... ok
test_ping ... ok
test_tools_list ... ok
test_poll_event_queue ... ok
test_compliance_valid_payload ... ok
test_approval_workflow ... ok
test_track_cost_budget ... ok
----------------------------------------------------------------------
Ran 14 tests in 0.070s - OK (100% Passing)๐ฏ Defending This Project in Technical Interviews
Why build an MCP server instead of a REST API? "MCP (Model Context Protocol) is the emerging standard for connecting AI agents to external tools. Unlike REST APIs that require custom integration code for every agent runtime, an MCP server is instantly compatible with Claude Desktop, OpenClaw, Cursor, and any MCP-compliant orchestrator via a single JSON-RPC 2.0 transport. This means one implementation serves every frontier LLM agent without adapter code."
Why enforce Human-in-the-Loop (HITL) for autonomous agents? "Autonomous agents executing destructive mutations (system wipes, policy overrides, budget-exceeding operations) without human oversight is a real production safety risk. The HITL gate generates cryptographically signed HMAC approval tickets that require explicit supervisor confirmation before execution proceeds. This mirrors enterprise change-management workflows while keeping the agent autonomous for routine operations."
How does the cost budget guardrail work? "Every tool call that invokes an LLM provider (Claude, GPT-4o, Gemini, Ollama) reports its prompt and completion token counts to
track_cost_budget. The server maintains a running session total with per-model pricing rates and halts execution withHALT_BUDGET_EXCEEDEDif the session breaches configurable financial limits. This prevents runaway agent loops from accumulating unexpected API costs."How did you validate MCP protocol compliance? "The test suite validates the complete JSON-RPC 2.0 handshake lifecycle:
initializecapability negotiation,tools/listdiscovery, individual tool invocations with schema-validated inputs/outputs, andpingkeepalive. All 14 tests run in under 70ms, ensuring the server conforms to the MCP 2024-11-05 specification."
๐ค Author & Maintainer
Mishael Dioneda Oliva
GitHub: @MishaelOliva
LinkedIn: linkedin.com/in/mishael-oliva
Portfolio / Projects: DocuMind AI | Browser Engine
๐ License
This project is licensed under the MIT License.
This server cannot be deployed
Maintenance
Related MCP Connectors
Connect, monitor, and control AI agents โ tasks, approvals, schedules, and governance.
Hosted AI agents and workflows with app OAuth, human approval gates, and a run ledger.
Deterministic compliance and vertical knowledge bases for autonomous agents. Free 24hr trial.
Tenant-scoped control layer for agent-to-agent systems: governed routing, approvals, evidence.
Related MCP Servers
- AlicenseNot gradedqualityBmaintenanceEnables autonomous agents to manage tasks in a pull-based work queue with strategic goal alignment, real-time monitoring, and cross-project choreography.MIT
- AlicenseNot gradedqualityBmaintenanceAn MCP-native agentic platform orchestrating planner/executor/critic agents over hybrid RAG with three-tier memory, budget enforcement, safety guardrails, and full observability. It exposes all capabilities as MCP tools, enabling natural-language control of document ingestion, retrieval-augmented generation, and multi-step AI workflows.MIT
- AlicenseNot gradedqualityCmaintenanceEnables enterprise multi-agent decision workflows that expose 8+ MCP tools such as SQL query, web search, Python sandbox, RAG, file access, data cleaning, chart generation, and HTTP calls, orchestrated with LangGraph, streaming output, and human-in-the-loop approvals.MIT
- AlicenseNot gradedqualityCmaintenanceProvides durable queues, human-in-the-loop approval gates, and an audit trail for AI agent fleets, enabling blocking approval requests and reliable work handoffs.3 npmMIT