Skip to content

Commit f950fcf

Browse files
committed
feat: upgrade to latest MCP schema version
1 parent 5740a1c commit f950fcf

15 files changed

+1569
-160
lines changed

Cargo.lock

Lines changed: 1502 additions & 142 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,8 @@ license = false
1515
eula = false
1616

1717
[dependencies]
18-
rust-mcp-sdk = "0.2"
19-
rust-mcp-schema = "0.4"
18+
rust-mcp-sdk = "0.3"
19+
rust-mcp-schema = "0.5"
2020

2121
thiserror = { version = "2.0" }
2222
dirs = "6.0"
@@ -25,8 +25,8 @@ walkdir = "2.5"
2525
derive_more = { version = "2.0", features = ["display", "from_str"] }
2626
similar = "=2.7"
2727
chrono = "0.4"
28-
clap = { version = "4.5.37", features = ["derive"] }
29-
tokio = "1.44"
28+
clap = { version = "4.5", features = ["derive"] }
29+
tokio = "1.4"
3030
serde = "1.0"
3131
serde_json = "1.0"
3232
async-trait = "0.1"
@@ -35,7 +35,7 @@ tokio-util = "0.7"
3535
async_zip = { version = "0.0", features = ["full"] }
3636

3737
[dev-dependencies]
38-
tempfile = "3.1"
38+
tempfile = "3.2"
3939

4040
# The profile that 'dist' will build with
4141
[profile.dist]

src/server.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ pub fn server_details() -> InitializeResult {
1818
prompts: None,
1919
resources: None,
2020
tools: Some(ServerCapabilitiesTools { list_changed: None }),
21+
completions: None,
2122
},
2223
instructions: None,
2324
meta: None,

src/tools/create_directory.rs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,11 @@ use crate::fs_service::FileSystemService;
1111
"Can create multiple nested directories in one operation. ",
1212
"If the directory already exists, this operation will succeed silently. ",
1313
"Perfect for setting up directory structures for projects or ensuring required paths exist. ",
14-
"Only works within allowed directories.")
14+
"Only works within allowed directories."),
15+
destructive_hint = false,
16+
idempotent_hint = false,
17+
open_world_hint = false,
18+
read_only_hint = false
1519
)]
1620
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug, JsonSchema)]
1721
pub struct CreateDirectoryTool {

src/tools/directory_tree.rs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,11 @@ use crate::fs_service::FileSystemService;
1111
description = concat!("Get a recursive tree view of files and directories as a JSON structure. ",
1212
"Each entry includes 'name', 'type' (file/directory), and 'children' for directories. ",
1313
"Files have no children array, while directories always have a children array (which may be empty). ",
14-
"The output is formatted with 2-space indentation for readability. Only works within allowed directories.")
14+
"The output is formatted with 2-space indentation for readability. Only works within allowed directories."),
15+
destructive_hint = false,
16+
idempotent_hint = false,
17+
open_world_hint = false,
18+
read_only_hint = true
1519
)]
1620
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug, JsonSchema)]
1721
pub struct DirectoryTreeTool {

src/tools/edit_file.rs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,11 @@ pub struct EditOperation {
2121
description = concat!("Make line-based edits to a text file. ",
2222
"Each edit replaces exact line sequences with new content. ",
2323
"Returns a git-style diff showing the changes made. ",
24-
"Only works within allowed directories.")
24+
"Only works within allowed directories."),
25+
destructive_hint = false,
26+
idempotent_hint = false,
27+
open_world_hint = false,
28+
read_only_hint = false
2529
)]
2630
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug, JsonSchema)]
2731
pub struct EditFileTool {

src/tools/get_file_info.rs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,11 @@ use crate::fs_service::FileSystemService;
1111
"Returns comprehensive information including size, creation time, ",
1212
"last modified time, permissions, and type. ",
1313
"This tool is perfect for understanding file characteristics without ",
14-
"reading the actual content. Only works within allowed directories.")
14+
"reading the actual content. Only works within allowed directories."),
15+
destructive_hint = false,
16+
idempotent_hint = false,
17+
open_world_hint = false,
18+
read_only_hint = true
1519
)]
1620
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug, JsonSchema)]
1721
pub struct GetFileInfoTool {

src/tools/list_allowed_directories.rs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,11 @@ use crate::fs_service::FileSystemService;
88
description = concat!("Returns a list of directories that the server has permission ",
99
"to access Subdirectories within these allowed directories are also accessible. ",
1010
"Use this to identify which directories and their nested paths are available ",
11-
"before attempting to access files.")
11+
"before attempting to access files."),
12+
destructive_hint = false,
13+
idempotent_hint = false,
14+
open_world_hint = false,
15+
read_only_hint = true
1216
)]
1317
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug, JsonSchema)]
1418
pub struct ListAllowedDirectoriesTool {}

src/tools/list_directory.rs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,11 @@ use crate::fs_service::FileSystemService;
1010
description = concat!("Get a detailed listing of all files and directories in a specified path. ",
1111
"Results clearly distinguish between files and directories with [FILE] and [DIR] ",
1212
"prefixes. This tool is essential for understanding directory structure and ",
13-
"finding specific files within a directory. Only works within allowed directories.")
13+
"finding specific files within a directory. Only works within allowed directories."),
14+
destructive_hint = false,
15+
idempotent_hint = false,
16+
open_world_hint = false,
17+
read_only_hint = true
1418
)]
1519
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug, JsonSchema)]
1620
pub struct ListDirectoryTool {

src/tools/move_file.rs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,11 @@ use crate::fs_service::FileSystemService;
1111
"and rename them in a single operation. If the destination exists, the ",
1212
"operation will fail. Works across different directories and can be used ",
1313
"for simple renaming within the same directory. ",
14-
"Both source and destination must be within allowed directories.")
14+
"Both source and destination must be within allowed directories."),
15+
destructive_hint = false,
16+
idempotent_hint = false,
17+
open_world_hint = false,
18+
read_only_hint = false
1519
)]
1620
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug, JsonSchema)]
1721
pub struct MoveFileTool {

0 commit comments

Comments
 (0)