Skip to content

ci: integrate mcp discovery #6

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 7 commits into from
Apr 28, 2025
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
21 changes: 21 additions & 0 deletions .github/pull_request_template.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
### 📌 Summary
<!-- Provide a concise description of your changes. What problem does this PR solve? -->

### 🔍 Related Issues
<!-- Link related issues using keywords like "Fixes #123" or "Closes #456" -->

- Fixes #


### ✨ Changes Made
<!-- List the key changes introduced in this PR -->

- Change 1
- Change 2
- Change 3

### 🛠️ Testing Steps
<!-- Explain how reviewers can test your changes, if applicable -->

### 💡 Additional Notes
<!-- Any other information or context about the PR -->
20 changes: 15 additions & 5 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,25 +12,35 @@ 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
with:
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

- name: Run cargo make check
run: |
cargo make check

- name: Spell Check
env:
RUSTDOCFLAGS: "-Dwarnings"
uses: crate-ci/typos@master

- name: Audit
uses: actions-rust-lang/audit@v1
with:
Expand Down
49 changes: 49 additions & 0 deletions .github/workflows/mcp-discovery.yml
Original file line number Diff line number Diff line change
@@ -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"
3 changes: 3 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -41,3 +41,6 @@ tempfile = "3.1"
[profile.dist]
inherits = "release"
lto = "thin"

[package.metadata.typos]
default.extend-ignore-re = ["4ded5ca"]
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<p align="center">
<img width="96" src="./docs/_media/rust-mcp-filesystem.png" alt="Description" width="300">
<img width="96" src="./docs/_media/rust-mcp-filesystem.png" alt="Rust MCP Filesystem Logo" width="300">
</p>

# Rust MCP Filesystem
Expand Down
153 changes: 118 additions & 35 deletions docs/capabilities.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
# Capabilities

## **rust-mcp-filesystem-server 0.1.0**

<!-- mcp-discovery-render -->
## rust-mcp-filesystem 0.1.3
| 🟢 Tools (14) | <span style="opacity:0.6">🔴 Prompts</span> | <span style="opacity:0.6">🔴 Resources</span> | <span style="opacity:0.6">🔴 Logging</span> | <span style="opacity:0.6">🔴 Experimental</span> |
| ------------- | ------------------------------------------- | --------------------------------------------- | ------------------------------------------- | ------------------------------------------------ |

| --- | --- | --- | --- | --- |
## 🛠️ Tools (14)

