agent: embedded MCP server (rmcp) with send/recv tools

This commit is contained in:
müde 2026-05-15 14:29:57 +02:00
parent d9fa9c564e
commit 65a10a3c2b
7 changed files with 545 additions and 1 deletions

View file

@ -5,7 +5,7 @@ use std::time::Duration;
use anyhow::{Result, bail};
use clap::{Parser, Subcommand};
use hive_ag3nt::login::{self, LoginState};
use hive_ag3nt::{DEFAULT_SOCKET, DEFAULT_WEB_PORT, client, web_ui};
use hive_ag3nt::{DEFAULT_SOCKET, DEFAULT_WEB_PORT, client, mcp, web_ui};
use hive_sh4re::{AgentRequest, AgentResponse};
use tokio::process::Command;
@ -33,6 +33,10 @@ enum Cmd {
Send { to: String, body: String },
/// Pop one message from the inbox.
Recv,
/// Run the agent's MCP server on stdio. Spawned by `claude` via
/// `--mcp-config`; tools dispatch through `/run/hive/mcp.sock` back into
/// the hyperhive broker.
Mcp,
}
#[tokio::main]
@ -88,6 +92,7 @@ async fn main() -> Result<()> {
render(&resp)?;
check(&resp)
}
Cmd::Mcp => mcp::serve_stdio(cli.socket).await,
}
}