feat(mcp): Git Operations MCP - Workspace Management #107

Open
opened 2026-01-06 19:19:03 +00:00 by cardosofelipe · 0 comments

Parent Issue

Part of #58 (Git Operations MCP Server)

Summary

Implement workspace management for isolating git repositories per project.

Tasks

WorkspaceManager Class (workspace.py)

  • Create WorkspaceManager class
  • Define workspace base path (/var/syndarix/workspaces/)
  • Implement get_workspace(project_id) method
  • Implement create_workspace(project_id) method
  • Implement delete_workspace(project_id) method
  • Implement workspace directory structure per project
  • Add workspace cleanup for stale workspaces (>7 days unused)
  • Implement workspace locking to prevent concurrent access
  • Handle disk space monitoring
  • Add workspace size limits per project

Security

  • Validate project_id to prevent path traversal
  • Ensure workspaces are isolated
  • Implement proper file permissions

Testing

  • Unit tests for all workspace operations
  • Test concurrent access locking
  • Test cleanup of stale workspaces
  • Test path traversal prevention
  • Achieve >90% coverage

Acceptance Criteria

  • Workspaces properly isolated per project
  • No path traversal vulnerabilities
  • Concurrent access handled correctly
  • Stale workspace cleanup works
  • All tests pass

Dependencies

  • Depends on: #64 (Foundation)

Labels

  • mcp
  • phase-2
  • backend
## Parent Issue Part of #58 (Git Operations MCP Server) ## Summary Implement workspace management for isolating git repositories per project. ## Tasks ### WorkspaceManager Class (`workspace.py`) - [ ] Create `WorkspaceManager` class - [ ] Define workspace base path (`/var/syndarix/workspaces/`) - [ ] Implement `get_workspace(project_id)` method - [ ] Implement `create_workspace(project_id)` method - [ ] Implement `delete_workspace(project_id)` method - [ ] Implement workspace directory structure per project - [ ] Add workspace cleanup for stale workspaces (>7 days unused) - [ ] Implement workspace locking to prevent concurrent access - [ ] Handle disk space monitoring - [ ] Add workspace size limits per project ### Security - [ ] Validate project_id to prevent path traversal - [ ] Ensure workspaces are isolated - [ ] Implement proper file permissions ### Testing - [ ] Unit tests for all workspace operations - [ ] Test concurrent access locking - [ ] Test cleanup of stale workspaces - [ ] Test path traversal prevention - [ ] Achieve >90% coverage ## Acceptance Criteria - [ ] Workspaces properly isolated per project - [ ] No path traversal vulnerabilities - [ ] Concurrent access handled correctly - [ ] Stale workspace cleanup works - [ ] All tests pass ## Dependencies - Depends on: #64 (Foundation) ## Labels - mcp - phase-2 - backend
Sign in to join this conversation.