Skip to main content
Glama
joao-parana

AutoPeças MCP Server

by joao-parana

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)

AutoPeças (gid=0)

6 tools — read-only

Hospital Beds

Leitos (gid=1562350974)

9 tools — read, write, email, and SMS

Prerequisites

  • Python 3.12+

  • uv (recommended) or pip

  • Google 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:

  1. Create a project → APIs & Services → Enable Google Sheets API

  2. Create a Service Account → generate and download the JSON key

  3. Share the spreadsheet with the service account email with Editor permission

2. Environment Variables

cp .env.example .env

Edit 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=+18647139932

The SPREADSHEET_ID is 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 .env file using COL_* and LEITOS_COL_*.


AutoParts Tools

Tool

What it does

autopecas_buscar_peca

Search by name, code, or description

autopecas_listar_pecas

List the catalog with pagination and filters

autopecas_obter_detalhes

Full details of a part by code

autopecas_listar_categorias

Categories with part counts

autopecas_verificar_estoque

Stock by code or summary by category

autopecas_listar_marcas

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

leitos_listar_leitos, leitos_resumo_ocupacao, leitos_verificar_disponibilidade, leitos_obter_detalhes_leito

Ward Agent

Room_Type = Ward

leitos_listar_enfermaria

ICU Agent

Room_Type = ICU

leitos_listar_uti

All agents

leitos_enviar_notificacao, leitos_enviar_sms

N8N Write Node

row_numberBed_ID

leitos_atualizar_status_limpeza

Tool

Read/Write

What it does

leitos_listar_leitos

Read

Lists all beds; filterable by Room_Type, Occupancy_Status, Cleaning_Status

leitos_listar_enfermaria

Read

Fixed filter Room_Type=Ward — occupancy and cleaning reports

leitos_listar_uti

Read

Fixed filter Room_Type=ICU — days admitted and patient count

leitos_verificar_disponibilidade

Read

Beds with Occupancy_Status=Available, summary by type

leitos_obter_detalhes_leito

Read

Full data of a bed by Bed_ID

leitos_resumo_ocupacao

Read

Dashboard: occupancy and cleaning grouped by Room_Type

leitos_atualizar_status_limpeza

Write

Updates Cleaning_Status of a bed by Bed_ID

leitos_enviar_notificacao

External

Sends email via Gmail SMTP

leitos_enviar_sms

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:

  1. Enable two-step verification on your Google account

  2. Go to myaccount.google.com/apppasswords

  3. Create a password for "Email" and paste it into GMAIL_APP_PASSWORD in the .env file

Configuring SMS sending

The leitos_enviar_sms tool uses the Twilio REST API:

  1. Create an account at twilio.com

  2. Get your Account SID and Auth Token from the dashboard

  3. Register 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.py

Usage 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.py

To inspect the 15 tools with the MCP Inspector:

npx @modelcontextprotocol/inspector uv run python server.py
F
license - not found
A
quality
D
maintenance

Maintenance

Maintainers
Response time
Release cycle
Releases (12mo)
Commit activity

Resources

Unclaimed servers have limited discoverability.

Looking for Admin?

If you are the server author, to access and configure the admin panel.

Related MCP Servers

View all related MCP servers

Related MCP Connectors

  • A comprehensive Model Context Protocol (MCP) server that enables AI assistants to interact with yo…

  • MCP server for Google search results via SERP API

  • A Model Context Protocol server for Wix AI tools

View all MCP Connectors

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/joao-parana/mcp-alura'

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