Skip to content

About

Tools to help Claude connect to NextCloud to help with project management and files.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Repository files navigation

nextcloud-connect — scoped NextCloud access for Claude

Small CLI tooling that lets Claude (the assistant) read and write a scoped slice of one or more NextCloud instances — shared Deck boards for planning and shared Files folders — using a dedicated, limited service account per instance rather than admin credentials.

Each instance gets a directory under instances/<name>/ holding its .env, and a scratch area under scratch/<name>/. Every tool selects the instance via the NC_INSTANCE env var (e.g. NC_INSTANCE=sproutz scripts/deck GET /boards) and fails loudly when it's unset.

Why a dedicated account

A NextCloud app password authenticates as the whole user; it can't be restricted per-app or per-board. Permission is scoped at the user level instead. So access is granted by:

  1. Creating a non-admin user (claude).
  2. Sharing only specific resources with it (one Deck board, one folder).
  3. Generating an app password for that user.

If the on-disk credential ever leaks, the blast radius is just what's been shared with claude, and you revoke a single app password.

Setup

  1. Create the user. As admin, create a non-admin NextCloud user, e.g. claude.

  2. Generate an app password. App passwords are self-service — you must do this as the claude user (admin can't mint one for another account from the admin UI). Log in as claude → Settings → Security → Create new app password. Copy it (shown once).

  3. Share resources with claude:

    • Deck: open the planning board → board menu → Sharing → add claude → grant edit (and manage only if Claude should create or delete stacks/archive the board).
    • Files: open the folder → Share → add claude → read or read/write.
    • Forms: open the form → Share → add claude (or a group it is in). Forms the account creates itself are owned by it.
  4. Create the instance config from the sample (instances/*/.env is gitignored):

    mkdir -p instances/<name> scratch/<name>
    cp instances/sample.env instances/<name>/.env
    chmod 600 instances/<name>/.env   # it's a plaintext secret
    

    Then edit instances/<name>/.env with your instance URL, the service account username, and the app password from step 2:

    NEXTCLOUD_URL=https://nextcloud.example.com
    NEXTCLOUD_USER=claude
    NEXTCLOUD_APP_PASSWORD=<the app password from step 2>
    

    Record the instance-specific details (shared folder names, board ids) where your Claude sessions will see them — e.g. ~/.claude/tools.md.

  5. Install dependencies: npm install (pulls webdav and node-jq).

What this enables Claude to do

  • Plan in Deck: list boards, read/create/move/edit/delete stacks and cards on the shared board.
  • Work with Files: list directories, read files, upload/update files, create directories, and delete within the shared folder.
  • Run surveys in Forms: create forms from a JSON spec, read forms shared with the account, and export their responses as JSON.

What you can ask of Claude

  • "What's on the planning board?" / "Add a card to for ."
  • "Move to Done." / "Summarize the cards in ."
  • "Read <shared-folder>/<file>." / "Save these notes to <shared-folder>/<path>."

Claude only ever sees what's shared with the service account — nothing else on the instance.

Tooling

Copy CLAUDE.md.sample to CLAUDE.md (gitignored) and fill in your instance-specific details. It documents the deck, forms, dav, and jq commands.

About

Tools to help Claude connect to NextCloud to help with project management and files.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages