feat: add get_version MCP tool returning version and build hash

Agents can now call get_version to see what server version and commit
they're running against.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
dave
2026-04-13 13:50:37 +00:00
parent 05655847d8
commit ed2526ce41
2 changed files with 22 additions and 1 deletions
+11 -1
View File
@@ -837,6 +837,14 @@ fn handle_tools_list(id: Option<Value>) -> JsonRpcResponse {
}
}
},
{
"name": "get_version",
"description": "Return the server version and build hash.",
"inputSchema": {
"type": "object",
"properties": {}
}
},
{
"name": "rebuild_and_restart",
"description": "Rebuild the server binary from source and re-exec with the new binary. Gracefully stops all running agents before restart. If the build fails, the server stays up and returns the build error.",
@@ -1266,6 +1274,7 @@ async fn handle_tools_call(
"get_pipeline_status" => story_tools::tool_get_pipeline_status(ctx),
// Diagnostics
"get_server_logs" => diagnostics::tool_get_server_logs(&args),
"get_version" => diagnostics::tool_get_version(),
// Server lifecycle
"rebuild_and_restart" => diagnostics::tool_rebuild_and_restart(ctx).await,
// Permission bridge (Claude Code → frontend dialog)
@@ -1423,7 +1432,8 @@ mod tests {
assert!(names.contains(&"status"));
assert!(names.contains(&"loc_file"));
assert!(names.contains(&"dump_crdt"));
assert_eq!(tools.len(), 62);
assert!(names.contains(&"get_version"));
assert_eq!(tools.len(), 63);
}
#[test]