Skip to main content
Glama

create-credential

Create credentials for n8n workflow nodes to authenticate with external services like Cloudflare, GitHub, and Slack. Use get-credential-schema first to identify required fields.

Instructions

Create a credential that can be used by nodes of the specified type. The credential type name can be found in the n8n UI when creating credentials (e.g., 'cloudflareApi', 'githubApi', 'slackOAuth2Api'). Use get-credential-schema first to see what fields are required for the credential type you want to create.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
clientIdYes
nameYes
typeYes
dataYes

Implementation Reference

  • MCP tool handler for 'create-credential' that validates client existence, calls N8nClient.createCredential, and returns success or error response.
    case "create-credential": { const { clientId, name, type, data } = args as { clientId: string; name: string; type: string; data: Record<string, any>; }; const client = clients.get(clientId); if (!client) { return { content: [{ type: "text", text: "Client not initialized. Please run init-n8n first.", }], isError: true }; } try { const credential = await client.createCredential(name, type, data); return { content: [{ type: "text", text: `Successfully created credential:\n${JSON.stringify(credential, null, 2)}`, }] }; } catch (error) { return { content: [{ type: "text", text: error instanceof Error ? error.message : "Unknown error occurred", }], isError: true }; }
  • N8nClient method that performs the actual POST request to n8n API /credentials endpoint to create a new credential.
    async createCredential(name: string, type: string, data: Record<string, any>): Promise<any> { return this.makeRequest('/credentials', { method: 'POST', body: JSON.stringify({ name, type, data }), }); }
  • Input schema definition for the create-credential tool, specifying required parameters: clientId, name, type, data.
    inputSchema: { type: "object", properties: { clientId: { type: "string" }, name: { type: "string" }, type: { type: "string" }, data: { type: "object" } }, required: ["clientId", "name", "type", "data"] } },
  • src/index.ts:652-664 (registration)
    Tool registration in the listTools response, including name, description, and inputSchema for create-credential.
    name: "create-credential", description: "Create a credential that can be used by nodes of the specified type. The credential type name can be found in the n8n UI when creating credentials (e.g., 'cloudflareApi', 'githubApi', 'slackOAuth2Api'). Use get-credential-schema first to see what fields are required for the credential type you want to create.", inputSchema: { type: "object", properties: { clientId: { type: "string" }, name: { type: "string" }, type: { type: "string" }, data: { type: "object" } }, required: ["clientId", "name", "type", "data"] } },

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/illuminaresolutions/n8n-mcp-server'

If you have feedback or need assistance with the MCP directory API, please join our Discord server