mirror of
https://github.com/rustfs/rustfs.git
synced 2026-08-27 15:37:02 +00:00
feat: add docker usage for rustfs mcp (#365)
This commit is contained in:
@@ -0,0 +1,15 @@
|
|||||||
|
FROM rust:1.88 AS builder
|
||||||
|
|
||||||
|
WORKDIR /build
|
||||||
|
|
||||||
|
COPY . .
|
||||||
|
|
||||||
|
RUN cargo build --release -p rustfs-mcp
|
||||||
|
|
||||||
|
FROM debian:bookworm-slim
|
||||||
|
|
||||||
|
WORKDIR /app
|
||||||
|
|
||||||
|
COPY --from=builder /build/target/release/rustfs-mcp /app/
|
||||||
|
|
||||||
|
ENTRYPOINT ["/app/rustfs-mcp"]
|
||||||
@@ -98,7 +98,9 @@ rustfs-mcp --log-level debug --region us-west-2
|
|||||||
```
|
```
|
||||||
|
|
||||||
### Integration with chat client
|
### Integration with chat client
|
||||||
|
|
||||||
#### Option 1: Using Command Line Arguments
|
#### Option 1: Using Command Line Arguments
|
||||||
|
|
||||||
```json
|
```json
|
||||||
{
|
{
|
||||||
"mcpServers": {
|
"mcpServers": {
|
||||||
@@ -116,6 +118,7 @@ rustfs-mcp --log-level debug --region us-west-2
|
|||||||
```
|
```
|
||||||
|
|
||||||
#### Option 2: Using Environment Variables
|
#### Option 2: Using Environment Variables
|
||||||
|
|
||||||
```json
|
```json
|
||||||
{
|
{
|
||||||
"mcpServers": {
|
"mcpServers": {
|
||||||
@@ -130,26 +133,84 @@ rustfs-mcp --log-level debug --region us-west-2
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
|
### Using MCP with Docker
|
||||||
|
|
||||||
|
#### Docker image build
|
||||||
|
|
||||||
|
Using MCP with docker will simply the usage of rustfs mcp. Building the docker image with below command:
|
||||||
|
|
||||||
|
```
|
||||||
|
docker build -f Dockerfile -t rustfs/rustfs-mcp ../../
|
||||||
|
```
|
||||||
|
|
||||||
|
Alternatively, if you want to build the image from the rustfs codebase root directory,run the command:
|
||||||
|
|
||||||
|
```
|
||||||
|
docker build -f crates/mcp/Dockerfile -t rustfs/rustfs-mcp .
|
||||||
|
```
|
||||||
|
|
||||||
|
#### IDE Configuration
|
||||||
|
|
||||||
|
Adding the following content in IDE MCP settings:
|
||||||
|
|
||||||
|
```
|
||||||
|
{
|
||||||
|
"mcpServers": {
|
||||||
|
"rustfs-mcp": {
|
||||||
|
"command": "docker",
|
||||||
|
"args": [
|
||||||
|
"run",
|
||||||
|
"--rm",
|
||||||
|
"-i",
|
||||||
|
"-e",
|
||||||
|
"AWS_ACCESS_KEY_ID",
|
||||||
|
"-e",
|
||||||
|
"AWS_SECRET_ACCESS_KEY",
|
||||||
|
"-e",
|
||||||
|
"AWS_REGION",
|
||||||
|
"-e",
|
||||||
|
"AWS_ENDPOINT_URL",
|
||||||
|
"rustfs/rustfs-mcp"
|
||||||
|
],
|
||||||
|
"env": {
|
||||||
|
"AWS_ACCESS_KEY_ID": "rustfs_access_key",
|
||||||
|
"AWS_SECRET_ACCESS_KEY": "rustfs_secret_key",
|
||||||
|
"AWS_REGION": "cn-east-1",
|
||||||
|
"AWS_ENDPOINT_URL": "rustfs_instance_url"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
If success, MCP configure page will show the [available tools](#️-available-tools).
|
||||||
|
|
||||||
## 🛠️ Available Tools
|
## 🛠️ Available Tools
|
||||||
|
|
||||||
The MCP server exposes the following tools that AI assistants can use:
|
The MCP server exposes the following tools that AI assistants can use:
|
||||||
|
|
||||||
### `list_buckets`
|
### `list_buckets`
|
||||||
|
|
||||||
List all S3 buckets accessible with the configured credentials.
|
List all S3 buckets accessible with the configured credentials.
|
||||||
|
|
||||||
**Parameters:** None
|
**Parameters:** None
|
||||||
|
|
||||||
### `list_objects`
|
### `list_objects`
|
||||||
|
|
||||||
List objects in an S3 bucket with optional prefix filtering.
|
List objects in an S3 bucket with optional prefix filtering.
|
||||||
|
|
||||||
**Parameters:**
|
**Parameters:**
|
||||||
|
|
||||||
- `bucket_name` (string): Name of the S3 bucket
|
- `bucket_name` (string): Name of the S3 bucket
|
||||||
- `prefix` (string, optional): Prefix to filter objects
|
- `prefix` (string, optional): Prefix to filter objects
|
||||||
|
|
||||||
### `upload_file`
|
### `upload_file`
|
||||||
|
|
||||||
Upload a local file to S3 with automatic MIME type detection.
|
Upload a local file to S3 with automatic MIME type detection.
|
||||||
|
|
||||||
**Parameters:**
|
**Parameters:**
|
||||||
|
|
||||||
- `local_file_path` (string): Path to the local file
|
- `local_file_path` (string): Path to the local file
|
||||||
- `bucket_name` (string): Target S3 bucket
|
- `bucket_name` (string): Target S3 bucket
|
||||||
- `object_key` (string): S3 object key (destination path)
|
- `object_key` (string): S3 object key (destination path)
|
||||||
@@ -158,9 +219,11 @@ Upload a local file to S3 with automatic MIME type detection.
|
|||||||
- `cache_control` (string, optional): Cache control header
|
- `cache_control` (string, optional): Cache control header
|
||||||
|
|
||||||
### `get_object`
|
### `get_object`
|
||||||
|
|
||||||
Retrieve an object from S3 with two operation modes: read content directly or download to a file.
|
Retrieve an object from S3 with two operation modes: read content directly or download to a file.
|
||||||
|
|
||||||
**Parameters:**
|
**Parameters:**
|
||||||
|
|
||||||
- `bucket_name` (string): Source S3 bucket
|
- `bucket_name` (string): Source S3 bucket
|
||||||
- `object_key` (string): S3 object key
|
- `object_key` (string): S3 object key
|
||||||
- `version_id` (string, optional): Version ID for versioned objects
|
- `version_id` (string, optional): Version ID for versioned objects
|
||||||
|
|||||||
Reference in New Issue
Block a user