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
1 change: 1 addition & 0 deletions crates/mcp-edit/AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ MCP server offering file system editing utilities.
- `search_file_content`
- uses `grep` crate for regex searches with optional include filters
- respects git ignore
- read-only tools annotate with `readOnlyHint`: `list_directory`, `read_file`, `read_many_files`, `glob`, `search_file_content`
- parameter metadata
- tool parameters include descriptions and default values via rmcp
- optional parameters prefix descriptions with "Optional."
Expand Down
22 changes: 17 additions & 5 deletions crates/mcp-edit/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -279,7 +279,10 @@ impl FsServer {
)]))
}

#[tool(description = "List the contents of a directory.")]
#[tool(
description = "List the contents of a directory.",
annotations(read_only_hint = true)
)]
pub async fn list_directory(
&self,
Parameters(params): Parameters<ListDirectoryParams>,
Expand Down Expand Up @@ -354,7 +357,7 @@ impl FsServer {
Ok(CallToolResult::success(vec![Content::text(output)]))
}

#[tool(description = "Read a file.")]
#[tool(description = "Read a file.", annotations(read_only_hint = true))]
pub async fn read_file(
&self,
Parameters(params): Parameters<ReadFileParams>,
Expand Down Expand Up @@ -429,7 +432,10 @@ impl FsServer {
}
}

#[tool(description = "Read multiple files and concatenate their contents.")]
#[tool(
description = "Read multiple files and concatenate their contents.",
annotations(read_only_hint = true)
)]
pub async fn read_many_files(
&self,
Parameters(params): Parameters<ReadManyFilesParams>,
Expand Down Expand Up @@ -645,7 +651,10 @@ impl FsServer {
))]))
}

#[tool(description = "Find files matching a glob pattern.")]
#[tool(
description = "Find files matching a glob pattern.",
annotations(read_only_hint = true)
)]
pub async fn glob(
&self,
Parameters(params): Parameters<GlobParams>,
Expand Down Expand Up @@ -716,7 +725,10 @@ impl FsServer {
Ok(CallToolResult::success(vec![Content::text(output)]))
}

#[tool(description = "Search for a regex pattern in files within a directory.")]
#[tool(
description = "Search for a regex pattern in files within a directory.",
annotations(read_only_hint = true)
)]
pub async fn search_file_content(
&self,
Parameters(params): Parameters<SearchFileContentParams>,
Expand Down
1 change: 1 addition & 0 deletions crates/mcp-hello/AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ Simple MCP server that provides a greeting tool.
- tools
- `hello`
- returns "Hello, world!"
- annotated with `readOnlyHint`
- server
- runs over stdio
- includes tools capability in MCP initialize response
Expand Down
5 changes: 4 additions & 1 deletion crates/mcp-hello/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,10 @@ impl HelloServer {
}
}

#[tool(description = "Return a friendly greeting")]
#[tool(
description = "Return a friendly greeting",
annotations(read_only_hint = true)
)]
pub async fn hello(&self) -> Result<CallToolResult, McpError> {
Ok(CallToolResult::success(vec![Content::text(
"Hello, world!",
Expand Down