KVdb · Capability

KVdb API

KVdb is a hosted serverless key-value database with a simple REST API. Buckets are namespaces of key-value pairs accessed over HTTPS using standard methods (GET, POST, PATCH, DELETE). KVdb supports access control via secret, read, and write keys, custom Lua scripts, and per-bucket TTLs.

Run with Naftiko KvdbAPI

What You Can Do

POST
Createbucket — Create bucket
/
PATCH
Updatebucket — Update bucket
/{bucket_id}
DELETE
Deletebucket — Delete bucket
/{bucket_id}
GET
Listkeys — List keys
/{bucket_id}
GET
Getkey — Get key value
/{bucket_id}/{key}
POST
Setkey — Set key value
/{bucket_id}/{key}
PATCH
Patchkey — Increment or decrement numeric value
/{bucket_id}/{key}
DELETE
Deletekey — Delete key
/{bucket_id}/{key}
PUT
Uploadscript — Upload script
/{bucket_id}/scripts/{script_name}
GET
Executescript — Execute script
/{bucket_id}/scripts/{script_name}

MCP Tools

createbucket

Create bucket

updatebucket

Update bucket

deletebucket

Delete bucket

idempotent
listkeys

List keys

read-only idempotent
getkey

Get key value

read-only idempotent
setkey

Set key value

patchkey

Increment or decrement numeric value

deletekey

Delete key

idempotent
uploadscript

Upload script

idempotent
executescript

Execute script

read-only idempotent

Capability Spec

kvdb-capability.yaml Raw ↑
naftiko: 1.0.0-alpha2
info:
  label: KVdb API
  description: KVdb is a hosted serverless key-value database with a simple REST API. Buckets are namespaces of key-value
    pairs accessed over HTTPS using standard methods (GET, POST, PATCH, DELETE). KVdb supports access control via secret,
    read, and write keys, custom Lua scripts, and per-bucket TTLs.
  tags:
  - Kvdb
  - API
  created: '2026-05-06'
  modified: '2026-05-06'
