# chaprola [Health: Active]

**Category:** 💬 Communication  
**Repository:** https://github.com/cletcher/chaprola-mcp  
**GitHub Stars:** 0  
**npm Downloads (last month):** 314  
**Views:** 0  
**Installs:** 0  
**Upvotes:** 0  
**Directory Page:** https://allmcps.com/mcp/chaprola-2

## Description
Serverless API backend: data storage, CRUD, querying, web search, email, scheduling

## Tools
Capabilities this server exposes over MCP:

- **chaprola_hello** — Health check — verify the Chaprola API is running
- **chaprola_help** — Get the full Chaprola documentation bundle from POST /help. Call this before guessing when compile or run fails. No auth required.
- **chaprola_register** — Register a new Chaprola account. Returns an API key — save it immediately
- **chaprola_login** — Login and get a new API key. WARNING: invalidates the previous API key
- **chaprola_check_username** — Check if a username is available before registering
- **chaprola_delete_account** — Delete an account and all associated data. Requires passcode confirmation
- **chaprola_baa_text** — Get the current Business Associate Agreement text and version. Present to human for review before signing
- **chaprola_report** — Run a published program and return output. No auth required — program must be published first via /publish
- **chaprola_report_params** — Get the parameter schema for a published report. Returns the .PF file as JSON — field names, types, and widths. Use this to discover what params a report accepts before calling chaprola_report.
- **chaprola_sign_baa** — Sign the BAA. STOP: You MUST call chaprola_baa_text first, show the FULL text to the human, and get their EXPLICIT typed approval before calling this. Never sign automatically. Only needed for PHI — non-PHI data works without a BAA.
- **chaprola_baa_status** — Check whether the authenticated user has signed the BAA
- **chaprola_import** — Import JSON data into Chaprola format files (.F + .DA). If the target file already exists, Chaprola preserves the existing schema, widens matching fields as needed, keeps legacy fields as blanks, and appends new fields at the end. Use chaprola_alter for explicit in-place schema surgery. Sign BAA first if handling PHI
- **chaprola_import_url** — Get a presigned S3 upload URL for large files (bypasses 6MB API Gateway limit). The subsequent chaprola_import_process preserves and widens an existing schema automatically when importing into an existing file.
- **chaprola_import_process** — Process a file previously uploaded to S3 via presigned URL. Generates .F + .DA files. If the target file already exists, the existing schema is preserved and widened automatically as needed.
- **chaprola_import_download** — Import data directly from a public URL (CSV, TSV, JSON, NDJSON, Parquet, Excel). Optional AI-powered schema inference.
- **chaprola_export** — Export Chaprola .DA + .F files back to JSON
- **chaprola_list** — List files in a project with optional wildcard pattern
- **chaprola_delete_file** — Delete a single file by S3 key. Pass the full key returned by chaprola_list (e.g., "remo/myproject/data/ORDERS.DA"). Destructive — there is no undo.
- **chaprola_delete_project** — Delete an entire project — every file under <userid>/<project>/ in S3. Destructive and not reversible. Lists in batches and removes up to 1000 keys per call until empty.
- **chaprola_rename_project** — Rename a project by copying every file from <userid>/<from>/ to <userid>/<to>/ and deleting the originals. Refuses to merge into an existing project — `to` must not exist yet. Object tags (publish state, etc.) are preserved.
- **chaprola_compile** — Compile Chaprola source (.CS) to bytecode (.PR). READ chaprola://cookbook BEFORE writing source.

AUTO-FIX (default ON): if the source has SQL/JS/Python hallucinations or other compile errors, the platform invokes its system-help expert, takes the corrected source, and recompiles ONCE. If the recompile is clean, the response is a normal success and `auto_fixed.applied` is `true` with the corrections summary + the fixed source. If it's still broken, you get the diagnostics array PLUS `auto_fixed.corrected_source` showing the LLM's best attempt — useful as a starting point for your next rewrite. Pass `systemhelp:"off"` to skip the auto-fix and get raw diagnostics only.

DIAGNOSTICS array: even when auto-fix doesn't apply, every detectable problem in the source comes back in one response — Phase A pre-syntactic guidance (foreign-language keywords, paren math, etc.), Phase B parse errors (up to 25 distinct, with line numbers), and Phase C codegen. No more "fix one error, recompile, see the next" loops.

