Filesystem MCP Server
⚠️ Deprecated. This standalone MCP server is deprecated and will be combined into the File Gateway service. File Gateway bundles this MCP alongside the REST file-api and VersityGW and supports both the
filesystem(PVC) ands3storage backends. Use File Gateway for new deployments; this standalone chart will be removed in a future release.
The Filesystem MCP Server is an MCP-compliant server that provides secure filesystem operations. It enables agents to read, write, edit, search, and manage files within controlled workspaces.
Available Tools
The MCP server exposes the following tools (prefixed with mcp-filesystem-):
mcp-filesystem-read-file- Read file contentsmcp-filesystem-write-file- Write or overwrite filesmcp-filesystem-edit-file- Edit existing filesmcp-filesystem-create-directory- Create directoriesmcp-filesystem-list-directory- List directory contentsmcp-filesystem-move- Move or rename files/directoriesmcp-filesystem-search- Search for files and contentmcp-filesystem-get-file-info- Get file metadatamcp-filesystem-list-allowed-directories- List accessible directoriesmcp-filesystem-directory-tree- Get directory tree structuremcp-filesystem-set-base-directory- Configure workspace directory
Quick Start
Installation
Using Ark CLI (Recommended):
ark install marketplace/mcps/filesystem-mcp-serverUsing DevSpace (for Development):
cd mcps/filesystem-mcp-server
devspace deployUsing Helm:
cd mcps/filesystem-mcp-server
helm install mcp-filesystem ./chart -n defaultCreating an Agent with Filesystem Access
Create an agent that uses the filesystem MCP server:
apiVersion: ark.mckinsey.com/v1alpha1
kind: Agent
metadata:
name: filesystem-agent
namespace: default
spec:
tools:
- name: mcp-filesystem-read-file
type: custom
- name: mcp-filesystem-write-file
type: custom
- name: mcp-filesystem-edit-file
type: custom
- name: mcp-filesystem-create-directory
type: custom
- name: mcp-filesystem-list-directory
type: customConfiguring Workspaces
Workspaces are configured via Ark query annotations using the set_base_directory tool:
apiVersion: ark.mckinsey.com/v1alpha1
kind: Query
metadata:
name: my-query
annotations:
"ark.mckinsey.com/mcp-server-settings": |
{"default/mcp-filesystem": {
"toolCalls": [{
"name": "set_base_directory",
"arguments": {"path": "my-workspace"}
}]
}}
spec:
input: "List all files in the current directory"
targets:
- name: filesystem-agentThis creates and configures /data/my-workspace/ as the working directory for all filesystem operations in that query.
Examples
Basic File Operations
# Create and write to a file
ark query agent/filesystem-agent "Create a file hello.txt with content 'Hello World'"
# Read a file
ark query agent/filesystem-agent "Read the contents of hello.txt"
# List files
ark query agent/filesystem-agent "List all files in the current directory"Directory Operations
# Create a directory structure
ark query agent/filesystem-agent "Create a directory structure: project/src and project/tests"
# Get directory tree
ark query agent/filesystem-agent "Show me the directory tree of the project folder"Search Operations
# Search for files
ark query agent/filesystem-agent "Find all .txt files"
# Search file contents
ark query agent/filesystem-agent "Search for files containing 'TODO'"Configuration
Environment Variables
Configured in chart/values.yaml:
| Variable | Description | Default |
|---|---|---|
PORT | Server port | 8080 |
STORAGE_BACKEND | Storage adapter: filesystem (local disk) or s3 | filesystem |
BASE_DATA_DIR | Base directory for filesystem operations (filesystem backend) | /data |
SESSION_FILE | Path to session metadata storage | /data/sessions/sessions.json |
MAX_SESSIONS | Maximum concurrent sessions | 1000 |
Storage backends
The server picks a storage adapter at startup via STORAGE_BACKEND. Both adapters expose the identical tool set, so agents work unchanged regardless of backend.
filesystem(default) — reads/writes the local filesystem underBASE_DATA_DIR, backed by the PVC.s3— reads/writes an S3 bucket via the AWS SDK, addressing objects by key (“directories” are key prefixes). This is what File Gateway uses when VersityGW runs itss3backend, so the MCP and the file-api share one bucket. Extra variables in this mode:
| Variable | Description | Default |
|---|---|---|
AWS_ENDPOINT_URL | S3 endpoint (e.g. the in-cluster VersityGW service) | AWS default |
AWS_ACCESS_KEY_ID / AWS_SECRET_ACCESS_KEY | Credentials (AWS_SESSION_TOKEN also honoured) | — |
AWS_REGION | S3 region | us-east-1 |
BUCKET_NAME | Bucket the MCP operates on | — |
S3_KEY_PREFIX | Optional key prefix all operations are scoped under | "" (bucket root) |
Helm Chart Options
# Storage configuration
persistence:
size: 10Gi
storageClass: standard
# Resource limits
resources:
limits:
cpu: 1000m
memory: 512Mi
requests:
cpu: 100m
memory: 128MiArchitecture
The server has a clean separation of concerns:
Session Wrapper (src/index.ts)
- MCP protocol session lifecycle (ID generation, tracking)
- Session metadata persistence (sessions.json)
- LRU eviction and cleanup
- Transport management
- Generic and reusable across MCP servers
Filesystem Adapter (src/adapters/filesystem/)
- File operations (read, write, edit, search, list, tree) against the local PVC
- Path validation and security
- Workspace management via
set_base_directory
S3 Adapter (src/adapters/s3/)
- The same MCP tools backed by an S3 bucket via
@aws-sdk/client-s3(objects addressed by key; “directories” are key prefixes) - Selected when
STORAGE_BACKEND=s3; talks to any S3-compatible endpoint (AWS_ENDPOINT_URL), including the in-cluster VersityGW
Shared Tool Schemas (src/adapters/shared/)
- Both adapters import their tool names and input schemas from one module, guaranteeing the two backends expose an identical tool surface (so Ark generates the same tool names either way)
Key Design Principles
- MCP sessions ≠ application state: Sessions track connections, not configuration
- Annotations as source of truth: Workspace configuration comes from Ark annotations
- Single base directory: All sessions share
/data/with user-specified subdirectories - No per-session directories: Workspaces are explicitly named and persistent
Security Considerations
- All filesystem operations are restricted to the configured base directory (
/data/) - Path traversal attacks are prevented through path validation
- Each workspace is isolated within its subdirectory
- Session limits prevent resource exhaustion
- Persistent storage should be properly secured with appropriate access controls
Uninstallation
Using Ark CLI:
ark uninstall marketplace/mcps/filesystem-mcp-serverUsing DevSpace:
cd mcps/filesystem-mcp-server
devspace purgeUsing Helm:
helm uninstall mcp-filesystem -n default