capability:
  consumes:
  - type: http
    namespace: kvdb
    baseUri: https://kvdb.io
    description: KVdb API HTTP API.
    authentication:
      type: basic
      username: '{{KVDB_USERNAME}}'
      password: '{{KVDB_PASSWORD}}'
    resources:
    - name: resource
      path: /
      operations:
      - name: createbucket
        method: POST
        description: Create bucket
        outputRawFormat: json
        outputParameters:
        - name: result
          type: object
          value: $.
    - name: bucket-id
      path: /{bucket_id}
      operations:
      - name: updatebucket
        method: PATCH
        description: Update bucket
        outputRawFormat: json
        outputParameters:
        - name: result
          type: object
          value: $.
      - name: deletebucket
        method: DELETE
        description: Delete bucket
        outputRawFormat: json
        outputParameters:
        - name: result
          type: object
          value: $.
      - name: listkeys
        method: GET
        description: List keys
        inputParameters:
        - name: prefix
          in: query
          type: string
        - name: limit
          in: query
          type: integer
        - name: format
          in: query
          type: string
        outputRawFormat: json
        outputParameters:
        - name: result
          type: object
          value: $.
    - name: bucket-id-key
      path: /{bucket_id}/{key}
      operations:
      - name: getkey
        method: GET
        description: Get key value
        outputRawFormat: json
        outputParameters:
        - name: result
          type: object
          value: $.
      - name: setkey
        method: POST
        description: Set key value
        outputRawFormat: json
        outputParameters:
        - name: result
          type: object
          value: $.
      - name: patchkey
        method: PATCH
        description: Increment or decrement numeric value
        outputRawFormat: json
        outputParameters:
        - name: result
          type: object
          value: $.
      - name: deletekey
        method: DELETE
        description: Delete key
        outputRawFormat: json
        outputParameters:
        - name: result
          type: object
          value: $.
    - name: bucket-id-scripts-script-name
      path: /{bucket_id}/scripts/{script_name}
      operations:
      - name: uploadscript
        method: PUT
        description: Upload script
        outputRawFormat: json
        outputParameters:
        - name: result
          type: object
          value: $.
      - name: executescript
        method: GET
        description: Execute script
        outputRawFormat: json
        outputParameters:
        - name: result
          type: object
          value: $.
  exposes:
  - type: rest
    port: 8080
    namespace: kvdb-rest
    description: REST adapter for KVdb API.
    resources:
    - path: /
      name: createbucket
      operations:
      - method: POST
        name: createbucket
        description: Create bucket
        call: kvdb.createbucket
        outputParameters:
        - type: object
          mapping: $.
    - path: /{bucket_id}
      name: updatebucket
      operations:
      - method: PATCH
        name: updatebucket
        description: Update bucket
        call: kvdb.updatebucket
        outputParameters:
        - type: object
          mapping: $.
    - path: /{bucket_id}
      name: deletebucket
      operations:
      - method: DELETE
        name: deletebucket
        description: Delete bucket
        call: kvdb.deletebucket
        outputParameters:
        - type: object
          mapping: $.
    - path: /{bucket_id}
      name: listkeys
      operations:
      - method: GET
        name: listkeys
        description: List keys
        call: kvdb.listkeys
        outputParameters:
        - type: object
          mapping: $.
    - path: /{bucket_id}/{key}
      name: getkey
      operations:
      - method: GET
        name: getkey
        description: Get key value
        call: kvdb.getkey
        outputParameters:
        - type: object
          mapping: $.
    - path: /{bucket_id}/{key}
      name: setkey
      operations:
      - method: POST
        name: setkey
        description: Set key value
        call: kvdb.setkey
        outputParameters:
        - type: object
          mapping: $.
    - path: /{bucket_id}/{key}
      name: patchkey
      operations:
      - method: PATCH
        name: patchkey
        description: Increment or decrement numeric value
        call: kvdb.patchkey
        outputParameters:
        - type: object
          mapping: $.
    - path: /{bucket_id}/{key}
      name: deletekey
      operations:
      - method: DELETE
        name: deletekey
        description: Delete key
        call: kvdb.deletekey
        outputParameters:
        - type: object
          mapping: $.
    - path: /{bucket_id}/scripts/{script_name}
      name: uploadscript
      operations:
      - method: PUT
        name: uploadscript
        description: Upload script
        call: kvdb.uploadscript
        outputParameters:
        - type: object
          mapping: $.
    - path: /{bucket_id}/scripts/{script_name}
      name: executescript
      operations:
      - method: GET
        name: executescript
        description: Execute script
        call: kvdb.executescript
        outputParameters:
        - type: object
          mapping: $.
  - type: mcp
    port: 9090
    namespace: kvdb-mcp
    transport: http
    description: MCP adapter for KVdb API for AI agent use.
    tools:
    - name: createbucket
      description: Create bucket
      hints:
        readOnly: false
        destructive: false
        idempotent: false
      call: kvdb.createbucket
      outputParameters:
      - type: object
        mapping: $.
    - name: updatebucket
      description: Update bucket
      hints:
        readOnly: false
        destructive: false
        idempotent: false
      call: kvdb.updatebucket
      outputParameters:
      - type: object
        mapping: $.
    - name: deletebucket
      description: Delete bucket
      hints:
        readOnly: false
        destructive: true
        idempotent: true
      call: kvdb.deletebucket
      outputParameters:
      - type: object
        mapping: $.
    - name: listkeys
      description: List keys
      hints:
        readOnly: true
        destructive: false
        idempotent: true
      call: kvdb.listkeys
      with:
        prefix: tools.prefix
        limit: tools.limit
        format: tools.format
      inputParameters:
      - name: prefix
        type: string
        description: prefix
      - name: limit
        type: integer
        description: limit
      - name: format
        type: string
        description: format
      outputParameters:
      - type: object
        mapping: $.
    - name: getkey
      description: Get key value
      hints:
        readOnly: true
        destructive: false
        idempotent: true
      call: kvdb.getkey
      outputParameters:
      - type: object
        mapping: $.
    - name: setkey
      description: Set key value
      hints:
        readOnly: false
        destructive: false
        idempotent: false
      call: kvdb.setkey
      outputParameters:
      - type: object
        mapping: $.
    - name: patchkey
      description: Increment or decrement numeric value
      hints:
        readOnly: false
        destructive: false
        idempotent: false
      call: kvdb.patchkey
      outputParameters:
      - type: object
        mapping: $.
    - name: deletekey
      description: Delete key
      hints:
        readOnly: false
        destructive: true
        idempotent: true
      call: kvdb.deletekey
      outputParameters:
      - type: object
        mapping: $.
    - name: uploadscript
      description: Upload script
      hints:
        readOnly: false
        destructive: false
        idempotent: true
      call: kvdb.uploadscript
      outputParameters:
      - type: object
        mapping: $.
    - name: executescript
      description: Execute script
      hints:
        readOnly: true
        destructive: false
        idempotent: true
      call: kvdb.executescript
      outputParameters:
      - type: object
        mapping: $.
binds:
- namespace: env
  keys:
    KVDB_USERNAME: KVDB_USERNAME
    KVDB_PASSWORD: KVDB_PASSWORD