AutoPeças MCP Server
Facilitates the use of Google spreadsheets as a data source for automotive inventory management, exposing part details through the Model Context Protocol.
Utilizes Google Cloud Service Accounts and the Google Sheets API to securely retrieve and manage spreadsheet-based inventory data.
Provides tools for accessing automotive parts data stored in Google Sheets, including functionality for searching by code, listing categories, and verifying stock status.
Enables n8n AI agents and workflows to interact with automotive parts databases via the mcpClientTool node, allowing for automated stock checks and inventory searches.
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@AutoPeças MCP Server Check the stock and price for Bosch oil filters"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
MCP with N8N
mcp-autopeças with n8n
MCP Server in Python that reads and writes to Google Sheets tabs via the MCP protocol — compatible with Claude Desktop, Claude Code, and any MCP Client (including the mcpClientTool node in N8N).
The server covers two domains in a single process, each mapped to a tab in the same spreadsheet:
Domain | Tab | Tools |
AutoParts (AutoMax) |
| 6 tools — read-only |
Hospital Beds |
| 9 tools — read, write, email, and SMS |
Prerequisites
Python 3.12+
uv(recommended) orpipGoogle Service Account with Editor permission on the spreadsheet (required for
leitos_atualizar_status_limpeza)
Installation
cd mcp-alura
uv sync # ou: pip install -e .Configuration
1. Google Credentials (Service Account)
In the Google Cloud Console:
Create a project → APIs & Services → Enable Google Sheets API
Create a Service Account → generate and download the JSON key
Share the spreadsheet with the service account email with Editor permission
2. Environment Variables
cp .env.example .envEdit the .env file with at least:
SPREADSHEET_ID=1zt4h2v3ldK3zELNNmvyn02elEB9dHdfXD5q85ZYh2k0
AUTOPECAS_SHEET_NAME=AutoPeças
LEITOS_SHEET_NAME=Leitos
GOOGLE_CREDENTIALS_PATH=/caminho/para/service_account.json
# Para leitos_enviar_notificacao (e-mail):
GMAIL_USER=setor@hospital.com.br
GMAIL_APP_PASSWORD=xxxx_xxxx_xxxx_xxxx
# Para leitos_enviar_sms:
TWILIO_ACCOUNT_SID=ACxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
TWILIO_AUTH_TOKEN=xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
TWILIO_FROM_NUMBER=+18647139932The
SPREADSHEET_IDis in the URL:docs.google.com/spreadsheets/d/**{ID}**/edit
Expected Spreadsheet Structure
AutoPeças Tab:
Code | Name | Category | Brand | Price | Stock | Supplier | Description | Location |
F-1023 | Oil Filter | Engine | Bosch | 35.90 | 48 | AutoDist | ... | Shelf A3 |
Leitos Tab — columns confirmed by the N8N node schema:
Bed_ID | Room | Room_Type | Occupancy_Status | Cleaning_Status | Patient | Last_Cleaning |
A-101 | Room 10 | Ward | Occupied | Completed | John Doe | 2025-03-28 |
UTI-05 | North ICU | ICU | Available | Pending | — | 2025-03-27 |
Column names can be adjusted in the
.envfile usingCOL_*andLEITOS_COL_*.
AutoParts Tools
Tool | What it does |
| Search by name, code, or description |
| List the catalog with pagination and filters |
| Full details of a part by code |
| Categories with part counts |
| Stock by code or summary by category |
| Manufacturers with part counts |
Hospital Beds Tools
Mapping of N8N agents (mcp-all-nodes.json) to Python tools:
N8N Agent | Filter | Equivalent Tools |
Management Agent | Full access |
|
Ward Agent |
|
|
ICU Agent |
|
|
All agents | — |
|
N8N Write Node |
|
|
Tool | Read/Write | What it does |
| Read | Lists all beds; filterable by |
| Read | Fixed filter |
| Read | Fixed filter |
| Read | Beds with |
| Read | Full data of a bed by |
| Read | Dashboard: occupancy and cleaning grouped by |
| Write | Updates |
| External | Sends email via Gmail SMTP |
| External | Sends SMS via Twilio REST API |
Occupancy_Status: Available 🟢 · Occupied 🔴 · Reserved 🔵
Cleaning_Status: Completed ✅ · Pending ⚠️ · In Progress 🔄
Room types: Ward · ICU · Apartment · Semi-Intensive
Configuring email sending
The leitos_enviar_notificacao tool uses Gmail SMTP with an App Password:
Enable two-step verification on your Google account
Create a password for "Email" and paste it into
GMAIL_APP_PASSWORDin the.envfile
Configuring SMS sending
The leitos_enviar_sms tool uses the Twilio REST API:
Create an account at twilio.com
Get your
Account SIDandAuth Tokenfrom the dashboardRegister or purchase a sender number and configure
TWILIO_FROM_NUMBER
Usage in Claude Desktop
Add to ~/Library/Application Support/Claude/claude_desktop_config.json:
{
"mcpServers": {
"hospital-mcp": {
"command": "uv",
"args": ["run", "--project", "/caminho/para/mcp-alura", "python", "server.py"],
"env": {
"SPREADSHEET_ID": "1zt4h2v3ldK3zELNNmvyn02elEB9dHdfXD5q85ZYh2k0",
"AUTOPECAS_SHEET_NAME": "AutoPeças",
"LEITOS_SHEET_NAME": "Leitos",
"GOOGLE_CREDENTIALS_PATH": "/caminho/para/service_account.json",
"GMAIL_USER": "setor@hospital.com.br",
"GMAIL_APP_PASSWORD": "xxxx_xxxx_xxxx_xxxx",
"TWILIO_ACCOUNT_SID": "ACxxxxxxxx",
"TWILIO_AUTH_TOKEN": "xxxxxxxx",
"TWILIO_FROM_NUMBER": "+18647139932"
}
}
}
}Usage in Claude Code
claude mcp add hospital-mcp -- uv run --project /caminho/para/mcp-alura python server.pyUsage in N8N (MCP Client)
Configure the MCP Client Tool node pointing to the server endpoint.
The three N8N agents can share the same Python MCP server,
each using the tools appropriate for their role via include: selected.
Local testing
uv run python server.pyTo inspect the 15 tools with the MCP Inspector:
npx @modelcontextprotocol/inspector uv run python server.pyAvailable Tools
15 toolsautopecas_buscar_pecaARead-onlyIdempotent
Busca peças na base AutoPeças por texto livre (nome, código ou descrição).
Args: params (BuscarPecaInput): - query (str): Texto para busca (ex: 'filtro', 'vela', 'F-1023') - categoria (Optional[str]): Filtro por categoria (ex: 'Motor') - marca (Optional[str]): Filtro por marca (ex: 'Bosch') - apenas_em_estoque (bool): Se True, apenas peças com estoque disponível - limit (int): Máximo de resultados (padrão: 20) - offset (int): Paginação (padrão: 0) - formato (str): 'markdown' ou 'json'
Returns: str: Lista de peças com código, nome, categoria, preço e estoque.
Exemplos: - "Buscar filtros de óleo" → query="filtro de óleo" - "Velas Bosch disponíveis" → query="vela", marca="Bosch", apenas_em_estoque=True
Inputs: params (required). Returns: result
autopecas_listar_categoriasBRead-onlyIdempotent
Lista todas as categorias de peças com contagem total e em estoque por categoria.
Args: params (ListarCategoriasInput): - formato (str): 'markdown' ou 'json'
Inputs: params (required). Returns: result
autopecas_listar_marcasARead-onlyIdempotent
Lista todas as marcas/fabricantes com contagem de peças por marca.
Args: params (ListarMarcasInput): - categoria (Optional[str]): Filtrar por categoria - formato (str): 'markdown' ou 'json'
Exemplos: - "Marcas de freios" → categoria="Freios" - "Listar todos os fabricantes" → (sem parâmetros)
Inputs: params (required). Returns: result
autopecas_listar_pecasARead-onlyIdempotent
Lista todas as peças cadastradas na base AutoPeças com paginação e filtros opcionais.
Args: params (ListarPecasInput): - categoria (Optional[str]): Filtrar por categoria - marca (Optional[str]): Filtrar por marca - apenas_em_estoque (bool): Apenas peças com estoque > 0 - limit (int): Máximo de resultados (padrão: 20) - offset (int): Paginação (padrão: 0) - formato (str): 'markdown' ou 'json'
Exemplos: - "Listar peças de Freios" → categoria="Freios" - "Peças Bosch em estoque" → marca="Bosch", apenas_em_estoque=True
Inputs: params (required). Returns: result
autopecas_obter_detalhesARead-onlyIdempotent
Retorna todos os dados de uma peça específica pelo código único.
Args: params (ObterDetalhesPecaInput): - codigo (str): Código único da peça (ex: 'F-1023') - formato (str): 'markdown' ou 'json'
Exemplos: - "Detalhes de F-1023" → codigo="F-1023"
Inputs: params (required). Returns: result
autopecas_verificar_estoqueARead-onlyIdempotent
Verifica estoque de peças específicas ou exibe resumo geral por categoria.
Se codigos for informado, retorna estoque de cada peça (com alertas ⚠️).
Se omitido, retorna resumo agrupado por categoria.
Args: params (VerificarEstoqueInput): - codigos (Optional[List[str]]): Códigos das peças a verificar - categoria (Optional[str]): Filtrar resumo por categoria - formato (str): 'markdown' ou 'json'
Exemplos: - "Estoque de F-1023 e BP-0042" → codigos=["F-1023", "BP-0042"] - "Resumo do estoque de Freios" → categoria="Freios"
Inputs: params (required). Returns: result
leitos_atualizar_status_limpezaAIdempotent
Atualiza o campo Status_Limpeza de um leito na planilha Google Sheets.
Operação de ESCRITA — equivale ao nó 'Atualizar Base de Dados Hospital' do N8N (mcp-all-nodes.json). Localiza o leito pelo ID_Leito e atualiza apenas o campo Status_Limpeza.
Requer que a Service Account tenha permissão de EDITOR na planilha.
Args: params (AtualizarStatusLimpezaInput): - leito_id (str): ID do leito a atualizar (campo ID_Leito, ex: 'A-101') - status_limpeza (str): Novo status (ex: 'Concluído', 'Pendente', 'Em Andamento')
Returns: str: Confirmação da atualização ou mensagem de erro.
Exemplos: - "Marcar limpeza do A-101 como concluída" → leito_id="A-101", status_limpeza="Concluído" - "Sinalizar UTI-05 com limpeza pendente" → leito_id="UTI-05", status_limpeza="Pendente"
Inputs: params (required). Returns: result
leitos_enviar_notificacaoA
Envia notificação por e-mail via Gmail SMTP.
Equivale ao nó 'Enviar Email' (gmailTool) disponível para todos os agentes (Diretoria, Enfermaria, UTI) em mcp-all-nodes.json.
Requer GMAIL_USER e GMAIL_APP_PASSWORD no .env. Crie uma Senha de App em: myaccount.google.com/apppasswords
Args: params (EnviarNotificacaoInput): - destinatario (str): E-mail do destinatário - assunto (str): Assunto do e-mail - mensagem (str): Corpo da mensagem (texto simples)
Exemplos: - "Avisar que leito A-101 está disponível" → destinatario="equipe@hospital.com.br", assunto="Leito A-101 disponível", mensagem="O leito A-101 foi liberado e está pronto."
Inputs: params (required). Returns: result
leitos_enviar_smsA
Envia SMS via Twilio REST API.
Equivale ao nó 'Enviar SMS' (twilioTool) disponível para os agentes Enfermaria e UTI em mcp-all-nodes.json.
Requer TWILIO_ACCOUNT_SID, TWILIO_AUTH_TOKEN e TWILIO_FROM_NUMBER no .env.
Args: params (EnviarSMSInput): - destinatario (str): Número no formato E.164 (ex: '+5511952767064') - mensagem (str): Texto do SMS (até 160 chars para SMS simples)
Exemplos: - "Avisar por SMS que UTI-05 foi liberada" → destinatario="+5511999999999", mensagem="Leito UTI-05 disponível para nova internação."
Inputs: params (required). Returns: result
leitos_listar_enfermariaARead-onlyIdempotent
Lista apenas os leitos do tipo Enfermaria (Tipo_Quarto = 'Enfermaria').
Equivale ao Agent Enfermaria do N8N. Suporta os três relatórios do menu:
Leitos Disponíveis e Ocupados → status_ocupacao="Disponível" ou "Ocupado"
Ocupação de Leitos → (sem filtro, ver leitos_resumo_ocupacao)
Status de Limpeza → status_limpeza="Pendente" ou "Concluído"
Args: params (ListarEnfermariaInput): - status_ocupacao (Optional[str]): 'Disponível', 'Ocupado', 'Reservado' - status_limpeza (Optional[str]): 'Concluído', 'Pendente', 'Em Andamento' - limit (int): Máximo de resultados (padrão: 20) - offset (int): Paginação (padrão: 0) - formato (str): 'markdown' ou 'json'
Exemplos: - "Leitos de enfermaria disponíveis" → status_ocupacao="Disponível" - "Limpeza pendente na enfermaria" → status_limpeza="Pendente"
Inputs: params (required). Returns: result
leitos_listar_leitosARead-onlyIdempotent
Lista todos os leitos hospitalares com paginação e filtros combinados.
Visão completa equivalente ao Agent Diretoria do N8N — sem restrição de tipo de quarto. Filtrável por tipo, Status_Ocupacao e Status_Limpeza.
Colunas da planilha: ID_Leito, Quarto, Tipo_Quarto, Status_Ocupacao, Status_Limpeza, Paciente, Ultima_Limpeza.
Args: params (ListarLeitosInput): - tipo_quarto (Optional[str]): 'Enfermaria', 'UTI', 'Apartamento', 'Semi-Intensivo' - status_ocupacao (Optional[str]): 'Disponível', 'Ocupado', 'Reservado' - status_limpeza (Optional[str]): 'Concluído', 'Pendente', 'Em Andamento' - limit (int): Máximo de resultados (padrão: 20) - offset (int): Paginação (padrão: 0) - formato (str): 'markdown' ou 'json'
Exemplos: - "Todos os leitos de UTI" → tipo_quarto="UTI" - "Leitos com limpeza pendente" → status_limpeza="Pendente" - "Leitos disponíveis" → status_ocupacao="Disponível"
Inputs: params (required). Returns: result
leitos_listar_utiARead-onlyIdempotent
Lista apenas os leitos do tipo UTI (Tipo_Quarto = 'UTI').
Equivale ao Agent UTI do N8N. Suporta os dois relatórios do menu:
Relatório de Dias Internados → exibe Data_Internacao de cada paciente
Quantidade de Pacientes Internados → contagem de leitos Ocupados
Args: params (ListarUTIInput): - status_ocupacao (Optional[str]): 'Disponível', 'Ocupado', 'Reservado' - status_limpeza (Optional[str]): 'Concluído', 'Pendente', 'Em Andamento' - limit (int): Máximo de resultados (padrão: 20) - offset (int): Paginação (padrão: 0) - formato (str): 'markdown' ou 'json'
Exemplos: - "Pacientes na UTI" → status_ocupacao="Ocupado" - "Leitos de UTI disponíveis" → status_ocupacao="Disponível" - "Dias de internação na UTI" → (sem filtros, ver Data_Internacao no resultado)
Inputs: params (required). Returns: result
leitos_obter_detalhes_leitoARead-onlyIdempotent
Retorna todos os dados de um leito específico pelo campo ID_Leito.
Args: params (ObterDetalhesLeitoInput): - leito_id (str): Valor do campo ID_Leito (ex: 'A-101', 'UTI-05') - formato (str): 'markdown' ou 'json'
Exemplos: - "Detalhes do leito A-101" → leito_id="A-101" - "Quem está no UTI-05?" → leito_id="UTI-05"
Inputs: params (required). Returns: result
leitos_resumo_ocupacaoARead-onlyIdempotent
Dashboard de ocupação e limpeza agrupado por Tipo_Quarto.
Exibe dois painéis:
Ocupação: contagens de Status_Ocupacao (Disponível, Ocupado, Reservado)
Limpeza: contagens de Status_Limpeza (Concluído, Pendente, Em Andamento)
Equivale à visão do Agent Diretoria e suporta os relatórios de Ocupação e Status de Limpeza do Agent Enfermaria.
Args: params (ResumoOcupacaoInput): - tipo_quarto (Optional[str]): Filtrar por tipo de quarto - formato (str): 'markdown' ou 'json'
Exemplos: - "Dashboard geral" → (sem parâmetros) - "Resumo da enfermaria" → tipo_quarto="Enfermaria"
Inputs: params (required). Returns: result
leitos_verificar_disponibilidadeARead-onlyIdempotent
Exibe leitos com Status_Ocupacao = 'Disponível', com resumo por tipo de quarto.
Ferramenta central para admissão de pacientes: identifica quais leitos estão livres para ocupação imediata.
Args: params (VerificarDisponibilidadeInput): - tipo_quarto (Optional[str]): Filtrar por tipo (ex: 'UTI', 'Enfermaria') - formato (str): 'markdown' ou 'json'
Exemplos: - "Leitos de UTI disponíveis" → tipo_quarto="UTI" - "Quantos leitos livres temos?" → (sem parâmetros)
Inputs: params (required). Returns: result
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 15 tools
The tool set suffers from significant ambiguity due to overlapping purposes. For example, 'autopecas_listar_pecas' and 'autopecas_buscar_peca' both retrieve parts with similar filters, and 'leitos_listar_leitos', 'leitos_listar_enfermaria', and 'leitos_listar_uti' all list beds with overlapping functionality. This creates confusion about which tool to use for specific queries, especially within each domain.
Naming is mostly consistent with a clear prefix pattern ('autopecas_' and 'leitos_') and verb_noun structure (e.g., 'listar_categorias', 'obter_detalhes'). However, there are minor deviations like 'autopecas_buscar_peca' (using 'buscar' instead of 'listar' or 'pesquisar') and 'leitos_verificar_disponibilidade' (which could align better with others like 'listar_disponibilidade'). Overall, the conventions are readable and predictable.
With 15 tools, the count is borderline high but reasonable given the two distinct domains (auto parts and hospital beds). However, the set feels heavy due to redundant tools within each domain (e.g., multiple listing tools for beds), suggesting it could be streamlined without losing functionality. It's not extreme, but it approaches the upper limit of what's well-scoped.
For both domains, the tool surface covers core operations well: search, list, get details, and check status for auto parts; and list, update, notify, and check availability for hospital beds. Minor gaps exist, such as no update or delete tools for auto parts (e.g., modifying part details) and no direct patient admission tools for beds, but agents can work around these with the available tools.
Maintenance
Related MCP Connectors
A comprehensive Model Context Protocol (MCP) server that enables AI assistants to interact with yo…
Model Context Protocol server for the Apideck Unified API. Connect any MCP-compatible agent framework to 100+ accounting systems, HRIS platforms, file storage providers, and more through one integration. More information https://www.apideck.com/mcp-server
The Mercado Pago MCP Server implements the Model Context Protocol to provide AI agents and LLMs with access to Mercado Pago's APIs and tools within compatible development environments. It acts as an intermediary that translates Mercado Pago resources into executable functions (tools) that AI applications can invoke to perform actions and automate flows. The server simplifies integration, enables using documentation to implement or improve code, and optimizes operations through natural language interactions without manual implementations.
An MCP server that provides an API to LLMs to manage their JumpCloud resources.
Related MCP Servers
- AlicenseNot gradedqualityDmaintenanceA Model Context Protocol server that integrates with Google Drive and Google Sheets, enabling users to create, read, update, and manage spreadsheets through natural language commands.19,738 PyPI1,021MIT
- AlicenseBqualityDmaintenanceProvides a Model Context Protocol (MCP) server that enables LLMs to directly access and interact with Google Spreadsheet data.21ISC
- AlicenseBqualityDmaintenanceAn MCP server for automating Google Workspace applications including Sheets, Apps Script, Drive, Docs, and Gmail. It enables users to manipulate spreadsheets, edit scripts, manage files, and send emails directly from conversational AI interfaces.31MIT
- AlicenseAqualityDmaintenanceA Python-based MCP server that acts as a bridge between MCP-compatible clients and the Google Sheets API, enabling AI-driven automation and data manipulation workflows.40MIT