<table style="text-align: left;">
Expand All @@ -13,83 +12,126 @@
<th style="width: auto;"></th>
<th style="width: auto;">Tool Name</th>
<th style="width: auto;">Description</th>
<th style="width: auto;">Inputs</th>
</tr>
</thead>
<tbody style="vertical-align: top;">
<tr>
<td>1.</td>
<td>
<code><b>read_file</b></code>
</td>
<td>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.</td>
</tr>
<tr>
<td>2.</td>
<td>
<code><b>create_directory</b></code>
</td>
<td>Create a new directory or ensure a directory exists. Can create multiple
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.</td>
<td>
<ul>
<li style="white-space: nowrap;"> <code>path</code> : string<br /></li>
</ul>
</td>
</tr>
<tr>
<td>3.</td>
<td>2.</td>
<td>
<code><b>directory_tree</b></code>
</td>
<td>Get a recursive tree view of files and directories as a JSON structure.
Each entry includes <code>name</code>, <code>type</code> (file/directory), and <code>children</code> 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.</td>
<td>
<ul>
<li style="white-space: nowrap;"> <code>path</code> : string<br /></li>
</ul>
</td>
</tr>
<tr>
<td>4.</td>
<td>3.</td>
<td>
<code><b>edit_file</b></code>
</td>
<td>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.</td>
<td>
<ul>
<li style="white-space: nowrap;"> <code>dryRun</code> : boolean<br /></li>
<li style="white-space: nowrap;"> <code>edits</code> : {newText : string, oldText : string} [ ]<br /></li>
<li style="white-space: nowrap;"> <code>path</code> : string<br /></li>
</ul>
</td>
</tr>
<tr>
<td>5.</td>
<td>4.</td>
<td>
<code><b>get_file_info</b></code>
</td>
<td>Retrieve detailed metadata about a file or directory. Returns comprehensive
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.</td>
<td>
<ul>
<li style="white-space: nowrap;"> <code>path</code> : string<br /></li>
</ul>
</td>
</tr>
<tr>
<td>6.</td>
<td>5.</td>
<td>
<code><b>list_allowed_directories</b></code>
</td>
<td>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.</td>
<td>
<ul>
</ul>
</td>
</tr>
<tr>
<td>7.</td>
<td>6.</td>
<td>
<code><b>list_directory</b></code>
</td>
<td>Get a detailed listing of all files and directories in a specified path.
Results clearly distinguish between files and directories with <code>[FILE]</code> and <code>[DIR]</code>
Results clearly distinguish between files and directories with <code>FILE</code> and <code>DIR</code>
prefixes. This tool is essential for understanding directory structure and
finding specific files within a directory. Only works within allowed directories.</td>
<td>
<ul>
<li style="white-space: nowrap;"> <code>path</code> : string<br /></li>
</ul>
</td>
</tr>
<tr>
<td>8.</td>
<td>7.</td>
<td>
<code><b>move_file</b></code>
</td>
<td>Move or rename files and directories. Can move files between 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.</td>
<td>
<ul>
<li style="white-space: nowrap;"> <code>destination</code> : string<br /></li>
<li style="white-space: nowrap;"> <code>source</code> : string<br /></li>
</ul>
</td>
</tr>
<tr>
<td>8.</td>
<td>
<code><b>read_file</b></code>
</td>
<td>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.</td>
<td>
<ul>
<li style="white-space: nowrap;"> <code>path</code> : string<br /></li>
</ul>
</td>
</tr>
<tr>
<td>9.</td>
Expand All @@ -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.</td>
<td>
<ul>
<li style="white-space: nowrap;"> <code>paths</code> : string [ ]<br /></li>
</ul>
</td>
</tr>
<tr>
<td>10.</td>
Expand All @@ -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.</td>
<td>
<ul>
<li style="white-space: nowrap;"> <code>excludePatterns</code> : string [ ]<br /></li>
<li style="white-space: nowrap;"> <code>path</code> : string<br /></li>
<li style="white-space: nowrap;"> <code>pattern</code> : string<br /></li>
</ul>
</td>
</tr>
<tr>
<td>11.</td>
<td>
<code><b>unzip_file</b></code>
</td>
<td>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.</td>
<td>
<ul>
<li style="white-space: nowrap;"> <code>target_path</code> : string<br /></li>
<li style="white-space: nowrap;"> <code>zip_file</code> : string<br /></li>
</ul>
</td>
</tr>
<tr>
<td>12.</td>
<td>
<code><b>write_file</b></code>
</td>
<td>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.</td>
</tr>
<tr>
<td>12.</td>
<td>
<code><b>zip_files</b></code>
<ul>
<li style="white-space: nowrap;"> <code>content</code> : string<br /></li>
<li style="white-space: nowrap;"> <code>path</code> : string<br /></li>
</ul>
</td>
<td>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.</td>
</tr>
<tr>
<td>13.</td>
<td>
<code><b>unzip_file</b></code>
<code><b>zip_directory</b></code>
</td>
<td>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.</td>
<td>
<ul>
<li style="white-space: nowrap;"> <code>input_directory</code> : string<br /></li>
<li style="white-space: nowrap;"> <code>pattern</code> : string<br /></li>
<li style="white-space: nowrap;"> <code>target_zip_file</code> : string<br /></li>
</ul>
</td>
<td>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.</td>
</tr>
<tr>
<td>14.</td>
<td>
<code><b>zip_directory</b></code>
<code><b>zip_files</b></code>
</td>
<td>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.</td>
<td>
<ul>
<li style="white-space: nowrap;"> <code>input_files</code> : string [ ]<br /></li>
<li style="white-space: nowrap;"> <code>target_zip_file</code> : string<br /></li>
</ul>
</td>
<td>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.</td>
</tr>
</tbody>
</table>

<sub>◾ generated by mcp-discovery<sub>



<sub>◾ generated by [mcp-discovery](https://github.com/rust-mcp-stack/mcp-discovery)</sub>
<!-- mcp-discovery-render-end -->