STYLE RULES (mandatory — project review enforces these):
1. Use QUERY instead of SEEK loops for filtering or single-record lookup. SEEK loops only for processing every record unconditionally.
2. Don't use MOVE + IF EQUAL for comparisons — use QUERY WHERE.
3. Use implicit variable assignment (LET name = value) — don't use DEFINE VARIABLE.
4. END/STOP only for early exit — not needed at end of program.
5. Declare data dependencies in source: OPEN PRIMARY "name" for primary file and OPEN "name" for secondary. The compiler auto-loads format files from these statements; primary_format/secondary_format params are legacy and should not be used for new code.
6. Use named read (READ name rec + name.field) instead of OPEN SECONDARY + S.field for QUERY results.
7. Every program MUST have an intent file (.DS) — one paragraph: what the program does, parameters, output, who uses it.
8. Add a comment header — first lines describe purpose and parameters.
9. Use PRINT concatenation (PRINT "text" + P.field + R1), not MOVE + PRINT 0 buffers.
10. Use RECORDNUMBERS for bulk delete: QUERY INTO name, then DELETE PRIMARY name.RECORDNUMBERS.

KEY SYNTAX: no PROGRAM keyword (start with commands), no commas, LET supports one operation (no parentheses), no built-in functions. P.fieldname and S.fieldname addressing resolve automatically when the source declares OPEN PRIMARY "name" or OPEN "name" for the relevant data file — the compiler loads the format file from those statements. primary_format/secondary_format params exist as a legacy fallback only. If compile fails, call chaprola_help before retrying.
- **chaprola_run** — Execute a compiled .PR program. Use async:true for large datasets (>100K records). If runtime errors occur, call chaprola_help before retrying.
- **chaprola_run_status** — Check status of an async job. Returns full output when done
- **chaprola_run_each** — Run a compiled .PR program against every record in a data file. Like CHAPRPG from the original SCIOS. Use this for scoring, bulk updates, conditional logic across records.
- **chaprola_systemhelp** — Send your program name and error message. Chaprola will read your source, intent file, and data schema to diagnose and fix the problem. See POST /help for examples.
- **chaprola_publish** — Publish a compiled program for public access via /report
- **chaprola_unpublish** — Remove public access from a published program
- **chaprola_export_report** — Run a .PR program and save output as a persistent .R file in S3
- **chaprola_download** — Get a presigned S3 URL to download any file you own (1-hour expiry)
- **chaprola_query** — SQL-free data query with WHERE, SELECT, aggregation, ORDER BY, JOIN, pivot, DISTINCT, transforms, and Mercury scoring
- **chaprola_sort** — Sort a data file by one or more fields. Modifies the file in place
- **chaprola_index** — Build an index file (.IDX) for fast lookups on a field
- **chaprola_merge** — Merge two sorted data files into one. Both must share the same format (.F)
- **chaprola_format** — Inspect a data file's schema — returns field names, types, and PHI flags. Use this to understand the data structure before writing programs.
- **chaprola_alter** — Modify a data file's schema: widen/narrow/rename fields, add new fields, drop fields. NON-DESTRUCTIVE: Transforms existing data to match the new schema. Use this for explicit schema surgery on existing data files; re-imports now preserve and widen existing schemas automatically, but chaprola_alter still handles rename/drop/narrow operations.
- **chaprola_intent** — Read, write, or delete project and program intent descriptions. Project intent describes the purpose of a project. Program intent (.DS file) describes what a specific program does. Omit 'text' and 'delete' to read. Provide 'text' to write. Set 'delete: true' to remove.
- **chaprola_config** — Set project configuration. Currently supports phi_exempt (boolean) to disable automatic PHI detection for non-healthcare projects. Fields like step_name, task_name won't be flagged as PHI. Omit phi_exempt to read current config.
- **chaprola_optimize** — Run HULDRA nonlinear optimization using a compiled .PR as the objective evaluator
- **chaprola_optimize_status** — Check status of an async optimization job
- **chaprola_email_inbox** — List emails in a mailbox. Defaults to your primary mailbox; pass `mailbox` to read a sub-addressed mailbox under your namespace (e.g. if you are 'vogel', you can read 'vogel-fitlog-test'). Reads outside your namespace return 403.
- **chaprola_email_read** — Read a specific email by message_id. Defaults to your primary mailbox; pass `mailbox` to read from a sub-addressed mailbox under your namespace.
- **chaprola_email_send** — Send an email from your @chaprola.org address. Subject to content moderation
- **chaprola_email_delete** — Delete a specific email. Defaults to your primary mailbox; pass `mailbox` to delete from a sub-addressed mailbox under your namespace.
- **chaprola_email_forward** — Forward an email (with attachments) to another address. Reads the original email from your mailbox, includes all attachments, and sends via Resend.
- **chaprola_search** — Search the web via Brave Search API. Returns titles, URLs, and snippets. Optional AI-grounded summary. Rate limit: 10/day per user
- **chaprola_relations** — Read the project's relations.REL file — the durable schema metadata that describes how datafiles in the project link to each other. Written automatically by chaprola_import when nested.mode is "auto" or "explicit"; editable via /relations/{add,update,remove}.

