Skip to content

Add shell server MCP image for Harbor integration#58

Open
dzorlu wants to merge 1 commit intomainfrom
feat/shell-server
Open

Add shell server MCP image for Harbor integration#58
dzorlu wants to merge 1 commit intomainfrom
feat/shell-server

Conversation

@dzorlu
Copy link
Collaborator

@dzorlu dzorlu commented Feb 7, 2026

Summary

Add a new MCP server that provides bash execution and file operations, enabling Harbor to use Fleet environments for agent evaluation.

Tools provided

Tool Description
bash_exec Execute bash commands with timeout support
file_read Read file contents (text or base64 for binary)
file_write Write content to files (text or base64)
file_list List directory contents
file_delete Delete files or empty directories

Files

  • fleet/agent/shell_server/main.py - MCP server entry point
  • fleet/agent/shell_server/tools.py - Tool definitions
  • fleet/agent/shell_server/Dockerfile - Container image
  • fleet/agent/shell_server/requirements.txt - Dependencies

Usage

This enables Harbor's BaseEnvironment interface to work with Fleet:

# Harbor FleetEnvironment uses these tools:
await exec("ls -la")           # -> bash_exec
await upload_file(...)         # -> file_write  
await download_file(...)       # -> file_read

Related

🤖 Generated with Claude Code

Add a new MCP server that provides bash execution and file operations,
enabling Harbor to use Fleet environments for agent evaluation.

Tools provided:
- bash_exec: Execute bash commands with timeout support
- file_read: Read file contents (text or base64 binary)
- file_write: Write content to files
- file_list: List directory contents
- file_delete: Delete files/empty directories

This enables Harbor's BaseEnvironment interface (exec, upload_file,
download_file) to work with Fleet cloud environments.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
Copy link

@cursor cursor bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Bugbot Autofix is OFF. To automatically fix reported issues with Cloud Agents, enable Autofix in the Cursor dashboard.

return {"error": str(e)}
except PermissionError:
logger.warning(f"file_delete permission denied: {path}")
return {"error": f"Permission denied: {path}"}
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unreachable PermissionError handler due to OSError ordering

Medium Severity

In file_delete, the except OSError handler on line 229 is placed before the except PermissionError handler on line 233. Since PermissionError is a subclass of OSError, permission errors will always be caught by the OSError block first, making the PermissionError handler dead code. This means permission-denied deletions won't get the specific warning log or the user-friendly "Permission denied" message — they'll fall through the generic OSError path instead. The other tools (file_read, file_write, file_list) all correctly place PermissionError before their broader exception handlers.

Fix in Cursor Fix in Web

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant