From 6c56231003b8cf10aca49f507bead8861214bfce Mon Sep 17 00:00:00 2001 From: Michael Netshipise Date: Wed, 28 Jan 2026 17:19:14 +0200 Subject: [PATCH] Use workspace version, add clap CLI to MCP server - Define version in workspace.package, inherit in all crates - Rename MCP binary from sqlx-record-expert to sqlx-record-mcp - Add clap for --version and --help support Co-Authored-By: Claude Opus 4.5 --- Cargo.toml | 6 +++++- mcp/Cargo.toml | 7 ++++--- mcp/src/main.rs | 8 ++++++++ sqlx-record-ctl/Cargo.toml | 4 ++-- sqlx-record-derive/Cargo.toml | 4 ++-- 5 files changed, 21 insertions(+), 8 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 836a3ae..68d6d40 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,8 +1,12 @@ [package] name = "sqlx-record" +version.workspace = true +edition.workspace = true +description = "Entity CRUD and change tracking for SQL databases with SQLx" + +[workspace.package] version = "0.3.0" edition = "2021" -description = "Entity CRUD and change tracking for SQL databases with SQLx" [dependencies] sqlx-record-derive = { path = "sqlx-record-derive", optional = true } diff --git a/mcp/Cargo.toml b/mcp/Cargo.toml index 8722317..042f4b0 100644 --- a/mcp/Cargo.toml +++ b/mcp/Cargo.toml @@ -1,14 +1,15 @@ [package] name = "sqlx-record-mcp" -version = "0.3.0" -edition = "2021" +version.workspace = true +edition.workspace = true description = "MCP server providing sqlx-record documentation and code generation" [[bin]] -name = "sqlx-record-expert" +name = "sqlx-record-mcp" path = "src/main.rs" [dependencies] +clap = { version = "4", features = ["derive"] } serde = { version = "1.0", features = ["derive"] } serde_json = "1.0" tokio = { version = "1", features = ["full"] } diff --git a/mcp/src/main.rs b/mcp/src/main.rs index 124845b..96af3a9 100644 --- a/mcp/src/main.rs +++ b/mcp/src/main.rs @@ -1,7 +1,13 @@ +use clap::Parser; use serde::{Deserialize, Serialize}; use serde_json::{json, Value}; use std::io::{self, BufRead, Write}; +#[derive(Parser)] +#[command(name = "sqlx-record-mcp")] +#[command(version, about = "MCP server for sqlx-record documentation and code generation")] +struct Args {} + // ============================================================================ // MCP Protocol Types // ============================================================================ @@ -1950,6 +1956,8 @@ fn handle_read_resource(params: &Value) -> Value { // ============================================================================ fn main() { + let _args = Args::parse(); + let stdin = io::stdin(); let mut stdout = io::stdout(); diff --git a/sqlx-record-ctl/Cargo.toml b/sqlx-record-ctl/Cargo.toml index 35cf7db..a98adc8 100644 --- a/sqlx-record-ctl/Cargo.toml +++ b/sqlx-record-ctl/Cargo.toml @@ -1,7 +1,7 @@ [package] name = "sqlx-record-ctl" -version = "0.3.0" -edition = "2021" +version.workspace = true +edition.workspace = true description = "CLI tool for managing sqlx-record audit tables" [dependencies] diff --git a/sqlx-record-derive/Cargo.toml b/sqlx-record-derive/Cargo.toml index 2cb897f..fd03f6a 100644 --- a/sqlx-record-derive/Cargo.toml +++ b/sqlx-record-derive/Cargo.toml @@ -1,7 +1,7 @@ [package] name = "sqlx-record-derive" -version = "0.3.0" -edition = "2021" +version.workspace = true +edition.workspace = true description = "Derive macros for sqlx-record" [dependencies]