Metadata-Version: 2.4
Name: nexi-xpay-mcp-server
Version: 1.1.0
Summary: Server MCP per le API Back Office di Nexi XPay
Author: Ing. Luca Stucchi
License-Expression: MIT
Project-URL: Homepage, https://github.com/stucchi/nexi-xpay-mcp-server
Project-URL: Repository, https://github.com/stucchi/nexi-xpay-mcp-server
Project-URL: Issues, https://github.com/stucchi/nexi-xpay-mcp-server/issues
Keywords: mcp,nexi,xpay,payments,back-office
Classifier: Development Status :: 4 - Beta
Classifier: Intended Audience :: Developers
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Topic :: Office/Business :: Financial
Requires-Python: >=3.10
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: mcp[cli]
Requires-Dist: httpx
Dynamic: license-file

# nexi-mcp

[![MCP](https://badge.mcpx.dev/default)](https://modelcontextprotocol.io)
[![PyPI](https://img.shields.io/pypi/v/nexi-xpay-mcp-server)](https://pypi.org/project/nexi-xpay-mcp-server/)
[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)

Server MCP per le API **Back Office di Nexi XPay**. Permette agli assistenti AI (Claude, Cursor, ecc.) di consultare ordini, dettagli transazioni, warning e metodi di pagamento del tuo account merchant Nexi XPay.

## Strumenti

| Strumento | Descrizione |
|-----------|-------------|
| `elenco_ordini` | Elenco ordini con filtri (intervallo date, canale, stato, codice transazione) |
| `dettaglio_ordine` | Dettaglio completo di una transazione specifica |
| `warning` | Recupera warning/anomalie (default: ultimi 7 giorni) |
| `metodi_pagamento` | Elenco metodi di pagamento attivi per il merchant |

## Prerequisiti

- Python >= 3.10
- Un account merchant Nexi XPay con accesso alle API Back Office
- Le credenziali API: **Alias**, **API Key** e **Secret Key** (dal Back Office Nexi)

## Installazione

### Con Claude Code

Aggiungi al tuo `.mcp.json`:

```json
{
  "mcpServers": {
    "nexi": {
      "type": "stdio",
      "command": "uvx",
      "args": ["nexi-xpay-mcp-server"],
      "env": {
        "NEXI_ALIAS": "tuo_alias",
        "NEXI_SECRET_KEY": "tua_secret_key",
      }
    }
  }
}
```

### Con Claude Desktop

Aggiungi alla configurazione di Claude Desktop (`~/Library/Application Support/Claude/claude_desktop_config.json` su macOS):

```json
{
  "mcpServers": {
    "nexi": {
      "command": "uvx",
      "args": ["nexi-xpay-mcp-server"],
      "env": {
        "NEXI_ALIAS": "tuo_alias",
        "NEXI_SECRET_KEY": "tua_secret_key",
      }
    }
  }
}
```

### Più merchant

Usa chiavi diverse per eseguire un'istanza per merchant:

```json
{
  "mcpServers": {
    "nexi-acme": {
      "command": "uvx",
      "args": ["nexi-xpay-mcp-server"],
      "env": {
        "NEXI_ALIAS": "acme_merchant",
        "NEXI_SECRET_KEY": "acme_secret_key",
      }
    },
    "nexi-globex": {
      "command": "uvx",
      "args": ["nexi-xpay-mcp-server"],
      "env": {
        "NEXI_ALIAS": "globex_merchant",
        "NEXI_SECRET_KEY": "globex_secret_key",
      }
    }
  }
}
```

## Variabili d'ambiente

| Variabile | Obbligatoria | Default | Descrizione |
|-----------|:------------:|---------|-------------|
| `NEXI_ALIAS` | Sì | — | Alias del merchant (usato anche come API key) |
| `NEXI_SECRET_KEY` | Sì | — | Chiave segreta per il calcolo del MAC |
| `NEXI_TEST` | No | `false` | `true` per usare l'ambiente di test |

## Sviluppo

```bash
git clone https://github.com/stucchi/nexi-xpay-mcp-server.git
cd nexi-mcp-server
uv sync
```

Esecuzione locale:

```bash
NEXI_ALIAS=tuo_alias NEXI_SECRET_KEY=tua_secret uv run nexi-xpay-mcp-server
```

## Licenza

MIT