Use this BEFORE writing a multi-file program so you know which file is the parent, which is the child, what the FK column is named, and whether cascade_delete / cascade_update is on. Saves a round-trip of stat'ing each .F file individually.

Response shape:

```json
{
  "version": "1.0",
  "project": "...",
  "updated_at": "...",
  "datafiles": {
    "USERS": {"primary_key": ["user_id"], "source_path": "users"},
    "USERS_ORDERS": {"primary_key": ["order_id"], "source_path": "users.orders", "parent_fk": "user_id"}
  },
  "relationships": [
    {
      "id": "users__orders",
      "kind": "containment",
      "parent": {"datafile": "USERS",        "field": "user_id"},
      "child":  {"datafile": "USERS_ORDERS", "field": "user_id"},
      "cardinality": "one-many",
      "match": "strict",
      "cascade_update": true,
      "cascade_delete": true
    }
  ]
}
```

If the project has never been imported with nested.mode set, returns `{"status":"empty","datafiles":{},"relationships":[]}`. Empty is not an error.
- **chaprola_rag_search** — Retrieval over the Chaprola code corpus — find worked examples, gotcha notes, and doc sections that match your task. Stitch the top results into your prompt before generating .CS source so your fix tracks real working programs instead of training-time priors.

Four collections live behind one endpoint:
- `apps` (1000) — full app payloads (spec + target.CS + target.DS + format.F + sample.json + source SQL). Default.
- `golden` (25) — hand-picked exemplars covering every Chaprola pattern (P1–P8) and every major SQL feature. High-signal floor; also payload.notes is populated with the gotcha text.
- `notes` (~400) — free-form gotcha text per app. Query on error messages or tricky-construct names.
- `docs` (~80) — sections from COOKBOOK.md, FORMAT_STANDARDS.md, ENDPOINTS.md.

Filter grammar: bare array (any-of), {eq}, {in}, {lte}/{gte}/{between}. Filterable fields per collection: apps + notes + golden have category, bucket, complexity, sql_features, chaprola_patterns; golden adds golden + why_chosen; docs has doc_source, format. Unknown filter keys return 400 with the valid-key list.

Tactic: when writing a new .CS, query `apps` AND `golden`, pin the top 1–2 golden hits regardless of apps ranking. When stuck on a compile error, query `notes` with the error text. When unsure of syntax, query `docs`.
- **chaprola_fetch** — Fetch any URL and return clean content. HTML pages converted to markdown. SSRF-protected. Rate limit: 20/day per user
- **chaprola_schedule** — Create a scheduled job that runs a Chaprola endpoint on a recurring cron. Max 10 schedules/user, 15-min minimum interval
- **chaprola_schedule_list** — List all scheduled jobs for the authenticated user with run history and next execution time
- **chaprola_schedule_delete** — Delete a scheduled job by name
- **chaprola_insert_record** — Insert one or more records into a data file. For single insert, use record. For batch insert (up to 1000), use records. All records are validated before any writes — invalid batch = no partial writes.
- **chaprola_upsert_record** — Insert or update a record by key field. If a record with the matching key value exists, update it. If not, insert it. Batch supported via records array.
- **chaprola_update_record** — Update fields in a single record matched by a where clause. If no sort-key changes, updates in place; otherwise marks old record ignored and appends to merge file.
- **chaprola_delete_record** — Delete a single record matched by a where clause. Marks the record as ignored (.IGN). Physically removed on consolidation.
- **chaprola_consolidate** — Merge a .MRG file into its parent .DA, producing a clean sorted data file. Deletes .MRG and .IGN after success. Aborts if .MRG was modified during the operation.
- **chaprola_challenge** — Data health check: finds missing data, overdue dates, and incomplete records. Returns issues sorted by severity.
- **chaprola_create_site_key** — Create an origin-locked site key for frontend JavaScript. Site keys are restricted to specific origins and endpoints, safe to embed in public code.
- **chaprola_list_site_keys** — List all site keys for the authenticated user. Shows label, allowed origins/endpoints, and creation date.
- **chaprola_delete_site_key** — Delete a site key. Requires the full site key value (site_...).
- **chaprola_app_deploy** — Deploy a static web app (HTML/JS/CSS) to chaprola.org/apps/{userid}/{project}/. Returns a presigned upload URL for a .zip or .tar.gz archive.
- **chaprola_app_deploy_process** — Process a staged app archive and deploy files to chaprola.org/apps/{userid}/{project}/
- **chaprola_app_upload** — Get a presigned URL to upload a single file to a deployed app at chaprola.org/apps/{userid}/{project}/{path}
- **chaprola_app_upload_inline** — Upload a single file's contents inline (no presigned PUT, no curl step). Use this for hot-fixes to one HTML/JS/CSS file. Max 3 MB raw payload. For larger files, use chaprola_app_upload.
- **chaprola_app_deploy_inline** — Deploy a base64-encoded tar.gz or zip archive in one call — no presigned PUT, no curl step. Max 3 MB raw (~4 MB base64). For larger bundles use chaprola_app_deploy.

