@stacklabdigital/chatwoot-mcp
Advanced tools
Comparing version
@@ -218,12 +218,15 @@ #!/usr/bin/env node | ||
const config = {}; | ||
for (let i = 0; i < args.length; i += 2) { | ||
for (let i = 0; i < args.length; i++) { | ||
const flag = args[i]; | ||
const value = args[i + 1]; | ||
switch (flag) { | ||
case '--url': | ||
if (flag === '--stdio') { | ||
config.stdio = true; | ||
continue; | ||
} | ||
if (flag === '--url' || flag === '--token') { | ||
const value = args[i + 1]; | ||
if (flag === '--url') | ||
config.baseUrl = value; | ||
break; | ||
case '--token': | ||
if (flag === '--token') | ||
config.apiKey = value; | ||
break; | ||
i++; // Skip next argument as it's the value | ||
} | ||
@@ -237,4 +240,4 @@ } | ||
if (!config.baseUrl || !config.apiKey) { | ||
console.error('Uso: npx @seu-usuario/chatwoot-mcp --url <URL_BASE> --token <API_TOKEN>'); | ||
console.error('Exemplo: npx @seu-usuario/chatwoot-mcp --url https://app.chatwoot.com --token seu-token-api'); | ||
console.error('Uso: npx @stacklabdigital/chatwoot-mcp --url <URL_BASE> --token <API_TOKEN> [--stdio]'); | ||
console.error('Exemplo: npx @stacklabdigital/chatwoot-mcp --url https://app.chatwoot.com --token seu-token-api --stdio'); | ||
process.exit(1); | ||
@@ -241,0 +244,0 @@ } |
{ | ||
"name": "@stacklabdigital/chatwoot-mcp", | ||
"version": "1.0.0", | ||
"version": "1.0.1", | ||
"description": "Servidor MCP para interagir com a API do Chatwoot", | ||
@@ -5,0 +5,0 @@ "main": "build/index.js", |
@@ -259,16 +259,18 @@ #!/usr/bin/env node | ||
const args = process.argv.slice(2); | ||
const config: Partial<ChatwootConfig> = {}; | ||
const config: Partial<ChatwootConfig> & { stdio?: boolean } = {}; | ||
for (let i = 0; i < args.length; i += 2) { | ||
for (let i = 0; i < args.length; i++) { | ||
const flag = args[i]; | ||
const value = args[i + 1]; | ||
switch (flag) { | ||
case '--url': | ||
config.baseUrl = value; | ||
break; | ||
case '--token': | ||
config.apiKey = value; | ||
break; | ||
if (flag === '--stdio') { | ||
config.stdio = true; | ||
continue; | ||
} | ||
if (flag === '--url' || flag === '--token') { | ||
const value = args[i + 1]; | ||
if (flag === '--url') config.baseUrl = value; | ||
if (flag === '--token') config.apiKey = value; | ||
i++; // Skip next argument as it's the value | ||
} | ||
} | ||
@@ -284,4 +286,4 @@ | ||
if (!config.baseUrl || !config.apiKey) { | ||
console.error('Uso: npx @seu-usuario/chatwoot-mcp --url <URL_BASE> --token <API_TOKEN>'); | ||
console.error('Exemplo: npx @seu-usuario/chatwoot-mcp --url https://app.chatwoot.com --token seu-token-api'); | ||
console.error('Uso: npx @stacklabdigital/chatwoot-mcp --url <URL_BASE> --token <API_TOKEN> [--stdio]'); | ||
console.error('Exemplo: npx @stacklabdigital/chatwoot-mcp --url https://app.chatwoot.com --token seu-token-api --stdio'); | ||
process.exit(1); | ||
@@ -288,0 +290,0 @@ } |
21398
1.75%526
0.77%