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 + diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 6ea0831..ecdb052 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 @@ -19,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 @@ -26,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/.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/Cargo.toml b/Cargo.toml index 8703b7d..fcc5893 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -41,3 +41,6 @@ tempfile = "3.1" [profile.dist] inherits = "release" lto = "thin" + +[package.metadata.typos] +default.extend-ignore-re = ["4ded5ca"] diff --git a/README.md b/README.md index 951f620..4f0bf8f 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,5 @@
-
+
| Tool Name | Description | +Inputs | ||
|---|---|---|---|---|
| 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
|
@@ -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.
+
+
|
||
| 3. | +2. |
directory_tree
|
@@ -42,18 +40,30 @@ structures for projects or ensuring required paths exist. Only works within allo
Each entry includes
+
|
|
| 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. | +
+
|
| 5. | +4. |
get_file_info
|
@@ -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.
+
+
|
|
| 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. |
+
+
|
| 8. | +7. |
move_file
|
@@ -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.
+
+
|
+ |
| 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. | +
+
|
|
| 9. | @@ -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. +
+
|
|||
| 10. | @@ -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. +
+
|
|||
| 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. | +
+
|
+ |
| 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
+
|
- 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. | +
+
|
- 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. | +
+
|
- 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. |