cline-hermes-bridge
Enables Hermes Agent to monitor, analyze, and control Cline CLI workers by exposing Cline session history as read-only resources and providing tools to list sessions, start or resume tasks, check runtime status, and stop processes.
This server does not currently have a deployable release on Glama. Follow the repository's setup instructions to install and configure it for your MCP client, including any required credentials and local dependencies.
cline-hermes-bridge
An MCP (Model Context Protocol) server that exposes Cline session history as read-only resources and provides asynchronous process-control tools for Hermes Agent to monitor, analyze, and control Cline CLI workers.
Table of Contents
Related MCP server: tmux-agent
Architecture
[Hermes Agent]
│
▼ (JSON-RPC 2.0 over stdio)
[cline-hermes-bridge MCP Server]
│
├─► Reads Cline session JSON files from local history
├─► Spawns / monitors / kills `cline` CLI subprocesses
└─► Returns structured JSON through MCP stdio transportThe bridge operates as a pure stdio MCP server. It reads Cline session history from the
file system and spawns Cline CLI processes via asyncio.subprocess, keeping the MCP
communication channel entirely non-blocking.
Installation
Prerequisites
Python 3.10+
Node.js and the global
clineCLI packageInstall with:
npm install -g @anthropic/cline
Setup
cd cline-hermes-bridge
python3 -m venv .venv
source .venv/bin/activate # On Windows: .venv\Scripts\activate
pip install -r requirements.txtCline CLI Path Configuration
The server auto-detects the host operating system and resolves Cline CLI's session history directory:
OS | Session Directory |
macOS |
|
Windows |
|
Linux |
|
Override: If your Cline CLI install uses a non-default sessions directory, set the environment variable
CLINE_HISTORY_DIRto point to the correct path. The server will use that value instead of the auto-detected path.
Each session directory contains two files:
<session_id>.json— session metadata (prompt, status, PID, etc.)<session_id>.messages.json— full chat log with all messages
Running the Server
python server.pyThe server communicates via stdin/stdout using JSON-RPC 2.0. It will keep running until killed (Ctrl+C).
Docker (optional)
docker build -t cline-hermes-bridge .
docker run -i --rm cline-hermes-bridgeMCP Resources (Read-Only Monitoring)
cline://sessions
Returns a JSON array of all available sessions:
[
{
"session_id": "a1b2c3d4-...",
"initial_task": "Refactor the auth module...",
"created_at": "2025-01-15T10:30:00+00:00",
"status": "completed",
"interactive": true,
"pid": 12345
}
]cline://sessions/{session_id}/chat
Returns the full message history for a specific session:
{
"session_id": "a1b2c3d4-...",
"messages": [
{
"role": "user",
"text": "Refactor the auth module..."
},
{
"role": "assistant",
"text": "I'll refactor the auth module..."
}
]
}cline://agent/status
Returns the aggregate status of all tracked Cline CLI processes:
{
"status": "RUNNING",
"active_processes": 2,
"pids": [51944, 52001]
}MCP Tools (Process Control)
list_cline_sessions
Description: Lists all Cline CLI sessions sorted by newest first.
// Input
{}
// Output
[
{
"session_id": "session_1794143655625_7idx7",
"initial_task": "Fix the Cline CLI integration...",
"created_at": "2026-11-08T13:14:15.681Z",
"status": "running",
"interactive": true,
"pid": 51944
}
]command_cline_agent
Description: Start a new Cline CLI task or resume an existing one.
Parameters:
Name | Type | Required | Description |
| string | Yes | The prompt/instructions to pass to Cline. |
| string | No | Session ID to resume. If provided, continues that session. |
// New session
{ "prompt": "Refactor the auth module" }
// Resume session
{ "prompt": "Continue the refactoring", "resume_session_id": "session_1794143655625_7idx7" }The server uses cline --id <sid> "prompt" to resume and cline "prompt" for new sessions.
Output:
{
"pid": 51944,
"status": "spawning",
"prompt_length": 42
}get_agent_runtime_status
Description: Checks whether a specific Cline CLI task is active, stalled, or finished.
Parameters:
Name | Type | Required | Description |
| integer | Yes | Process ID returned by |
// Input
{ "pid": 12345 }
// Output
{
"pid": 12345,
"alive": true,
"started_at": "2026-11-08T13:14:15.681Z",
"runtime_seconds": 15.3,
"stdout_excerpt": "...",
"stderr_excerpt": "...",
"return_code": null
}stop_cline_agent
Description: Forcefully terminates a running Cline subprocess. Sends SIGTERM and
escalates to SIGKILL after 0.5s if the process does not respond.
Parameters:
Name | Type | Required | Description |
| integer | Yes | The process ID to terminate. |
// Input
{ "pid": 12345 }
// Output
{
"pid": 12345,
"killed": true,
"status": "terminated"
}Hermes Agent Integration
There are two supported ways to embed this MCP server in Hermes Agent configuration.
Option A: config.yaml (preferred)
Edit ~/.hermes/config.yaml:
cline-hermes-bridge:
command: python
args:
- /path/to/cline-hermes-bridge/server.py
env: {}
disabled: false
timeout: 300Option B: Environment Variable for Custom History Path
export CLINE_HISTORY_DIR="/custom/path/to/cline/history"Or inline:
CLINE_HISTORY_DIR="/custom/path" python server.pyError Handling
The server gracefully handles the following edge cases:
Scenario | Behavior |
| Returns |
Corrupted / unreadable JSON | Skips the file, logs silently. |
| Returns a structured JSON error from |
Process not tracked by | Returns |
Kill command fails | Returns |
All errors are returned as structured JSON inside the MCP TextContent envelope.
Contributing
Fork the repository
Create a feature branch:
git checkout -b feat/my-featureCommit your changes:
git commit -m 'feat: add my feature'Push:
git push origin feat/my-featureOpen a Pull Request
License
This project is licensed under the MIT License.
This server cannot be deployed
Maintenance
Related MCP Connectors
Start and manage Reason cloud coding agents, projects and sessions from any MCP client.
Hosted MCP memory and agent control plane for durable conversations, jobs, and operations.
Query, browse, and automate OmegaAI workspaces from any MCP client. Streamable HTTP with OAuth 2.0.
Hosted runtime for persistent agent teams, durable workflows, memory, schedules, and goals.
Related MCP Servers
- AlicenseNot gradedqualityCmaintenanceEnables MCP clients to observe a remote Hermes deployment's agents, sessions, crons, skills, and tools, and to run one-shot remote agent chats via a chat tool.1MIT
- AlicenseNot gradedqualityCmaintenanceEnables agents to spawn, monitor, and control CLI coding agents running in isolated tmux sessions, with verified input injection, redacted pane capture, fleet and per-session state classification, lineage tracking, blocking exec with exit codes, cross-agent messaging, waste analytics, and log/ledger reading. Ownership checks, policy controls, and audit events keep every control action safe by default.6 npmApache 2.0
- AlicenseNot gradedqualityCmaintenanceEnables a remote AI agent to delegate synchronous or asynchronous tasks to a self-hosted Hermes agent over MCP Streamable HTTP, follow run status, retrieve durable results, and inspect artifacts.MIT
- AlicenseBqualityCmaintenanceEnables MCP clients to observe and control a running Herdr session by inspecting panes, agents, layouts, and live lifecycle events, and by prompting agents, waiting for completion, running commands, and managing workspaces, tabs, panes, and worktrees.411MIT