From f524191fe69cab056e7ee34fd336272b68ca6e3d Mon Sep 17 00:00:00 2001 From: Ali Hashemi Date: Mon, 28 Apr 2025 18:21:52 -0300 Subject: [PATCH 1/7] ci: integrate mcp discovery --- .github/workflows/ci.yml | 10 ++ .github/workflows/mcp-discovery.yml | 49 +++++++++ README.md | 2 +- docs/capabilities.md | 153 +++++++++++++++++++++------- 4 files changed, 178 insertions(+), 36 deletions(-) create mode 100644 .github/workflows/mcp-discovery.yml diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 6ea0831..2049914 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -12,6 +12,16 @@ jobs: steps: - name: Checkout uses: actions/checkout@v4 + - name: Cache Rust + uses: actions/cache@v4 + with: + path: | + ~/.rustup/toolchains + ~/.cargo/registry + ~/.cargo/git + target + key: ${{ runner.os }}-rust-${{ steps.toolchain.outputs.cachekey }} + restore-keys: ${{ runner.os }}-rust- - name: Install Rust Toolchain uses: dtolnay/rust-toolchain@master diff --git a/.github/workflows/mcp-discovery.yml b/.github/workflows/mcp-discovery.yml new file mode 100644 index 0000000..ca5cfa2 --- /dev/null +++ b/.github/workflows/mcp-discovery.yml @@ -0,0 +1,49 @@ +name: MCP Discovery +on: + pull_request: + branches: + - main + types: [opened, synchronize, reopened] + workflow_call: + inputs: + version: + required: true + type: string +permissions: + contents: write +jobs: + update: + if: startsWith(github.head_ref, 'release-please--branches--') + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + with: + token: ${{ secrets.GITHUB_TOKEN }} + ref: ${{ github.head_ref }} + + - name: Cache Rust + uses: actions/cache@v4 + with: + path: | + ~/.rustup/toolchains + ~/.cargo/registry + ~/.cargo/git + target + key: ${{ runner.os }}-rust-${{ steps.toolchain.outputs.cachekey }} + restore-keys: ${{ runner.os }}-rust- + + - name: Install Rust Toolchain + uses: dtolnay/rust-toolchain@master + with: + toolchain: stable + + - name: Build + run: | + cargo build + + - uses: rust-mcp-stack/mcp-discovery-action@v1 + with: + version: "latest" + command: "update" + mcp-launch-command: "target/debug/rust-mcp-filesystem ." + filename: "docs/capabilities.md" diff --git a/README.md b/README.md index 951f620..4f0bf8f 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,5 @@

- Description + Rust MCP Filesystem Logo

# Rust MCP Filesystem diff --git a/docs/capabilities.md b/docs/capabilities.md index 06248ea..c933b92 100644 --- a/docs/capabilities.md +++ b/docs/capabilities.md @@ -1,10 +1,9 @@ # Capabilities -## **rust-mcp-filesystem-server 0.1.0** - + +## rust-mcp-filesystem 0.1.3 | 🟢 Tools (14) | 🔴 Prompts | 🔴 Resources | 🔴 Logging | 🔴 Experimental | -| ------------- | ------------------------------------------- | --------------------------------------------- | ------------------------------------------- | ------------------------------------------------ | - +| --- | --- | --- | --- | --- | ## 🛠️ Tools (14) @@ -13,18 +12,12 @@ + - - - - - @@ -32,9 +25,14 @@ nested directories in one operation. If the directory already exists, this operation will succeed silently. Perfect for setting up directory structures for projects or ensuring required paths exist. Only works within allowed directories. + - + @@ -42,18 +40,30 @@ structures for projects or ensuring required paths exist. Only works within allo Each entry includes name, type (file/directory), and children for directories. Files have no children array, while directories always have a children array (which may be empty). The output is formatted with 2-space indentation for readability. Only works within allowed directories. + - + + - + @@ -61,28 +71,42 @@ Only works within allowed directories. information including size, creation time, last modified time, permissions, and type. This tool is perfect for understanding file characteristics without reading the actual content. Only works within allowed directories. + - + + - + + - + @@ -90,6 +114,24 @@ finding specific files within a directory. Only works within allowed directories and rename them in a single operation. If the destination exists, the operation will fail. Works across different directories and can be used for simple renaming within the same directory. Both source and destination must be within allowed directories. + + + + + + + @@ -101,6 +143,11 @@ efficient than reading files one by one when you need to analyze or compare multiple files. Each file's content is returned with its path as a reference. Failed reads for individual files won't stop the entire operation. Only works within allowed directories. + @@ -112,45 +159,81 @@ Searches through all subdirectories from the starting path. The search is case-insensitive and matches partial names. Returns full paths to all matching items. Great for finding files when you don't know their exact location. Only searches within allowed directories. + + + + + + + - - - - + + - + + -
Tool Name DescriptionInputs
1. - read_file - Read the complete contents of a file from the file system. Handles various text encodings and provides detailed error messages if the file cannot be read. Use this tool when you need to examine the contents of a single file. Only works within allowed directories.
2. create_directory +
    +
  • path : string
  • +
