Skip to main content
Glama

cp

Copy files or directories within virtual filesystem workspaces to duplicate content across storage providers and scopes.

Instructions

Copy file or directory.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
requestYes

Implementation Reference

  • The primary handler for the 'cp' MCP tool. Resolves paths using WorkspaceManager and delegates the copy operation to the underlying VFS implementation.
    async def cp(self, request: CopyRequest) -> CopyResponse: """ Copy file or directory. Args: request: CopyRequest with source, dest, and recursive flag Returns: CopyResponse with success status """ vfs = self.workspace_manager.get_current_vfs() resolved_source = self.workspace_manager.resolve_path(request.source) resolved_dest = self.workspace_manager.resolve_path(request.dest) # Note: cp method doesn't have recursive parameter in AsyncVirtualFileSystem # It handles directories automatically await vfs.cp(resolved_source, resolved_dest) return CopyResponse(success=True, source=resolved_source, dest=resolved_dest)
  • MCP server registration of the 'cp' tool using the @server.tool decorator, which forwards calls to VFSTools.cp.
    @server.tool async def cp(request: CopyRequest): """Copy file or directory.""" return await vfs_tools.cp(request)
  • Pydantic models defining the input schema (CopyRequest) and output schema (CopyResponse) for the 'cp' tool.
    class CopyRequest(BaseModel): """Request to copy file/directory""" source: str dest: str recursive: bool = False class CopyResponse(BaseModel): """Response from cp operation""" success: bool source: str dest: str

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/chrishayuk/chuk-mcp-vfs'

If you have feedback or need assistance with the MCP directory API, please join our Discord server