Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
103 changes: 76 additions & 27 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,7 @@ dirs = "5.0"
# - server: MCP server implementation
# - macros: #[tool] and #[tool_router] derive macros
# - transport-streamable-http-server: HTTP transport with SSE streaming
rmcp = { version = "0.8", features = ["server", "macros", "transport-streamable-http-server"] }
rmcp = { version = "2", features = ["server", "macros", "transport-streamable-http-server"] }

# schemars: JSON Schema generation. Used by rmcp for tool parameter schemas.
schemars = "1.0"
8 changes: 8 additions & 0 deletions crates/hone-cli/src/cli.rs
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,14 @@ pub enum Commands {
/// Example: --mcp-port 3001
#[arg(long)]
mcp_port: Option<u16>,

/// Additional Host header values the MCP server accepts (comma-separated)
///
/// The MCP server only accepts loopback hosts by default to block DNS
/// rebinding attacks. For LAN access, list the hostnames or host:port
/// authorities clients will use. Example: --mcp-allowed-hosts pi-hostname
#[arg(long, value_delimiter = ',')]
mcp_allowed_hosts: Vec<String>,
},

/// Show dashboard summary
Expand Down
6 changes: 5 additions & 1 deletion crates/hone-cli/src/commands/serve.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ pub async fn cmd_serve(
no_encrypt: bool,
static_dir: Option<&Path>,
mcp_port: Option<u16>,
mcp_allowed_hosts: Vec<String>,
) -> Result<()> {
println!("🚀 Starting Hone web server...");
println!(" Database: {}", db_path.display());
Expand Down Expand Up @@ -121,8 +122,11 @@ pub async fn cmd_serve(
if let Some(mcp) = mcp_port {
let mcp_db = db.clone();
let mcp_host = host.to_string();
let mcp_hosts = mcp_allowed_hosts.clone();
tokio::spawn(async move {
if let Err(e) = hone_server::mcp::start_mcp_server(mcp_db, &mcp_host, mcp).await {
if let Err(e) =
hone_server::mcp::start_mcp_server(mcp_db, &mcp_host, mcp, &mcp_hosts).await
{
eprintln!("MCP server error: {}", e);
}
});
Expand Down
2 changes: 2 additions & 0 deletions crates/hone-cli/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ async fn main() -> Result<()> {
no_auth,
static_dir,
mcp_port,
mcp_allowed_hosts,
} => {
commands::cmd_serve(
&cli.db,
Expand All @@ -73,6 +74,7 @@ async fn main() -> Result<()> {
cli.no_encrypt,
static_dir.as_deref(),
mcp_port,
mcp_allowed_hosts,
)
.await
}
Expand Down
Loading
Loading