Skip to content

Commit b5586d7

Browse files
anubissbeclaude
andcommitted
fix: Add volumes field to MCPConfig for proper volume mounting
- Added volumes field to MCPConfig struct in both backend and frontend - Updated buildDockerCommand to handle general volume mappings - Fixed catalog predefined configs to use volumes field 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
1 parent c507435 commit b5586d7

File tree

4 files changed

+13
-0
lines changed

4 files changed

+13
-0
lines changed

backend/mcp/catalog.go

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -269,6 +269,9 @@ func GetPredefinedConfig(fullName string) (*MCPConfig, error) {
269269
Env: map[string]string{
270270
"MCP_PORT": "9000",
271271
},
272+
Volumes: map[string]string{
273+
"/home": "/workspace",
274+
},
272275
Filesystem: &FilesystemConfig{
273276
RootPath: "/home",
274277
ReadOnly: false,
@@ -282,6 +285,9 @@ func GetPredefinedConfig(fullName string) (*MCPConfig, error) {
282285
"MCP_PORT": "9000",
283286
"DOCKER_HOST": "unix:///var/run/docker.sock",
284287
},
288+
Volumes: map[string]string{
289+
"/var/run/docker.sock": "/var/run/docker.sock",
290+
},
285291
Docker: &DockerConfig{
286292
SocketPath: "/var/run/docker.sock",
287293
APIVersion: "1.41",

backend/mcp/manager.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -252,6 +252,11 @@ func (m *Manager) buildDockerCommand(server *MCPServer) string {
252252
cmd += fmt.Sprintf(" -e %s=%s", k, v)
253253
}
254254

255+
// Add volumes
256+
for src, dst := range server.Config.Volumes {
257+
cmd += fmt.Sprintf(" -v %s:%s", src, dst)
258+
}
259+
255260
// Add type-specific configurations
256261
switch server.Type {
257262
case "filesystem":

backend/mcp/types.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ type MCPConfig struct {
2222
Image string `json:"image"`
2323
Command []string `json:"command,omitempty"`
2424
Env map[string]string `json:"env,omitempty"`
25+
Volumes map[string]string `json:"volumes,omitempty"`
2526

2627
// Type-specific fields
2728
Filesystem *FilesystemConfig `json:"filesystem,omitempty"`

ui/src/components/MCP/types.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ export interface MCPConfig {
1313
image: string;
1414
command?: string[];
1515
env?: Record<string, string>;
16+
volumes?: Record<string, string>;
1617
filesystem?: FilesystemConfig;
1718
docker?: DockerConfig;
1819
shell?: ShellConfig;

0 commit comments

Comments
 (0)