Chatbot MCP

by AndersonHqds

329 downloads
Not rated
GitHub

About

Chatbot MCP is an intelligent chatbot that uses the Model Context Protocol (MCP) to process natural language requests and perform operations such as CPF validation and recharge (add/subtract balance). It is built with TypeScript, Express.js, and OpenAI GPT-4, and is intended for…

Details

Author
AndersonHqds
Downloads
329
Categories
AI

- Natural language processing using GPT-4
- Robust CPF validation (formatting, length, check digits)
- Recharge system with add and subtract operations
- Command-line interface for interaction
- REST API with MCP support

Setting up with Highlight

This MCP is not yet compatible with Highlight’s one-click setup. However, you can still use it with Highlight by following these steps:

  1. Download and install Highlight from highlightai.com/download
  2. Navigate to the plugins tab and select "Add Custom Plugin"
  3. Configure the plugin with the settings below
    Plugin Name Chatbot MCP
    Command (node, npx, python, etc.)

    Please refer to the README for specific instructions on how to obtain API keys or other required environment variables.

  4. Enable "Start Automatically" if you want the plugin to start when Highlight launches

From the repository

Install Node.js 18+, clone the repository, run npm install, and create a .env file with your OPENAI_API_KEY. Start the server with npx ts-node server.ts and the client with npx ts-node index.ts in a separate terminal. Then send natural language commands like “Realizar uma recarga de R$50 para o CPF 123.456.789-09” to perform recharge or debit operations.

Claude Desktop / Cursor

Paste into your MCP client config file to install this server.

{
    "mcpServers": {
        "chatbot mcp": {
            "chatbot-mcp": {
                "command": "npx",
                "args": [
                    "ts-node",
                    "server.ts"
                ]
            }
        }
    }
}

McpServers

{
    "chatbot-mcp": {
        "command": "npx",
        "args": [
            "ts-node",
            "server.ts"
        ]
    }
}

Chatbot MCP

Um chatbot inteligente que utiliza o Model Context Protocol (MCP) para processar requisições e realizar operações, com suporte a validação de CPF e operações de recarga.

🚀 Funcionalidades

- Processamento de linguagem natural usando GPT-4
- Validação robusta de CPF
- Sistema de recarga com operações de adição e subtração
- Interface via linha de comando
- API REST com suporte a MCP

📋 Pré-requisitos

- Node.js (versão 18 ou superior)
- npm ou yarn
- Chave de API do OpenAI

🔧 Instalação

1. Clone o repositório:

git clone [url-do-repositorio]
cd chatbot-mcp

2. Instale as dependências:

npm install

3. Crie um arquivo .env na raiz do projeto com sua chave da OpenAI:

OPENAI_API_KEY=sua-chave-aqui

🚀 Como Executar

1. Inicie o servidor:

npx ts-node server.ts

2. Em outro terminal, inicie o cliente:

npx ts-node index.ts

💻 Uso

O chatbot suporta os seguintes comandos:

- Realizar recarga: "Realizar uma recarga de R$50 para o CPF 123.456.789-09"
- Realizar débito: "Realize um débito de x valor para o cpf y"
- Lembrando que você pode escolher as palavras, trocar débito por "Tire x valor do cpf y" etc...

Exemplos de Uso

Query: Realizar uma recarga de R$50 para o CPF 123.456.789-09
Resposta: O saldo do colaborador com CPF 123.456.789-09 é de R$ 50

🛠️ Tecnologias Utilizadas

- TypeScript
- Express.js
- OpenAI GPT-4
- Model Context Protocol (MCP)
- Zod para validação
- CORS para segurança

📝 Estrutura do Projeto

chatbot-mcp/
├── src/
│   ├── index.ts          # Cliente MCP
│   ├── server.ts         # Servidor Express
│   ├── server-base.ts    # Configuração do servidor MCP
│   └── in-memory-accounts.ts # Gerenciamento de contas
├── package.json
├── tsconfig.json
└── README.md

🔒 Validação de CPF

O sistema inclui uma validação robusta de CPF que:
- Aceita CPFs com ou sem formatação (123.456.789-09 ou 12345678909)
- Verifica o tamanho correto (11 dígitos)
- Valida os dígitos verificadores
- Rejeita CPFs com todos os dígitos iguais

📄 Licença

Este projeto está sob a licença ISC.

No reviews yet — be the first

Sign in to leave a review

Use Google, GitHub, or an email account so ratings stay tied to real people.

Email sign in

No reviews posted yet.