+
3.2. directory_tree +
    +
  • path : string
  • +
+
4.3. edit_file Make line-based edits to a text file. Each edit replaces exact line sequences with new content. Returns a git-style diff showing the changes made. Only works within allowed directories. +
    +
  • dryRun : boolean
  • +
  • edits : {newText : string, oldText : string} [ ]
  • +
  • path : string
  • +
+
5.4. get_file_info +
    +
  • path : string
  • +
+
6.5. list_allowed_directories Returns a list of directories that the server has permission to access. Subdirectories within these allowed directories are also accessible. Use this to identify which directories and their nested paths are available before attempting to access files. +
    +
+
7.6. list_directory Get a detailed listing of all files and directories in a specified path. -Results clearly distinguish between files and directories with [FILE] and [DIR] +Results clearly distinguish between files and directories with FILE and DIR prefixes. This tool is essential for understanding directory structure and finding specific files within a directory. Only works within allowed directories. +
    +
  • path : string
  • +
+
8.7. move_file +
    +
  • destination : string
  • +
  • source : string
  • +
+
8. + read_file + Read the complete contents of a file from the file system. Handles various text encodings and provides detailed error messages if the file cannot be read. Use this tool when you need to examine the contents of a single file. Only works within allowed directories. +
    +
  • path : string
  • +
+
9. +
    +
  • paths : string [ ]
  • +
+
10. +
    +
  • excludePatterns : string [ ]
  • +
  • path : string
  • +
  • pattern : string
  • +
+
11. + unzip_file + Extracts the contents of a ZIP archive to a specified target directory. +It takes a source ZIP file path and a target extraction directory. +The tool decompresses all files and directories stored in the ZIP, recreating their structure in the target location. +Both the source ZIP file and the target directory should reside within allowed directories. +
    +
  • target_path : string
  • +
  • zip_file : string
  • +
+
12. write_file Create a new file or completely overwrite an existing file with new content. Use with caution as it will overwrite existing files without warning. Handles text content with proper encoding. Only works within allowed directories.
12. - zip_files +
    +
  • content : string
  • +
  • path : string
  • +
Creates a ZIP archive by compressing files. -It takes a list of files to compress and a target path for the resulting ZIP file. -Both the source files and the target ZIP file should reside within allowed directories.
13. - unzip_file + zip_directory + Creates a ZIP archive by compressing a directory , including files and subdirectories matching a specified glob pattern. +It takes a path to the folder and a glob pattern to identify files to compress and a target path for the resulting ZIP file. +Both the source directory and the target ZIP file should reside within allowed directories. +
    +
  • input_directory : string
  • +
  • pattern : string
  • +
  • target_zip_file : string
  • +
Extracts the contents of a ZIP archive to a specified target directory. -It takes a source ZIP file path and a target extraction directory. -The tool decompresses all files and directories stored in the ZIP, recreating their structure in the target location. -Both the source ZIP file and the target directory should reside within allowed directories.
14. - zip_directory + zip_files + Creates a ZIP archive by compressing files. +It takes a list of files to compress and a target path for the resulting ZIP file. +Both the source files and the target ZIP file should reside within allowed directories. +
    +
  • input_files : string [ ]
  • +
  • target_zip_file : string
  • +
Creates a ZIP archive by compressing a directory , including files and subdirectories matching a specified glob pattern. -It takes a path to the folder and a glob pattern to identify files to compress and a target path for the resulting ZIP file. -Both the source directory and the target ZIP file should reside within allowed directories.
-◾ generated by mcp-discovery + + + +◾ generated by [mcp-discovery](https://github.com/rust-mcp-stack/mcp-discovery) + \ No newline at end of file From 3aa20268bfcbda57ab1f377ff8968c9c67d904a0 Mon Sep 17 00:00:00 2001 From: Ali Hashemi Date: Mon, 28 Apr 2025 18:23:34 -0300 Subject: [PATCH 2/7] chore: add pr template --- .github/pull_request_template.md | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 .github/pull_request_template.md diff --git a/.github/pull_request_template.md b/.github/pull_request_template.md new file mode 100644 index 0000000..76fd2da --- /dev/null +++ b/.github/pull_request_template.md @@ -0,0 +1,21 @@ +### 📌 Summary + + +### 🔍 Related Issues + + +- Fixes # + + +### ✨ Changes Made + + +- Change 1 +- Change 2 +- Change 3 + +### 🛠️ Testing Steps + + +### 💡 Additional Notes + From 06e71e2d29aa321608de6994b1381785abc90be5 Mon Sep 17 00:00:00 2001 From: Ali Hashemi Date: Mon, 28 Apr 2025 19:15:29 -0300 Subject: [PATCH 3/7] chore: whitelist typos --- Cargo.toml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Cargo.toml b/Cargo.toml index 8703b7d..86bfef6 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -41,3 +41,6 @@ tempfile = "3.1" [profile.dist] inherits = "release" lto = "thin" + +[package.metadata.typos] +extend-words = ["4ded"] From 34a481c6e61cdaa68431902ea2dc9804c471f1c8 Mon Sep 17 00:00:00 2001 From: Ali Hashemi Date: Mon, 28 Apr 2025 19:18:43 -0300 Subject: [PATCH 4/7] chore: false positive typo --- Cargo.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Cargo.toml b/Cargo.toml index 86bfef6..3580fba 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -43,4 +43,4 @@ inherits = "release" lto = "thin" [package.metadata.typos] -extend-words = ["4ded"] +default.extend-words = ["4ded"] From 7692cf7ff9499dcca5a8613ac7e4195a92c8c1a9 Mon Sep 17 00:00:00 2001 From: Ali Hashemi Date: Mon, 28 Apr 2025 19:22:48 -0300 Subject: [PATCH 5/7] chore: fix syntax --- Cargo.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Cargo.toml b/Cargo.toml index 3580fba..4d6d85c 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -43,4 +43,4 @@ inherits = "release" lto = "thin" [package.metadata.typos] -default.extend-words = ["4ded"] +default.extend-words = { "4ded" = true } From f5088979d139b4cdebba2231ae3e033e9f8df06c Mon Sep 17 00:00:00 2001 From: Ali Hashemi Date: Mon, 28 Apr 2025 19:24:50 -0300 Subject: [PATCH 6/7] ci: fix typo syntax --- Cargo.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Cargo.toml b/Cargo.toml index 4d6d85c..4294bdc 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -43,4 +43,4 @@ inherits = "release" lto = "thin" [package.metadata.typos] -default.extend-words = { "4ded" = true } +default.extend-words = { "4ded" = "4ded" } From 8af46203f1884387ab967031106b46994e681ed5 Mon Sep 17 00:00:00 2001 From: Ali Hashemi Date: Mon, 28 Apr 2025 19:29:02 -0300 Subject: [PATCH 7/7] ci: fix typo --- .github/workflows/ci.yml | 10 +++++----- Cargo.toml | 2 +- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 2049914..ecdb052 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -29,6 +29,11 @@ jobs: toolchain: stable components: rustfmt + - name: Spell Check + env: + RUSTDOCFLAGS: "-Dwarnings" + uses: crate-ci/typos@master + - uses: davidB/rust-cargo-make@v1 - uses: taiki-e/install-action@nextest @@ -36,11 +41,6 @@ jobs: run: | cargo make check - - name: Spell Check - env: - RUSTDOCFLAGS: "-Dwarnings" - uses: crate-ci/typos@master - - name: Audit uses: actions-rust-lang/audit@v1 with: diff --git a/Cargo.toml b/Cargo.toml index 4294bdc..fcc5893 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -43,4 +43,4 @@ inherits = "release" lto = "thin" [package.metadata.typos] -default.extend-words = { "4ded" = "4ded" } +default.extend-ignore-re = ["4ded5ca"]