## Claude Desktop Quick Installation
Install path detected from listing signals. Uses `npx` (confidence: high):

```json
"mcpServers": {
  "chaprola": {
    "command": "npx",
    "args": ["-y","@chaprola/mcp-server"],
    "env": {
      "CHAPROLA_USERNAME": "",
      "CHAPROLA_API_KEY": ""
    }
  }
}
```

**Requires environment variables:** `CHAPROLA_USERNAME`, `CHAPROLA_API_KEY` — the values above are empty placeholders; fill in real credentials before running (see the repository for what each one is for).

## Documentation

## What the chaprola MCP server does

The chaprola MCP server exposes Chaprola’s agent-facing data platform through MCP tools. It supports account operations, structured data storage, file import and export, data transformation, program execution, optimization, web access, email, and recurring jobs.

Data workflows can import JSON directly, process an uploaded file, or retrieve CSV, Excel, JSON, or Parquet data from a URL. Agents can list files, export data as JSON, request download URLs, and use query operations for filtering, aggregation, and joins. Additional tools sort files, build indexes, and merge sorted files.

The server also exposes Chaprola’s program workflow. An agent can compile `.CS` source into `.PR` bytecode, run programs, inspect asynchronous job status, publish or unpublish programs, run a published program without authentication, and save report output. HULDRA nonlinear optimization is available through optimization and status tools.

Web search uses the Brave API, while URL fetching can return content as markdown, text, or JSON. Email tools cover inbox listing, message reading, sending, and deletion. Scheduling tools create, list, and delete recurring jobs.

## How it works

The chaprola MCP server communicates with the Chaprola API over MCP tool calls. It uses the username and API key supplied in its environment for authenticated operations. Account tools can register a user, log in for a new API key, check username availability, or delete an account and its data.

Some operations use asynchronous jobs. The corresponding status tools let an agent check the progress of program runs or optimization tasks. Upload and download workflows use presigned URLs: one tool obtains an upload URL, another processes the uploaded file, and download tools retrieve access URLs for stored output.

The server also publishes MCP resources for the Chaprola cookbook, endpoint reference, authentication guidance, and common mistakes. These resources can help an agent construct requests without leaving the MCP client.

## Setup and configuration

Install the chaprola MCP server with `npx @chaprola/mcp-server` and configure it as a stdio server in the MCP client. Set `CHAPROLA_USERNAME` to a registered username and `CHAPROLA_API_KEY` to the associated key. The documented configurations cover Claude Code, Claude Desktop, VS Code with Copilot, and Cursor.

Credentials can be created with the registration tool or by sending a registration request to Chaprola’s API. Save the returned API key. After adding the server in Claude Code, restart the client so its description and tools load.

## Tools and capabilities

The tool set includes:

- Account creation, login, username checks, deletion, and health checks.
- BAA text, status, and signing operations for PHI-related use.
- JSON, CSV, Excel, and Parquet import paths plus JSON export.
- Filtering, aggregation, joins, sorting, indexing, and file merging.
- Compilation, execution, publishing, reporting, and asynchronous status checks.
- Web search, URL fetching, email management, and recurring schedules.

## Limitations and notes

Non-PHI data can be used without a signed BAA. Handling Protected Health Information requires a human to review and sign the BAA first; the server includes warnings when that requirement has not been met. API access also depends on valid Chaprola credentials, and public program reporting is the documented unauthenticated execution path.

_Full upstream README: https://allmcps.com/mcp/chaprola-2/readme_

