e9-api-key
Skill1 starsChanged 48 days agoApache-2.0View on GitHub
Create and manage engine9 API keys (e9key_ / e9publickey_) — generic non-session auth whose scopes gate HTTP APIs (public signup/payment forms, inbound, Task API, and other routes). MCP apiKey covers catalog, list, get, create, update, revoke, rotate, SqlApiKeyStore (hash only), and a key-management UI. Use when working with API keys, e9key, e9k, scopes, rotate/revoke, public forms, or a keys admin screen.
We split this skill into the rules it gives an agent
4 rules. About 0 are common, 1 is distinctive, and 3 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈1
Distinctive · estimate
This author's own choices. Worth a look.
3
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 25
Rule: Never send an e9key_ or e9publickey_ credential to MCP.
- Very specific: line 45
Rule: Do not schedule SQLWorker.createApiKey (or rotate/revoke) via MCP task.
- Very specific: line 103
Create (plaintext in key, shown_once: true):
- Distinctive: line 125
Update permissions without rotating:
≈ “Common” is an estimate: at least 1 in 5 of the 308,232 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
engine9 API keys
engine9 API keys provide generic authentication for non-session HTTP callers, including public forms, inbound integrations, data routes, and the Task API. Use this skill to create, scope, rotate, revoke, or integrate e9key_ and e9publickey_ credentials. MCP and console users authenticate through sessions instead; API keys are for machines and other HTTP clients.
Quick reference
| Need | Use |
| Discover scopes and form fields | MCP apiKey with command: catalog |
| Create or manage a key | MCP apiKey with create, update, rotate, or revoke |
| Authenticate an HTTP request | Authorization: Bearer <key> plus X-ENGINE9-ACCOUNT-ID |
| Schedule tasks | Grant tasks:read and/or tasks:schedule |
| Use a public form | Grant public and only the required write scopes |
Rule: Never send an e9key_ or e9publickey_ credential to MCP.
Concepts
There is one key model; scopes decide what a key can do. The Task API is one consumer, not the definition of a key.
Typical callers:
- Public signup and payment forms (
public,people:write, …) - Site / inbound HTTP (
people:write,tables:write,data:read) - Machine integrations, including scheduling work (
tasks:read,tasks:schedule)
MCP (POST /mcp) stays on Firebase / session / localdev. That path is distinct. Keys remain the common mechanism for HTTP APIs: Authorization: Bearer e9key_… (or e9publickey_…) plus X-ENGINE9-ACCOUNT-ID. Do not send e9key_ to MCP, and do not send MCP session tokens to key-authenticated routes.
Humans manage keys through MCP apiKey. Machines use the issued secret on HTTP.
Storage and verification always go through @engine9/core (SqlApiKeyStore in the account api_key table). MCP does not invent a second store. Only the SHA-256 hash is retained; plaintext is returned once on create and rotate.
Workflow
Rule: Do not schedule SQLWorker.createApiKey (or rotate/revoke) via MCP task; the plaintext key would land in task run output.
| Need | Call |
| Known scopes + form fields | apiKey command: catalog (no account_id) |
| Keys on an account | apiKey command: list |
| One key (no secret) | apiKey command: get + id |
| New key | apiKey command: create — show key to the user immediately |
| Change name / scopes / role / expiry / active | apiKey command: update (does not rotate the secret) |
| Disable | apiKey command: revoke |
| New secret | apiKey command: rotate — show key once; old id is revoked |
CLI fallbacks (no MCP): server WorkerRunner e9 sqlworker createApiKey / listApiKeys / updateApiKey / revokeApiKey / rotateApiKey on a server account, or core npx e9 create-api-key on a core-only site (@engine9/core bin/e9.js — not the same binary as server bin/e9; see @engine9/core README “The e9 CLI”).
Scopes
The scope list is the permission model. The same key type covers forms, inbound, reads, and tasks; attach only the scopes that surface needs. Keys must list scopes at creation. Empty scopes deny every check. admin grants all scopes. Prefix follows scopes at create/rotate: public → e9publickey_…, otherwise e9key_…. Changing scopes later does not change an existing key's prefix — rotate if you need the other prefix.
Rule: Grant only the scopes required by the calling surface; empty scopes deny every permission check, while admin grants all scopes.
| Scope | Surface | Allows |
people:write | Core POST /people | Inbound people pipeline |
tables:write | Core POST /upsert/:table | Allowlisted table upserts |
data:read | Core GET /read/:name | Configured reads |
tasks:read | Task API | List/read flows and run status |
tasks:schedule | Task API | Schedule and control work |
admin | Any | All scopes |
public | Inbound / forms | Public ingest (e9publickey_ prefix) |
Constants: SCOPES from @engine9/core. Canonical list for UIs: MCP apiKey command: catalog → scopes[].
A public signup or payment form typically needs:
public,people:writeA partner that discovers flows and schedules tasks needs:
tasks:read,tasks:scheduleMCP examples
Catalog (build the permissions form from this — do not hardcode scopes):
{ "command": "catalog" }List:
{ "account_id": "<account_id>" }Create (plaintext in key, shown_once: true):
{
"command": "create",
"account_id": "<account_id>",
"name": "public-signup",
"scopes": ["public", "people:write"]
}Task-API partner (same key model, different scopes):
{
"command": "create",
"account_id": "<account_id>",
"name": "partner-tasks",
"scopes": ["tasks:read", "tasks:schedule"]
}Update permissions without rotating:
{
"command": "update",
"account_id": "<account_id>",
"id": "<key_id>",
"scopes": ["tasks:read"]
}Rotate / revoke: pass command and id. Rotate copies metadata when omitted.
List returns keys[]. Get/update/revoke return record. None of those include plaintext or key_hash. Create/rotate include plaintext in key once (shown_once: true) — display it and do not write it to files, chat logs, or task output.
Auth
- Managing keys: signed-in MCP user with access to
account_id(same gate assql/task). - Using keys:
Authorization: Bearer e9key_…+X-ENGINE9-ACCOUNT-IDon any HTTP route that verifies layer-1 keys (core site APIs, public forms, Task API, and other scoped endpoints). MCPPOST /mcpdoes not accepte9key_keys.
CLI (when MCP is not available)
e9 sqlworker createApiKey -a <account_id> --name partner-tasks --scopes tasks:read,tasks:schedule
e9 sqlworker listApiKeys -a <account_id>
e9 sqlworker updateApiKey -a <account_id> --id <key_id> --scopes tasks:read
e9 sqlworker rotateApiKey -a <account_id> --id <key_id>
e9 sqlworker revokeApiKey -a <account_id> --id <key_id>Core-only (no accounts.d):
npx e9 create-api-key --db sqlite://./engine9.db --name website --scopes adminRelated documentation
| Topic | Documentation |
| MCP login and tool behavior | e9-mcp |
| Task API authentication | authentication.md |
| Task API workflows | e9-tasks-api |
| Key-management UI contract | ui.md |
In this repository24 other files it gives its agents.
- .cursor/rules/no-client-names.mdcCursor rule
- .cursor/rules/skill-writing-standard.mdcCursor rule
- create-engine9-pluginSkill
- e9-cliSkill
- e9-custom-fieldsSkill
- e9-delegate-domainSkill
- e9-dev-tasksSkill
- e9-eqlSkill
- e9-exportSkill
- e9-funnelSkill
- e9-global-messageSkill
- e9-inputSkill
- e9-inventorySkill
- e9-mcpSkill
- e9-modelSkill
- e9-person-idSkill
- e9-person-remoteSkill
- e9-pii-freeSkill
- e9-pluginSkill
- e9-reportsSkill
- e9-source-codeSkill
- e9-tasks-apiSkill
- e9-timelineSkill
- e9-upgradeSkill
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

