From 222fa64db605393cc1f564cc3774a6206f470d3c Mon Sep 17 00:00:00 2001 From: lukasl-dev Date: Sat, 27 Dec 2025 23:27:11 +0100 Subject: [PATCH 1/8] Add nixos_options_search tool --- src/handler.rs | 1 + src/main.rs | 2 ++ src/nixos.rs | 65 ++++++++++++++++++++++++++++++++++++++++++++++ src/tools.rs | 70 ++++++++++++++++++++++++++++++++++++++++++++++++++ 4 files changed, 138 insertions(+) create mode 100644 src/nixos.rs diff --git a/src/handler.rs b/src/handler.rs index c2ba263..25de981 100644 --- a/src/handler.rs +++ b/src/handler.rs @@ -51,6 +51,7 @@ impl ServerHandler for RimeServerHandler { RimeTools::NvfOptionsSearchTool(tool) => tool.call_tool(), RimeTools::NvfManualListTool(tool) => tool.call_tool(), RimeTools::NvfManualReadTool(tool) => tool.call_tool(), + RimeTools::NixOSOptionsSearchTool(tool) => tool.call_tool(), } } } diff --git a/src/main.rs b/src/main.rs index 064ce41..c056948 100644 --- a/src/main.rs +++ b/src/main.rs @@ -1,6 +1,7 @@ mod handler; mod home_manager; mod nvf; +mod nixos; mod tools; use clap::{Parser, Subcommand}; @@ -70,6 +71,7 @@ fn server_details() -> InitializeResult { "Rime provides MCP tools for Nix/NixOS workflows.\n\ Use nix_evaluate, nix_log, nix_packages_search, and nix_packages_why_depends for local nix.\n\ Use nix_manual_* and nixos_wiki_* for documentation lookups.\n\ +Use nixos_options_search to search for NixOS options in nixpkgs for a specific ref.\n\ Use home_manager_options_search to query Home Manager options.\n\ Use nvf_options_search to search for nvf (Neovim Flake) options.\n\ Use nvf_manual_* for nvf documentation lookups.\n\ diff --git a/src/nixos.rs b/src/nixos.rs new file mode 100644 index 0000000..5d0a8e4 --- /dev/null +++ b/src/nixos.rs @@ -0,0 +1,65 @@ +use serde::Deserialize; +use std::io::Error; +use std::process::Command; + +#[derive(Debug, Deserialize)] +pub(crate) struct NixosOption { + pub(crate) name: String, + pub(crate) description: String, + #[serde(rename = "type")] + pub(crate) r#type: String, + pub(crate) default: String, +} + +pub(crate) fn search_nixos_options(query: &str, ref_name: &str) -> Result, Error> { + let expression = format!( + r#" +let + nixpkgs = builtins.getFlake "github:NixOS/nixpkgs/{}"; + pkgs = import nixpkgs {{}}; + eval = import "${{nixpkgs}}/nixos/lib/eval-config.nix" {{ + inherit pkgs; + modules = []; + }}; + optionsList = pkgs.lib.optionAttrSetToDocList eval.options; + query = "{}"; + results = builtins.filter (opt: pkgs.lib.hasInfix query opt.name) optionsList; +in + builtins.map (opt: {{ + name = opt.name; + description = if opt ? description then (if builtins.isAttrs opt.description && opt.description ? text then opt.description.text else if builtins.isString opt.description then opt.description else "") else ""; + type = if opt ? type then (if builtins.isString opt.type then opt.type else if builtins.isAttrs opt.type && opt.type ? description then opt.type.description else "") else ""; + default = if opt ? default then (if builtins.isAttrs opt.default && opt.default ? text then opt.default.text else builtins.toJSON opt.default) else ""; + }}) (pkgs.lib.take 20 results) +"#, + ref_name, query + ); + + let output = Command::new("nix") + .args([ + "--extra-experimental-features", + "nix-command flakes", + "eval", + "--json", + "--impure", + "--expr", + &expression, + ]) + .output()?; + + if !output.status.success() { + let stderr = String::from_utf8_lossy(&output.stderr).to_string(); + return Err(Error::other(format!( + "nix eval for nixos options failed: {}", + stderr + ))); + } + + let stdout = String::from_utf8(output.stdout) + .map_err(|e| Error::other(format!("failed to read nix output: {}", e)))?; + + let options: Vec = serde_json::from_str(&stdout) + .map_err(|e| Error::other(format!("failed to parse nix output: {}", e)))?; + + Ok(options) +} diff --git a/src/tools.rs b/src/tools.rs index f858fcf..a0e26dd 100644 --- a/src/tools.rs +++ b/src/tools.rs @@ -10,6 +10,7 @@ use rust_mcp_sdk::{ use crate::home_manager::search_home_manager_options; use crate::nvf::{list_nvf_manual, read_nvf_manual, search_nvf_options}; +use crate::nixos::search_nixos_options; const NIXOS_API_BASE: &str = "https://search.nixos.org/backend"; const AUTH_BASIC_B64: &str = "Basic YVdWU0FMWHBadjpYOGdQSG56TDUyd0ZFZWt1eHNmUTljU2g="; @@ -805,9 +806,78 @@ tool_box!( NvfOptionsSearchTool, NvfManualListTool, NvfManualReadTool, + NixOSOptionsSearchTool, ] ); +#[derive(Debug, ::serde::Deserialize, ::serde::Serialize, JsonSchema)] +#[mcp_tool( + name = "nixos_options_search", + description = "Search for NixOS options in nixpkgs for a specific ref." +)] +pub struct NixOSOptionsSearchTool { + /// The query to search for in the NixOS options. + /// + /// Examples: "boot.loader.grub", "services.xserver", etc. + query: String, + + /// The nixpkgs ref to search in. + /// + /// Examples: "nixos-unstable", "nixos-24.11", "master", or a commit hash. + #[serde(default = "default_nixpkgs_ref")] + ref_name: String, +} + +fn default_nixpkgs_ref() -> String { + "nixos-unstable".to_string() +} + +impl NixOSOptionsSearchTool { + pub fn call_tool(&self) -> Result { + let options = search_nixos_options(self.query.as_str(), self.ref_name.as_str()) + .map_err(CallToolError::new)?; + + if options.is_empty() { + let message = format!( + "no NixOS options found matching '{}' in nixpkgs ref '{}'", + self.query.trim(), + self.ref_name + ); + return Ok(CallToolResult::text_content(vec![TextContent::from( + message, + )])); + } + + let mut lines = Vec::new(); + lines.push(format!( + "found {} NixOS options matching '{}' in nixpkgs ref '{}':", + options.len(), + self.query.trim(), + self.ref_name + )); + lines.push(String::new()); + + for opt in options { + lines.push(format!("- {}", opt.name)); + if !opt.r#type.is_empty() { + lines.push(format!(" type: {}", opt.r#type)); + } + if !opt.default.is_empty() { + lines.push(format!(" default: {}", opt.default)); + } + if !opt.description.is_empty() { + lines.push(format!(" {}", opt.description.trim())); + } + lines.push(String::new()); + } + + let output = lines.join("\n").trim().to_string(); + Ok(CallToolResult::text_content(vec![TextContent::from( + output, + )])) + } +} + #[mcp_tool( name = "nvf_manual_list", description = "List Markdown files in the nvf manual source directory." From a65c5f111839c30cf9657b452ccbd570ffc9d6ae Mon Sep 17 00:00:00 2001 From: lukasl-dev Date: Sat, 3 Jan 2026 22:37:38 +0100 Subject: [PATCH 2/8] Update rust-mcp-sdk to 0.8.1 --- Cargo.lock | 353 +++++++------------------------------------------ Cargo.toml | 4 +- src/handler.rs | 14 +- src/main.rs | 26 ++-- 4 files changed, 79 insertions(+), 318 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 519afe0..e75a2ea 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -17,15 +17,6 @@ version = "2.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "320119579fcad9c21884f5c4861d16174d0e06250625266f50fe6898340abefa" -[[package]] -name = "aho-corasick" -version = "1.1.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8e60d3430d3a69478ad0993f19238d2df97c507009a52b3c10addcd7f6bcb916" -dependencies = [ - "memchr", -] - [[package]] name = "anstream" version = "0.6.20" @@ -76,12 +67,6 @@ dependencies = [ "windows-sys 0.60.2", ] -[[package]] -name = "arc-swap" -version = "1.7.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "69f7f8c3906b62b754cd5326047894316021dcfe5a194c8ea52bdd94934a3457" - [[package]] name = "async-trait" version = "0.1.89" @@ -105,29 +90,6 @@ version = "1.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c08606f8c3cbf4ce6ec8e28fb0014a2c086708fe954eaa885384a6165172e7e8" -[[package]] -name = "aws-lc-rs" -version = "1.13.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5c953fe1ba023e6b7730c0d4b031d06f267f23a46167dcbd40316644b10a17ba" -dependencies = [ - "aws-lc-sys", - "zeroize", -] - -[[package]] -name = "aws-lc-sys" -version = "0.30.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dbfd150b5dbdb988bcc8fb1fe787eb6b7ee6180ca24da683b61ea5405f3d43ff" -dependencies = [ - "bindgen", - "cc", - "cmake", - "dunce", - "fs_extra", -] - [[package]] name = "axum" version = "0.8.4" @@ -188,19 +150,13 @@ version = "0.7.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "495c05f60d6df0093e8fb6e74aa5846a0ad06abaf96d76166283720bf740f8ab" dependencies = [ - "arc-swap", "bytes", "fs-err", "http", "http-body", "hyper", "hyper-util", - "pin-project-lite", - "rustls", - "rustls-pemfile", - "rustls-pki-types", "tokio", - "tokio-rustls", "tower-service", ] @@ -225,29 +181,6 @@ version = "0.22.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "72b3254f16251a8381aa12e40e3c4d2f0199f8c6508fbecb9d91f575e0fbb8c6" -[[package]] -name = "bindgen" -version = "0.69.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "271383c67ccabffb7381723dea0672a673f292304fcb45c01cc648c7a8d58088" -dependencies = [ - "bitflags", - "cexpr", - "clang-sys", - "itertools", - "lazy_static", - "lazycell", - "log", - "prettyplease", - "proc-macro2", - "quote", - "regex", - "rustc-hash 1.1.0", - "shlex", - "syn", - "which", -] - [[package]] name = "bitflags" version = "2.9.2" @@ -272,20 +205,9 @@ version = "1.2.33" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3ee0f8803222ba5a7e2777dd72ca451868909b1ac410621b676adf07280e9b5f" dependencies = [ - "jobserver", - "libc", "shlex", ] -[[package]] -name = "cexpr" -version = "0.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6fac387a98bb7c37292057cffc56d62ecb629900026402633ae9160df93a8766" -dependencies = [ - "nom", -] - [[package]] name = "cfg-if" version = "1.0.1" @@ -298,17 +220,6 @@ version = "0.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "613afe47fcd5fac7ccf1db93babcb082c5994d996f20b8b159f2ad1658eb5724" -[[package]] -name = "clang-sys" -version = "1.8.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0b023947811758c97c59bf9d1c188fd619ad4718dcaa767947df1cadb14f39f4" -dependencies = [ - "glob", - "libc", - "libloading", -] - [[package]] name = "clap" version = "4.5.45" @@ -349,15 +260,6 @@ version = "0.7.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b94f61472cee1439c0b966b47e3aca9ae07e45d070759512cd390ea2bebc6675" -[[package]] -name = "cmake" -version = "0.1.54" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e7caa3f9de89ddbe2c607f4101924c5abec803763ae9534e4f4d7d8f84aa81f0" -dependencies = [ - "cc", -] - [[package]] name = "colorchoice" version = "1.0.4" @@ -431,34 +333,12 @@ dependencies = [ "litrs", ] -[[package]] -name = "dunce" -version = "1.0.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "92773504d58c093f6de2459af4af33faa518c13451eb8f2b5698ed3d36e7c813" - -[[package]] -name = "either" -version = "1.15.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "48c757948c5ede0e46177b7add2e67155f70e33c07fea8284df6576da70b3719" - [[package]] name = "equivalent" version = "1.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "877a4ace8713b0bcf2a4e7eec82529c029f1d0619886d18145fea96c3ffe5c0f" -[[package]] -name = "errno" -version = "0.3.13" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "778e2ac28f6c47af28e4907f13ffd1e1ddbd400980a9abd7c8df189bf578a5ad" -dependencies = [ - "libc", - "windows-sys 0.60.2", -] - [[package]] name = "flate2" version = "1.1.2" @@ -494,12 +374,6 @@ dependencies = [ "tokio", ] -[[package]] -name = "fs_extra" -version = "1.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "42703706b716c37f96a77aea830392ad231f44c9e9a67872fa5548707e11b11c" - [[package]] name = "futures" version = "0.3.31" @@ -622,12 +496,6 @@ version = "0.31.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "07e28edb80900c19c28f1072f2e8aeca7fa06b23cd4169cefe1af5aa3260783f" -[[package]] -name = "glob" -version = "0.3.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0cc23270f6e1808e30a928bdc84dea0b9b4136a8bc82338574f23baf47bbd280" - [[package]] name = "h2" version = "0.4.12" @@ -659,15 +527,6 @@ version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2304e00983f87ffb38b55b444b5e3b60a884b5d30c0fca7d82fe33449bbe55ea" -[[package]] -name = "home" -version = "0.5.11" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "589533453244b0995c858700322199b2becb13b627df2851f64a2775d024abcf" -dependencies = [ - "windows-sys 0.59.0", -] - [[package]] name = "http" version = "1.3.1" @@ -928,31 +787,12 @@ version = "1.70.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7943c866cc5cd64cbc25b2e01621d07fa8eb2a1a23160ee81ce38704e97b8ecf" -[[package]] -name = "itertools" -version = "0.12.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ba291022dbbd398a455acf126c1e341954079855bc60dfdda641363bd6922569" -dependencies = [ - "either", -] - [[package]] name = "itoa" version = "1.0.15" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4a5f13b858c8d314ee3e8f639011f7ccefe71f97f96e50151fb991f267928e2c" -[[package]] -name = "jobserver" -version = "0.1.33" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "38f262f097c174adebe41eb73d66ae9c06b2844fb0da69969647bbddd9b0538a" -dependencies = [ - "getrandom 0.3.3", - "libc", -] - [[package]] name = "js-sys" version = "0.3.77" @@ -963,40 +803,12 @@ dependencies = [ "wasm-bindgen", ] -[[package]] -name = "lazy_static" -version = "1.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bbd2bcb4c963f2ddae06a2efc7e9f3591312473c50c6685e1f298068316e66fe" - -[[package]] -name = "lazycell" -version = "1.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "830d08ce1d1d941e6b30645f1a0eb5643013d835ce3779a5fc208261dbe10f55" - [[package]] name = "libc" version = "0.2.175" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6a82ae493e598baaea5209805c49bbf2ea7de956d50d7da0da1164f9c6d28543" -[[package]] -name = "libloading" -version = "0.8.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "07033963ba89ebaf1584d767badaa2e8fcec21aedea6b8c0346d487d49c28667" -dependencies = [ - "cfg-if", - "windows-targets 0.53.3", -] - -[[package]] -name = "linux-raw-sys" -version = "0.4.15" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d26c52dbd32dccf2d10cac7725f8eae5296885fb5703b261f7d0a0739ec807ab" - [[package]] name = "litemap" version = "0.8.0" @@ -1059,12 +871,6 @@ dependencies = [ "unicase", ] -[[package]] -name = "minimal-lexical" -version = "0.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "68354c5c6bd36d73ff3feceb05efa59b6acb7626617f4962be322a825e61f79a" - [[package]] name = "miniz_oxide" version = "0.8.9" @@ -1085,22 +891,21 @@ dependencies = [ "windows-sys 0.59.0", ] -[[package]] -name = "nom" -version = "7.1.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d273983c5a657a70a3e8f2a01329822f3b8c8172b73826411a55751e404a0a4a" -dependencies = [ - "memchr", - "minimal-lexical", -] - [[package]] name = "num-conv" version = "0.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "51d515d32fb182ee37cda2ccdcb92950d6a3c2893aa280e540671c2cd0f3b1d9" +[[package]] +name = "num_threads" +version = "0.1.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5c7398b9c8b70908f6371f47ed36737907c87c52af34c268fed0bf0ceb92ead9" +dependencies = [ + "libc", +] + [[package]] name = "object" version = "0.36.7" @@ -1187,16 +992,6 @@ dependencies = [ "zerocopy", ] -[[package]] -name = "prettyplease" -version = "0.2.36" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ff24dfcda44452b9816fff4cd4227e1bb73ff5a2f1bc1105aa92fb8565ce44d2" -dependencies = [ - "proc-macro2", - "syn", -] - [[package]] name = "proc-macro2" version = "1.0.101" @@ -1233,7 +1028,7 @@ dependencies = [ "pin-project-lite", "quinn-proto", "quinn-udp", - "rustc-hash 2.1.1", + "rustc-hash", "rustls", "socket2 0.5.10", "thiserror", @@ -1253,7 +1048,7 @@ dependencies = [ "lru-slab", "rand", "ring", - "rustc-hash 2.1.1", + "rustc-hash", "rustls", "rustls-pki-types", "slab", @@ -1330,35 +1125,6 @@ dependencies = [ "bitflags", ] -[[package]] -name = "regex" -version = "1.11.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b544ef1b4eac5dc2db33ea63606ae9ffcfac26c1416a2806ae0bf5f56b201191" -dependencies = [ - "aho-corasick", - "memchr", - "regex-automata", - "regex-syntax", -] - -[[package]] -name = "regex-automata" -version = "0.4.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "809e8dc61f6de73b46c85f4c96486310fe304c434cfa43669d7b40f711150908" -dependencies = [ - "aho-corasick", - "memchr", - "regex-syntax", -] - -[[package]] -name = "regex-syntax" -version = "0.8.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2b15c43186be67a4fd63bee50d0303afffcef381492ebe2c5d87f324e1b8815c" - [[package]] name = "reqwest" version = "0.12.23" @@ -1433,9 +1199,9 @@ dependencies = [ [[package]] name = "rust-mcp-macros" -version = "0.5.1" +version = "0.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f2079014c2b3dfa82a2dafd203121d5a28929102c5e003bf8d8019a60fc17e0d" +checksum = "3ca08e51769637b29c365e88f67096acb29310c080775af9dd73a936c2b9ccb7" dependencies = [ "proc-macro2", "quote", @@ -1446,9 +1212,9 @@ dependencies = [ [[package]] name = "rust-mcp-schema" -version = "0.7.2" +version = "0.9.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a0e71aee61257cd3d4a78fdc10c92c29e7a55c4f767119ffdafd837bb5e5cb9a" +checksum = "cc4613aaaca2d63c45786ee28886c870a5bc4fe8a91846e4db632ef4ce2e48cb" dependencies = [ "serde", "serde_json", @@ -1456,14 +1222,19 @@ dependencies = [ [[package]] name = "rust-mcp-sdk" -version = "0.5.2" +version = "0.8.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4ec178f18084c71147fb114fd28391139a47d70df5a9009b6266224b45fed493" +checksum = "cc2e76d83baa6b323baa9cc1a6cbeb8430f1d1dbbe92c54b70244322572bc53d" dependencies = [ "async-trait", "axum", "axum-server", + "base64", + "bytes", "futures", + "http", + "http-body", + "http-body-util", "hyper", "rust-mcp-macros", "rust-mcp-schema", @@ -1471,6 +1242,7 @@ dependencies = [ "serde", "serde_json", "thiserror", + "time", "tokio", "tokio-stream", "tracing", @@ -1479,9 +1251,9 @@ dependencies = [ [[package]] name = "rust-mcp-transport" -version = "0.4.1" +version = "0.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6ffbd07441a82deab29dfd0f6a4e2d26ff03c9acaa9f14408fd473c93d53fdd0" +checksum = "cc5c1534d052a9ccb136539e4014645d6b3d77d8ab92ef5730cb7448c893d910" dependencies = [ "async-trait", "bytes", @@ -1502,38 +1274,18 @@ version = "0.1.26" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "56f7d92ca342cea22a06f2121d944b4fd82af56988c270852495420f961d4ace" -[[package]] -name = "rustc-hash" -version = "1.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "08d43f7aa6b08d49f382cde6a7982047c3426db949b1424bc4b7ec9ae12c6ce2" - [[package]] name = "rustc-hash" version = "2.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "357703d41365b4b27c590e3ed91eabb1b663f07c4c084095e60cbed4362dff0d" -[[package]] -name = "rustix" -version = "0.38.44" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fdb5bc1ae2baa591800df16c9ca78619bf65c0488b41b96ccec5d11220d8c154" -dependencies = [ - "bitflags", - "errno", - "libc", - "linux-raw-sys", - "windows-sys 0.59.0", -] - [[package]] name = "rustls" version = "0.23.31" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c0ebcbd2f03de0fc1122ad9bb24b127a5a6cd51d72604a3f3c50ac459762b6cc" dependencies = [ - "aws-lc-rs", "log", "once_cell", "ring", @@ -1543,15 +1295,6 @@ dependencies = [ "zeroize", ] -[[package]] -name = "rustls-pemfile" -version = "2.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dce314e5fee3f39953d46bb63bb8a46d40c2f8fb7cc5a3b6cab2bde9721d6e50" -dependencies = [ - "rustls-pki-types", -] - [[package]] name = "rustls-pki-types" version = "1.12.0" @@ -1568,7 +1311,6 @@ version = "0.103.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0a17884ae0c1b773f1ccd2bd4a8c72f16da897310a98b0e84bf349ad5ead92fc" dependencies = [ - "aws-lc-rs", "ring", "rustls-pki-types", "untrusted", @@ -1594,18 +1336,28 @@ checksum = "94143f37725109f92c262ed2cf5e59bce7498c01bcc1502d7b9afe439a4e9f49" [[package]] name = "serde" -version = "1.0.219" +version = "1.0.228" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9a8e94ea7f378bd32cbbd37198a4a91436180c5bb472411e48b5ec2e2124ae9e" +dependencies = [ + "serde_core", + "serde_derive", +] + +[[package]] +name = "serde_core" +version = "1.0.228" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5f0e2c6ed6606019b4e29e69dbaba95b11854410e5347d525002456dbbb786b6" +checksum = "41d385c7d4ca58e59fc732af25c3983b67ac852c1a25000afe1175de458b67ad" dependencies = [ "serde_derive", ] [[package]] name = "serde_derive" -version = "1.0.219" +version = "1.0.228" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5b0276cf7f2c73365f7157c8123c21cd9a50fbbd844757af28ca1f5925fc2a00" +checksum = "d540f220d3187173da220f885ab66608367b6574e925011a9353e4badda91d79" dependencies = [ "proc-macro2", "quote", @@ -1614,14 +1366,15 @@ dependencies = [ [[package]] name = "serde_json" -version = "1.0.142" +version = "1.0.148" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "030fedb782600dcbd6f02d479bf0d817ac3bb40d644745b769d6a96bc3afc5a7" +checksum = "3084b546a1dd6289475996f182a22aba973866ea8e8b02c51d9f46b1336a22da" dependencies = [ "itoa", "memchr", - "ryu", "serde", + "serde_core", + "zmij", ] [[package]] @@ -1770,7 +1523,9 @@ checksum = "8a7619e19bc266e0f9c5e6686659d394bc57973859340060a69221e57dbc0c40" dependencies = [ "deranged", "itoa", + "libc", "num-conv", + "num_threads", "powerfmt", "serde", "time-core", @@ -2187,18 +1942,6 @@ dependencies = [ "rustls-pki-types", ] -[[package]] -name = "which" -version = "4.4.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "87ba24419a2078cd2b0f2ede2691b6c66d8e47836da3b6db8265ebad47afbfc7" -dependencies = [ - "either", - "home", - "once_cell", - "rustix", -] - [[package]] name = "windows-link" version = "0.1.3" @@ -2479,3 +2222,9 @@ dependencies = [ "quote", "syn", ] + +[[package]] +name = "zmij" +version = "1.0.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4ee2a72b10d087f75fb2e1c2c7343e308fe6970527c22a41caf8372e165ff5c1" diff --git a/Cargo.toml b/Cargo.toml index 2bc1d5a..126b2a8 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -5,8 +5,8 @@ edition = "2024" [dependencies] async-trait = "0.1.89" -rust-mcp-macros = "0.5.1" -rust-mcp-sdk = "0.5.2" +rust-mcp-macros = "0.8.0" +rust-mcp-sdk = { version = "0.8.1", default-features = false, features = ["server", "macros", "stdio", "hyper-server", "streamable-http", "sse"] } serde = "1.0.219" serde_json = "1.0.142" tokio = "1.47.1" diff --git a/src/handler.rs b/src/handler.rs index 25de981..e794dbb 100644 --- a/src/handler.rs +++ b/src/handler.rs @@ -1,6 +1,8 @@ +use std::sync::Arc; + use async_trait::async_trait; use rust_mcp_sdk::schema::{ - CallToolRequest, CallToolResult, ListToolsRequest, ListToolsResult, RpcError, + CallToolRequestParams, CallToolResult, ListToolsResult, PaginatedRequestParams, RpcError, schema_utils::CallToolError, }; use rust_mcp_sdk::{McpServer, mcp_server::ServerHandler}; @@ -13,8 +15,8 @@ pub struct RimeServerHandler; impl ServerHandler for RimeServerHandler { async fn handle_list_tools_request( &self, - _request: ListToolsRequest, - _runtime: &dyn McpServer, + _request: Option, + _runtime: Arc, ) -> std::result::Result { Ok(ListToolsResult { meta: None, @@ -25,11 +27,11 @@ impl ServerHandler for RimeServerHandler { async fn handle_call_tool_request( &self, - request: CallToolRequest, - _runtime: &dyn McpServer, + params: CallToolRequestParams, + _runtime: Arc, ) -> std::result::Result { let tool_params: RimeTools = - RimeTools::try_from(request.params).map_err(CallToolError::new)?; + RimeTools::try_from(params).map_err(CallToolError::new)?; match tool_params { RimeTools::NixEvaluateTool(tool) => tool.call_tool(), diff --git a/src/main.rs b/src/main.rs index c056948..6794d8c 100644 --- a/src/main.rs +++ b/src/main.rs @@ -1,18 +1,19 @@ mod handler; mod home_manager; -mod nvf; mod nixos; +mod nvf; mod tools; use clap::{Parser, Subcommand}; use handler::RimeServerHandler; use rust_mcp_sdk::error::SdkResult; -use rust_mcp_sdk::mcp_server::{HyperServerOptions, ServerRuntime, hyper_server, server_runtime}; +use rust_mcp_sdk::mcp_server::{ + HyperServerOptions, McpServerOptions, hyper_server, server_runtime, +}; use rust_mcp_sdk::schema::{ - Implementation, InitializeResult, LATEST_PROTOCOL_VERSION, ServerCapabilities, - ServerCapabilitiesTools, + Implementation, InitializeResult, ServerCapabilities, ServerCapabilitiesTools, }; -use rust_mcp_sdk::{McpServer, StdioTransport, TransportOptions}; +use rust_mcp_sdk::{McpServer, StdioTransport, ToMcpServerHandler, TransportOptions}; #[derive(Parser, Debug)] #[command( @@ -61,6 +62,9 @@ fn server_details() -> InitializeResult { name: "rime".to_string(), version: env!("CARGO_PKG_VERSION").to_string(), title: Some("rime".to_string()), + description: Some("Rime MCP server".to_string()), + icons: vec![], + website_url: Some("https://github.com/lukasl-dev/rime".to_string()), }, capabilities: ServerCapabilities { tools: Some(ServerCapabilitiesTools { list_changed: None }), @@ -79,7 +83,7 @@ Note: When creating inline Lua functions in nvf, use lib.generators.mkLuaInline. Most tools shell out to nix; ensure it is on PATH." .to_string(), ), - protocol_version: LATEST_PROTOCOL_VERSION.to_string(), + protocol_version: "2025-11-25".to_string(), } } @@ -95,7 +99,13 @@ async fn main() -> SdkResult<()> { async fn run_stdio() -> SdkResult<()> { let transport = StdioTransport::new(TransportOptions::default())?; let handler = RimeServerHandler {}; - let server: ServerRuntime = server_runtime::create_server(server_details(), transport, handler); + let server = server_runtime::create_server(McpServerOptions { + server_details: server_details(), + transport, + handler: handler.to_mcp_server_handler(), + task_store: None, + client_task_store: None, + }); server.start().await } @@ -103,7 +113,7 @@ async fn run_http(args: HttpArgs) -> SdkResult<()> { let handler = RimeServerHandler {}; let server = hyper_server::create_server( server_details(), - handler, + handler.to_mcp_server_handler(), HyperServerOptions { host: args.host, port: args.port, From 4ccd2bdde1f559ddf6803bca22555e57256129fb Mon Sep 17 00:00:00 2001 From: lukasl-dev Date: Sat, 3 Jan 2026 22:44:53 +0100 Subject: [PATCH 3/8] Bump version to 0.2.0 --- Cargo.lock | 2 +- Cargo.toml | 2 +- Makefile | 9 +++++++++ 3 files changed, 11 insertions(+), 2 deletions(-) create mode 100644 Makefile diff --git a/Cargo.lock b/Cargo.lock index e75a2ea..23ab2c5 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1171,7 +1171,7 @@ dependencies = [ [[package]] name = "rime" -version = "0.1.0" +version = "0.2.0" dependencies = [ "async-trait", "clap", diff --git a/Cargo.toml b/Cargo.toml index 126b2a8..8c67e8c 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "rime" -version = "0.1.0" +version = "0.2.0" edition = "2024" [dependencies] diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..17dbae3 --- /dev/null +++ b/Makefile @@ -0,0 +1,9 @@ +.PHONY: bump + +bump: + @if [ -z "$(version)" ]; then echo "Usage: make bump version=X.Y.Z"; exit 1; fi + $(eval V := $(shell echo $(version) | sed 's/^v//')) + @echo "Bumping version to $(V)" + @echo $(V) > VERSION + @sed -i 's/^version = .*/version = "$(V)"/' Cargo.toml + @cargo update -p rime --precise $(V) 2>/dev/null || true From 0ff9ad793dd6d9446c9dde881adc2ba5b97fc6e9 Mon Sep 17 00:00:00 2001 From: lukasl-dev Date: Sat, 3 Jan 2026 22:56:11 +0100 Subject: [PATCH 4/8] Rename nixos_options_search to nixpkgs_options_search --- README.md | 28 +++++++++------- src/handler.rs | 2 +- src/main.rs | 4 +-- src/{nixos.rs => nixpkgs.rs} | 8 ++--- src/nvf.rs | 17 +++++----- src/tools.rs | 63 ++++++++++++++++++++++++++---------- 6 files changed, 79 insertions(+), 43 deletions(-) rename src/{nixos.rs => nixpkgs.rs} (88%) diff --git a/README.md b/README.md index 1c05b74..699778d 100644 --- a/README.md +++ b/README.md @@ -28,29 +28,35 @@ A minimal [Model Context Protocol (MCP)](https://modelcontextprotocol.io) server - `nix_config_show`: Run `nix config show`. - `nix_manual_list`: List Markdown files in the Nix manual. - `nix_manual_read`: Read a Markdown file from the Nix manual. -- `nixhub_package_versions`: Get version history for a package via [nixhub](https://nixhub.io). +- `nixpkgs_options_search`: Search for Nixpkgs options in nixpkgs for a specific ref.
-❄️ NixOS +🏠 Home Manager -- `nixos_wiki_search`: Search the NixOS wiki. -- `nixos_wiki_read`: Read a page from the NixOS wiki. -- `nixos_channels`: List available NixOS channels with their status. +- `home_manager_options_search`: Search Home Manager options.
-🏠 Home Manager +🌑 nvf -- `home_manager_options_search`: Search Home Manager options. +- `nvf_options_search`: Search [nvf](https://github.com/notashelf/nvf) options for a specific ref. +- `nvf_manual_list`: List files in the nvf manual for a specific ref. +- `nvf_manual_read`: Read a file from the nvf manual for a specific ref.
-🌑 nvf +📦 Nixhub + +- `nixhub_package_versions`: Get version history for a package via [nixhub](https://nixhub.io). +
+ +
+❄️ NixOS -- `nvf_options_search`: Search [nvf](https://github.com/notashelf/nvf) options. -- `nvf_manual_list`: List files in the nvf manual. -- `nvf_manual_read`: Read a file from the nvf manual. +- `nixos_wiki_search`: Search the NixOS wiki. +- `nixos_wiki_read`: Read a page from the NixOS wiki. +- `nixos_channels`: List available NixOS channels with their status.
diff --git a/src/handler.rs b/src/handler.rs index e794dbb..866da6d 100644 --- a/src/handler.rs +++ b/src/handler.rs @@ -53,7 +53,7 @@ impl ServerHandler for RimeServerHandler { RimeTools::NvfOptionsSearchTool(tool) => tool.call_tool(), RimeTools::NvfManualListTool(tool) => tool.call_tool(), RimeTools::NvfManualReadTool(tool) => tool.call_tool(), - RimeTools::NixOSOptionsSearchTool(tool) => tool.call_tool(), + RimeTools::NixpkgsOptionsSearchTool(tool) => tool.call_tool(), } } } diff --git a/src/main.rs b/src/main.rs index 6794d8c..57340ef 100644 --- a/src/main.rs +++ b/src/main.rs @@ -1,6 +1,6 @@ mod handler; mod home_manager; -mod nixos; +mod nixpkgs; mod nvf; mod tools; @@ -75,7 +75,7 @@ fn server_details() -> InitializeResult { "Rime provides MCP tools for Nix/NixOS workflows.\n\ Use nix_evaluate, nix_log, nix_packages_search, and nix_packages_why_depends for local nix.\n\ Use nix_manual_* and nixos_wiki_* for documentation lookups.\n\ -Use nixos_options_search to search for NixOS options in nixpkgs for a specific ref.\n\ +Use nixpkgs_options_search to search for Nixpkgs options in nixpkgs for a specific ref.\n\ Use home_manager_options_search to query Home Manager options.\n\ Use nvf_options_search to search for nvf (Neovim Flake) options.\n\ Use nvf_manual_* for nvf documentation lookups.\n\ diff --git a/src/nixos.rs b/src/nixpkgs.rs similarity index 88% rename from src/nixos.rs rename to src/nixpkgs.rs index 5d0a8e4..0d5b074 100644 --- a/src/nixos.rs +++ b/src/nixpkgs.rs @@ -3,7 +3,7 @@ use std::io::Error; use std::process::Command; #[derive(Debug, Deserialize)] -pub(crate) struct NixosOption { +pub(crate) struct NixpkgsOption { pub(crate) name: String, pub(crate) description: String, #[serde(rename = "type")] @@ -11,7 +11,7 @@ pub(crate) struct NixosOption { pub(crate) default: String, } -pub(crate) fn search_nixos_options(query: &str, ref_name: &str) -> Result, Error> { +pub(crate) fn search_nixpkgs_options(query: &str, ref_name: &str) -> Result, Error> { let expression = format!( r#" let @@ -50,7 +50,7 @@ in if !output.status.success() { let stderr = String::from_utf8_lossy(&output.stderr).to_string(); return Err(Error::other(format!( - "nix eval for nixos options failed: {}", + "nix eval for nixpkgs options failed: {}", stderr ))); } @@ -58,7 +58,7 @@ in let stdout = String::from_utf8(output.stdout) .map_err(|e| Error::other(format!("failed to read nix output: {}", e)))?; - let options: Vec = serde_json::from_str(&stdout) + let options: Vec = serde_json::from_str(&stdout) .map_err(|e| Error::other(format!("failed to parse nix output: {}", e)))?; Ok(options) diff --git a/src/nvf.rs b/src/nvf.rs index a1f4516..0ae4703 100644 --- a/src/nvf.rs +++ b/src/nvf.rs @@ -11,11 +11,11 @@ pub(crate) struct NvfOption { pub(crate) default: String, } -pub(crate) fn search_nvf_options(query: &str) -> Result, Error> { +pub(crate) fn search_nvf_options(query: &str, ref_name: &str) -> Result, Error> { let expression = format!( r#" let - flake = builtins.getFlake "github:NotAShelf/nvf"; + flake = builtins.getFlake "github:NotAShelf/nvf/{}"; pkgs = import {{}}; eval = flake.lib.neovimConfiguration {{ inherit pkgs; modules = []; }}; optionsList = pkgs.lib.optionAttrSetToDocList eval.options; @@ -29,7 +29,7 @@ in default = if opt ? default then (if builtins.isAttrs opt.default && opt.default ? text then opt.default.text else builtins.toJSON opt.default) else ""; }}) (pkgs.lib.take 20 results) "#, - query + ref_name, query ); let output = Command::new("nix") @@ -61,9 +61,9 @@ in Ok(options) } -pub(crate) fn list_nvf_manual() -> Result, Error> { - let tree_url = "https://api.github.com/repos/NotAShelf/nvf/git/trees/main?recursive=1"; - let tree_resp = ureq::get(tree_url) +pub(crate) fn list_nvf_manual(ref_name: &str) -> Result, Error> { + let tree_url = format!("https://api.github.com/repos/NotAShelf/nvf/git/trees/{}?recursive=1", ref_name); + let tree_resp = ureq::get(&tree_url) .set( "User-Agent", "rime/1.0 (+https://github.com/lukasl-dev/rime)", @@ -101,9 +101,10 @@ pub(crate) fn list_nvf_manual() -> Result, Error> { Ok(md_files) } -pub(crate) fn read_nvf_manual(path: &str) -> Result { +pub(crate) fn read_nvf_manual(path: &str, ref_name: &str) -> Result { let url = format!( - "https://raw.githubusercontent.com/NotAShelf/nvf/main/docs/manual/{}.md", + "https://raw.githubusercontent.com/NotAShelf/nvf/{}/docs/manual/{}.md", + ref_name, path ); diff --git a/src/tools.rs b/src/tools.rs index a0e26dd..fc74e1e 100644 --- a/src/tools.rs +++ b/src/tools.rs @@ -9,8 +9,8 @@ use rust_mcp_sdk::{ }; use crate::home_manager::search_home_manager_options; +use crate::nixpkgs::search_nixpkgs_options; use crate::nvf::{list_nvf_manual, read_nvf_manual, search_nvf_options}; -use crate::nixos::search_nixos_options; const NIXOS_API_BASE: &str = "https://search.nixos.org/backend"; const AUTH_BASIC_B64: &str = "Basic YVdWU0FMWHBadjpYOGdQSG56TDUyd0ZFZWt1eHNmUTljU2g="; @@ -806,17 +806,17 @@ tool_box!( NvfOptionsSearchTool, NvfManualListTool, NvfManualReadTool, - NixOSOptionsSearchTool, + NixpkgsOptionsSearchTool, ] ); #[derive(Debug, ::serde::Deserialize, ::serde::Serialize, JsonSchema)] #[mcp_tool( - name = "nixos_options_search", - description = "Search for NixOS options in nixpkgs for a specific ref." + name = "nixpkgs_options_search", + description = "Search for Nixpkgs options in nixpkgs for a specific ref." )] -pub struct NixOSOptionsSearchTool { - /// The query to search for in the NixOS options. +pub struct NixpkgsOptionsSearchTool { + /// The query to search for in the Nixpkgs options. /// /// Examples: "boot.loader.grub", "services.xserver", etc. query: String, @@ -832,14 +832,14 @@ fn default_nixpkgs_ref() -> String { "nixos-unstable".to_string() } -impl NixOSOptionsSearchTool { +impl NixpkgsOptionsSearchTool { pub fn call_tool(&self) -> Result { - let options = search_nixos_options(self.query.as_str(), self.ref_name.as_str()) + let options = search_nixpkgs_options(self.query.as_str(), self.ref_name.as_str()) .map_err(CallToolError::new)?; if options.is_empty() { let message = format!( - "no NixOS options found matching '{}' in nixpkgs ref '{}'", + "no nixpkgs options found matching '{}' in nixpkgs ref '{}'", self.query.trim(), self.ref_name ); @@ -850,7 +850,7 @@ impl NixOSOptionsSearchTool { let mut lines = Vec::new(); lines.push(format!( - "found {} NixOS options matching '{}' in nixpkgs ref '{}':", + "found {} nixpkgs options matching '{}' in nixpkgs ref '{}':", options.len(), self.query.trim(), self.ref_name @@ -883,11 +883,17 @@ impl NixOSOptionsSearchTool { description = "List Markdown files in the nvf manual source directory." )] #[derive(Debug, ::serde::Deserialize, ::serde::Serialize, JsonSchema)] -pub struct NvfManualListTool {} +pub struct NvfManualListTool { + /// The nvf ref to search in. + /// + /// Examples: "main", "v0.1.0", or a commit hash. + #[serde(default = "default_nvf_ref")] + ref_name: String, +} impl NvfManualListTool { pub fn call_tool(&self) -> Result { - let md_files = list_nvf_manual().map_err(CallToolError::new)?; + let md_files = list_nvf_manual(self.ref_name.as_str()).map_err(CallToolError::new)?; let pretty = serde_json::to_string_pretty(&md_files).map_err(CallToolError::new)?; Ok(CallToolResult::text_content(vec![TextContent::from( pretty, @@ -905,11 +911,18 @@ pub struct NvfManualReadTool { /// /// Examples: "configuring/languages/lsp", "installation/standalone/nixos", etc. path: String, + + /// The nvf ref to search in. + /// + /// Examples: "main", "v0.1.0", or a commit hash. + #[serde(default = "default_nvf_ref")] + ref_name: String, } impl NvfManualReadTool { pub fn call_tool(&self) -> Result { - let content = read_nvf_manual(&self.path).map_err(CallToolError::new)?; + let content = + read_nvf_manual(&self.path, self.ref_name.as_str()).map_err(CallToolError::new)?; Ok(CallToolResult::text_content(vec![TextContent::from( content, )])) @@ -926,14 +939,29 @@ pub struct NvfOptionsSearchTool { /// /// Examples: "vim.languages.nix", "vim.theme", etc. query: String, + + /// The nvf ref to search in. + /// + /// Examples: "main", "v0.1.0", or a commit hash. + #[serde(default = "default_nvf_ref")] + ref_name: String, +} + +fn default_nvf_ref() -> String { + "main".to_string() } impl NvfOptionsSearchTool { pub fn call_tool(&self) -> Result { - let options = search_nvf_options(self.query.as_str()).map_err(CallToolError::new)?; + let options = search_nvf_options(self.query.as_str(), self.ref_name.as_str()) + .map_err(CallToolError::new)?; if options.is_empty() { - let message = format!("no nvf options found matching '{}'", self.query.trim()); + let message = format!( + "no nvf options found matching '{}' in nvf ref '{}'", + self.query.trim(), + self.ref_name + ); return Ok(CallToolResult::text_content(vec![TextContent::from( message, )])); @@ -941,9 +969,10 @@ impl NvfOptionsSearchTool { let mut lines = Vec::new(); lines.push(format!( - "found {} nvf options matching '{}':", + "found {} nvf options matching '{}' in nvf ref '{}':", options.len(), - self.query.trim() + self.query.trim(), + self.ref_name )); lines.push(String::new()); From 8f9363478f1bae0d9aa29986258a7e576ac2a88d Mon Sep 17 00:00:00 2001 From: lukasl-dev Date: Sat, 3 Jan 2026 22:57:13 +0100 Subject: [PATCH 5/8] Update README.md --- README.md | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/README.md b/README.md index 699778d..cd47d35 100644 --- a/README.md +++ b/README.md @@ -31,6 +31,14 @@ A minimal [Model Context Protocol (MCP)](https://modelcontextprotocol.io) server - `nixpkgs_options_search`: Search for Nixpkgs options in nixpkgs for a specific ref.
+
+❄️ NixOS + +- `nixos_wiki_search`: Search the NixOS wiki. +- `nixos_wiki_read`: Read a page from the NixOS wiki. +- `nixos_channels`: List available NixOS channels with their status. +
+
🏠 Home Manager @@ -51,14 +59,6 @@ A minimal [Model Context Protocol (MCP)](https://modelcontextprotocol.io) server - `nixhub_package_versions`: Get version history for a package via [nixhub](https://nixhub.io).
-
-❄️ NixOS - -- `nixos_wiki_search`: Search the NixOS wiki. -- `nixos_wiki_read`: Read a page from the NixOS wiki. -- `nixos_channels`: List available NixOS channels with their status. -
-
🔍 General Tools From 3195fb75f6ab048527f63e20d14cbd2d916b32be Mon Sep 17 00:00:00 2001 From: lukasl-dev Date: Sat, 3 Jan 2026 23:01:42 +0100 Subject: [PATCH 6/8] Bump to version 0.3.0 --- Cargo.lock | 2 +- Cargo.toml | 2 +- VERSION | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 23ab2c5..6a296ac 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1171,7 +1171,7 @@ dependencies = [ [[package]] name = "rime" -version = "0.2.0" +version = "0.3.0" dependencies = [ "async-trait", "clap", diff --git a/Cargo.toml b/Cargo.toml index 8c67e8c..be74c24 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "rime" -version = "0.2.0" +version = "0.3.0" edition = "2024" [dependencies] diff --git a/VERSION b/VERSION index 0ea3a94..0d91a54 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -0.2.0 +0.3.0 From 931a8afa5023c30b7e03318fb1f5b590c355d025 Mon Sep 17 00:00:00 2001 From: lukasl-dev Date: Sat, 3 Jan 2026 23:09:43 +0100 Subject: [PATCH 7/8] Update workflow --- .github/workflows/build.yml | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index f94e16c..b397a0f 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -19,3 +19,23 @@ jobs: name: rime authToken: '${{ secrets.CACHIX_AUTH_TOKEN }}' - run: nix build .#rime + + - name: Integration with Claude Code + run: | + export HOME=$GITHUB_WORKSPACE/temp_home + mkdir -p $HOME + nix shell nixpkgs#bun --command bunx @anthropic-ai/claude-code mcp add rime -- ./result/bin/rime stdio + + for i in {1..3}; do + echo "Checking MCP health (attempt $i)..." + OUTPUT=$(nix shell nixpkgs#bun --command bunx @anthropic-ai/claude-code mcp list 2>&1) + echo "$OUTPUT" + if echo "$OUTPUT" | grep -q "rime:.*Connected"; then + echo "Validation successful!" + exit 0 + fi + sleep 5 + done + echo "Validation failed: rime did not connect to Claude Code" + exit 1 + From 159997c9c464a7b348bc62a3b248b1ae3dfc9743 Mon Sep 17 00:00:00 2001 From: lukasl-dev Date: Sat, 3 Jan 2026 23:10:28 +0100 Subject: [PATCH 8/8] Update workflow --- .github/workflows/build.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index b397a0f..887c668 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -18,6 +18,7 @@ jobs: with: name: rime authToken: '${{ secrets.CACHIX_AUTH_TOKEN }}' + - run: nix build .#rime - name: Integration with Claude Code