Skip to content

Databases

Pencel includes five database and enterprise data integrations that let your agents query, read, and write data directly. Whether you keep operational data in PostgreSQL, use SQLite for local datasets, cache results in Redis, or connect to enterprise systems like SAP or Workday, your agents can work with your data without exporting files or building custom scripts.

PostgreSQL

Trust LevelVerified
TransportBuiltin
Package@modelcontextprotocol/server-postgres
ActivationWhen relevant recommended

What Your Agent Can Do

  • Run SQL queries against your PostgreSQL database.
  • Read table schemas and column definitions.
  • Insert, update, and delete rows.
  • List tables and views.

Setup

Step 1: Gather Your Connection String

You need a PostgreSQL connection string in this format:

postgresql://username:password@host:port/database

For example: postgresql://ops_user:s3cret@db.example.com:5432/operations

Step 2: Add the Connection

  1. Open Settings > Connections.
  2. Click Add Connection and select PostgreSQL from the catalog.
  3. Paste your connection string into the credential field.
  4. Click Connect.

Pencel tests the connection and shows the available tools on your connection card.

WARNING

Your agent can run any SQL statement your database user allows — including writes and deletes. Use a read-only database user for reporting workflows. Create a dedicated user with limited permissions rather than using your admin credentials.

Example: Daily KPI Dashboard

Query the orders table for all orders placed yesterday. Calculate total revenue, order count, and average order value. Also query the customers table for new signups yesterday. Format the results as a daily KPI report and save to /reports/daily-kpi-[date].md.

Example: Data Quality Check

List all tables in the public schema. For each table, count rows where email is null or created_at is in the future. Flag any table with more than 1% anomalous rows. Write a data quality report.


SQLite

Trust LevelVerified
TransportBuiltin
Packagemcp-server-sqlite-npx
ActivationManual recommended

What Your Agent Can Do

  • Run SQL queries against a local SQLite database file.
  • Read table schemas.
  • Create tables and insert data.
  • Export query results.

Setup

Step 1: Locate Your Database File

You need the file path to your SQLite database. For example:

/Users/you/data/operations.db

Step 2: Add the Connection

  1. Open Settings > Connections.
  2. Click Add Connection and select SQLite from the catalog.
  3. Enter the full path to your database file.
  4. Click Connect.

TIP

SQLite databases are single files. You can point your agent at any .db, .sqlite, or .sqlite3 file on your machine. This is great for analyzing exported datasets or local application databases.

Example: Analyze an Exported Dataset

Open the SQLite database at /Users/me/data/survey-results.db. List all tables. Query the responses table and calculate the average satisfaction score grouped by department. Identify the department with the lowest score and list the top 3 most common complaints from that department.

Example: Build a Local Report Database

Create a table called weekly_metrics with columns: week_start (date), revenue (decimal), new_customers (integer), churn_rate (decimal). Insert the last 12 weeks of data from the workspace file /data/metrics.csv. Then query for weeks where churn_rate exceeded 5%.


Redis

Trust LevelVerified
TransportBuiltin
Package@modelcontextprotocol/server-redis
ActivationManual recommended

What Your Agent Can Do

  • Read and write key-value pairs.
  • List keys by pattern.
  • Read hash fields.
  • Check key expiration and TTL.
  • Work with lists and sets.

Setup

Step 1: Get Your Redis URL

You need a Redis connection URL:

redis://username:password@host:port

For local Redis with no password: redis://localhost:6379

For hosted Redis (e.g., Upstash, Redis Cloud): check your provider's dashboard for the connection URL.

Step 2: Add the Connection

  1. Open Settings > Connections.
  2. Click Add Connection and select Redis from the catalog.
  3. Enter your Redis URL.
  4. Click Connect.

INFO

Redis is an in-memory data store. It is often used for caching, session data, and real-time counters. If your operational data lives in Redis, this integration lets your agents access it directly.

Example: Cache Status Check

List all Redis keys matching the pattern cache:*. For each key, check the TTL (time to live). Flag any keys that have no expiration set (TTL = -1) and any keys expiring in the next 5 minutes. Summarize the total number of cached items and their expiration distribution.

Example: Feature Flag Audit

Read all Redis keys matching feature:*. For each key, get the value (enabled/disabled). List all enabled feature flags and all disabled ones. Compare with the feature flags documented in /config/features.md and flag any discrepancies.


SAP S/4HANA

Trust LevelCommunity
TransportBuiltin
ActivationManual recommended

What Your Agent Can Do

  • Access general ledger, accounts payable, and accounts receivable data.
  • Read fixed assets and consolidation (BPC) data.
  • Query user administration and transport management.
  • Pull ERP core data for reporting and analysis.

Setup

Step 1: Gather Your SAP Credentials

You need:

  • SAP Username — your SAP system login (e.g., MCHEN)
  • SAP Password — your SAP system password
  • SAP Host — the hostname of your SAP system (e.g., erp.company.sap.com)
  • Client Number — the SAP client number (e.g., 100)

Step 2: Add the Connection

  1. Open Settings > Connections.
  2. Click Add Connection and select SAP S/4HANA from the catalog.
  3. Enter your username, password, host, and client number.
  4. Click Connect.

WARNING

This is a community integration and is not reviewed by Pencel. SAP credentials grant access to sensitive financial and HR data. Use a dedicated service account with the minimum permissions needed for your workflows.

Example: Monthly GL Summary

Query the general ledger for all postings in the current month. Group by cost center and summarize total debits and credits. Flag any cost center where actuals exceed budget by more than 10%. Save the report to /reports/gl-summary-[month].md.


Workday

Trust LevelCommunity
TransportBuiltin
ActivationManual recommended

What Your Agent Can Do

  • Read employee data and organizational charts.
  • Access compensation and PTO information.
  • Query payroll integration data.
  • Browse HR and finance records.

Setup

Step 1: Gather Your Workday Credentials

You need:

  • Integration Token — a Workday API token (starts with wd_)
  • Tenant URL — your Workday tenant URL (e.g., https://company.myworkday.com)

Step 2: Add the Connection

  1. Open Settings > Connections.
  2. Click Add Connection and select Workday from the catalog.
  3. Enter your integration token and tenant URL.
  4. Click Connect.

WARNING

This is a community integration and is not reviewed by Pencel. Workday contains sensitive employee and financial data. Use a dedicated integration user with read-only access where possible.

Example: PTO Summary Report

Query Workday for all employees in the Engineering department. For each employee, pull their remaining PTO balance and any pending PTO requests. Identify anyone with more than 15 unused days. Save the report to /reports/pto-summary-[date].md.


Security Best Practices

All three database integrations connect directly to your data. Follow these guidelines:

  • Use read-only credentials for reporting and analysis workflows. Only grant write access when your workflow explicitly needs it.
  • Limit network access — if your database is cloud-hosted, restrict connections to your IP address.
  • Rotate credentials regularly, especially for production databases.
  • Test with non-production data first. Point your agent at a staging database or a copy of your data while building workflows.
  • Review the Runs log after each run to see exactly which queries your agent executed.

WARNING

Database integrations can modify your data. Always test workflows against a non-production database before running them against live data.