agentleFS
anatolykoptevanatolykoptev/n8n-mcp-agent/skills/create-credentials/SKILL.md

create-credentials

Skill0 starsChanged 10 months agoMITView on GitHub

Create n8n credentials using type-safe factory methods. Supports Google, Postgres, MySQL, Slack, Telegram, OpenAI, GitHub, and more.

The file

We split this skill into the rules it gives an agent

5 rules. About 0 are common, 5 are distinctive, and 0 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈5

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 0

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    All factory methods return:

    line 146
  2. Distinctive:

    Test Credentials: Verify connection after creation

    line 189
  3. Distinctive:

    Rotate Regularly: Update credentials periodically

    line 191
  4. Distinctive:

    Never log credential values

    line 196
  5. Distinctive:

    Use environment variables for sensitive data

    line 197

≈ “Common” is an estimate: at least 1 in 5 of the 350,495 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.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Create Credentials Skill

This skill provides type-safe credential creation for n8n integrations.

When to Use

  • Setting up new n8n integrations
  • Connecting to databases (Postgres, MySQL)
  • Configuring messaging services (Slack, Telegram)
  • Setting up AI services (OpenAI)
  • Connecting to APIs (GitHub, Notion, Airtable)

Available Credential Factories

Database Credentials

PostgreSQL

await credentialFactory.createPostgres(
  'My Postgres DB',    // name
  'db.example.com',    // host
  'myapp',             // database
  'admin',             // user
  'secret123',         // password
  5432,                // port (default: 5432)
  true                 // ssl (default: false)
)

MySQL

await credentialFactory.createMySql(
  'My MySQL DB',       // name
  'db.example.com',    // host
  'myapp',             // database
  'admin',             // user
  'secret123',         // password
  3306                 // port (default: 3306)
)

Messaging Credentials

Slack

await credentialFactory.createSlack(
  'Slack Bot',         // name
  'xoxb-xxx-xxx'       // Bot User OAuth Token
)

Telegram

await credentialFactory.createTelegram(
  'Telegram Bot',      // name
  '123456:ABC-xxx'     // Bot token from @BotFather
)

AI Credentials

OpenAI

await credentialFactory.createOpenAI(
  'OpenAI API',        // name
  'sk-xxx'             // API key
)

Cloud Service Credentials

Google Service Account

await credentialFactory.createGoogleServiceAccount(
  'Google Service',    // name
  'bot@project.iam.gserviceaccount.com', // email
  '-----BEGIN PRIVATE KEY-----\n...'     // PEM private key
)

GitHub

await credentialFactory.createGitHub(
  'GitHub Token',      // name
  'ghp_xxx'            // Personal access token
)

HTTP Authentication

Basic Auth

await credentialFactory.createHttpBasic(
  'API Basic Auth',    // name
  'username',          // username
  'password'           // password
)

API Key Header

await credentialFactory.createApiKey(
  'API Key',           // name
  'my-secret-key',     // API key value
  'X-API-Key'          // Header name (default: 'X-API-Key')
)

Other Services

Notion

await credentialFactory.createNotion(
  'Notion Integration', // name
  'secret_xxx'          // Integration token
)

Airtable

await credentialFactory.createAirtable(
  'Airtable API',      // name
  'patXXX'             // API key
)

SMTP (Email)

await credentialFactory.createSmtp(
  'SMTP Server',       // name
  'smtp.gmail.com',    // host
  587,                 // port
  'user@gmail.com',    // user
  'app-password',      // password
  true                 // secure TLS (default: true)
)

Result Format

All factory methods return:

interface CredentialResult {
  success: boolean
  credentialId?: string  // ID for use in workflows
  name?: string
  type?: string
  error?: string         // Error message if failed
}

Usage Example

// Create Slack credential
const slack = await credentialFactory.createSlack('My Slack', 'xoxb-token')

if (slack.success) {
  console.log(`Created credential: ${slack.credentialId}`)
  // Use in workflow nodes
} else {
  console.error(`Failed: ${slack.error}`)
}

Generic Credential Creation

For credential types not covered by factories:

await credentialFactory.create(
  'Custom Credential',
  'customApi',
  {
    apiKey: 'xxx',
    baseUrl: 'https://api.example.com'
  }
)

Best Practices

  1. Use Descriptive Names: Include environment (dev/prod) in name
  2. Don't Hardcode Secrets: Pass secrets from environment variables
  3. Test Credentials: Verify connection after creation
  4. Minimal Permissions: Request only needed scopes
  5. Rotate Regularly: Update credentials periodically

Security Notes

  • Credentials are encrypted in n8n
  • Never log credential values
  • Use environment variables for sensitive data
  • Delete unused credentials

Download now (ZIP)

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
What did you use it for? e.g. Reviewing pull requests in a Rails app

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.