Skip to main content

Use SFTP from ChatGPT and Claude.

ChatGPT and Claude have no built-in SFTP support. Write the transfer as a qbash Task in Python and call it from any AI chat over MCP.

The task.

A Python script on qbash that lists your partner SFTP directory, summarizes the first 1,000 rows of each CSV with a model, and returns the summaries to the chat that called it. Every run keeps a log of the files it read.

partner-sync.py
path = qbash.inputs.get("remote_path", "/incoming")

entries = qbash.integrations.sftp.list_files(path=path)["entries"]
summaries = []

for f in entries:
    if f["type"] != "file" or not f["name"].endswith(".csv"):
        continue
    sample = qbash.integrations.sftp.read_chunk(
        path=f"{path}/{f['name']}", startRow=0, rowCount=1000,
    )["rows"]
    summary = qbash.ai.run_prompt(
        slug="summarize-partner-data",
        variables={"filename": f["name"], "sample_rows": sample},
    )
    summaries.append({"file": f["name"], "brief": summary["brief"]})

qbash.output({"summaries": summaries})

    qbash Tasks.

    A Task is an AI automation written in Python, hosted on a managed runtime. A developer writes the script; anyone runs it from a form. Integrations, model calls, version control, and logging are built in.

    Model and provider agnostic.

    • Anthropic
    • OpenAI
    • Gemini
    • xAI
    • OpenRouter
    • Amazon
    • Perplexity
    • MoonshotAI
    • Meta
    • Qwen

    Running the SFTP task from ChatGPT.

    Connect qbash as an MCP server in ChatGPT, Claude Code, or Cursor. MCP lets your chat call tools you build. Someone says "pull the latest files from /incoming and summarize them" and the task runs.

      What the Task does before the chat sees anything.

      The Task reads and processes each file on qbash, and the chat receives the result.

      Chunked file processing

      read_chunk and read_lines iterate through a large CSV or line-based file without loading it all into memory. A checkpoint tracks which rows have been processed, so a restart picks up where it left off.

      chunk.py
      rows = qbash.integrations.sftp.read_chunk(
          path="/incoming/transactions.csv",
          startRow=0, rowCount=1000,
      )["rows"]
      
      results = qbash.parallel(
          process_row, rows,
          concurrency=5,
          checkpoint="txn-import",
          retry=3,
      )

      Structured extraction from each file

      Run a model over each file to classify it, extract structured fields, or write a summary. output_schema constrains the response to your JSON shape, so downstream code reads typed fields instead of parsing free text.

      extract.py
      invoice = qbash.ai.raw(
          instruction=f"Extract the invoice fields.
      {file_content}",
          output_schema={
              "type": "object",
              "properties": {
                  "vendor": {"type": "string"},
                  "amount": {"type": "number"},
                  "due_date": {"type": "string"},
              },
          },
      )

      Questions

      Can ChatGPT connect to an SFTP server directly?

      No. ChatGPT has no built-in SFTP support. The connection runs as a qbash task, and ChatGPT calls it via MCP.

      What is MCP?

      Model Context Protocol. A standard that lets AI chat tools call external tools during a conversation. Connect qbash as an MCP server and your shared tasks show up in ChatGPT, Claude Code, or Cursor.

      Do SFTP credentials go through ChatGPT?

      No. Credentials are stored in qbash and never reach the chat. The model has no access to connection details, and the person running the task never sees them.

      How large a file can the task handle?

      download_file accepts files up to 5 GB, and read_chunk reads a CSV in slices, so a large file never has to fit in memory.

      Does the file data go through the model?

      Only if the task code sends it to a model call. The SFTP transfer itself is a direct server-side connection.

      Does qbash support FTP as well as SFTP?

      Yes. The SFTP/FTP integration supports SFTP, FTP and FTPS, and the same methods (list_files, read_chunk, download_file) work for each.

      Competitor details reviewed . Vendors change plans and features without notice, so check theirs before deciding.

      Ship your first task.

      Connect your SFTP server, write the Task and call it from ChatGPT or Claude.