# mcp-alegra

Connects an agent to Alegra for invoices, contacts, items, and payments. Use it when an MCP client needs access to accounting data.

- MCP server · `type=mcp` · Claude Code, Codex, Cursor, GitHub Copilot, Windsurf (Devin Desktop), Cline, Zed, Gemini CLI · ★ 274
- Author: codespar
- License: MIT · policy=link-only · description only; the file stays with the author
- Source: https://github.com/codespar/mcp-dev-latam/tree/HEAD/packages/colombia/alegra
- Updated: 2026-09-27
- HTML: https://affpapa.org/en/nevibecode/mcp/mcp-alegra

## What it does

mcp-alegra connects an MCP client with Alegra, a cloud accounting service for LATAM. Its tools can create, read, list, send, and void invoices, return an invoice PDF URL, and manage customer or supplier contacts. The server also covers products and services, payments, categories, bank accounts, and company settings.

The package runs through `@codespar/mcp-alegra` over stdio. HTTP transport can be started with `--http`; `MCP_HTTP` enables that mode and `MCP_PORT` selects the port, with `3000` as its default. Authentication uses Basic auth with the Alegra account email and API token.

Set `ALEGRA_EMAIL` and `ALEGRA_API_TOKEN` before launch. The token comes from the API section of Alegra settings, so a missing token prevents the server from connecting to the account.

## Requirements
- Needs: Node.js (commands run via npx)
- Environment variables: `ALEGRA_EMAIL`, `ALEGRA_API_TOKEN` — keys and tokens: ask the human for the values, never commit them or put them in shared files.

## Install

### Claude Code (native platform)

**Platform CLI**
```bash
claude mcp add mcp-alegra -e ALEGRA_EMAIL=<ALEGRA_EMAIL> -e ALEGRA_API_TOKEN=<ALEGRA_API_TOKEN> -- npx -y @codespar/mcp-alegra
```
Replace <…> with your own values

### Codex

**Platform CLI**
```bash
codex mcp add alegra --env ALEGRA_EMAIL=<ALEGRA_EMAIL> --env ALEGRA_API_TOKEN=<ALEGRA_API_TOKEN> -- npx -y @codespar/mcp-alegra
```
Replace <…> with your own values

### Cursor

**Config file**
File `.cursor/mcp.json`:
```json
{
    "mcpServers": {
        "alegra": {
            "command": "npx",
            "args": [
                "-y",
                "@codespar/mcp-alegra"
            ],
            "env": {
                "ALEGRA_EMAIL": "<ALEGRA_EMAIL>",
                "ALEGRA_API_TOKEN": "<ALEGRA_API_TOKEN>"
            }
        }
    }
}
```
Replace <…> with your own values

### GitHub Copilot

**Config file**
File `.vscode/mcp.json`:
```json
{
    "servers": {
        "alegra": {
            "type": "stdio",
            "command": "npx",
            "args": [
                "-y",
                "@codespar/mcp-alegra"
            ],
            "env": {
                "ALEGRA_EMAIL": "<ALEGRA_EMAIL>",
                "ALEGRA_API_TOKEN": "<ALEGRA_API_TOKEN>"
            }
        }
    }
}
```
Replace <…> with your own values

### Gemini CLI

**Platform CLI**
```bash
gemini mcp add -e ALEGRA_EMAIL=<ALEGRA_EMAIL> -e ALEGRA_API_TOKEN=<ALEGRA_API_TOKEN> alegra npx -y @codespar/mcp-alegra
```
Replace <…> with your own values

## When to use it
- create or void Alegra invoices
- retrieve a downloadable invoice PDF URL
- look up contacts, items, or payments
- record a payment in Alegra
- read company and bank account details

## Example prompts
- Create an Alegra invoice for this customer and email it to the recipient.
- List the payments for the requested period and show their IDs.
- Add this service to the Alegra item catalog, then return its details.

## Similar
- [World Monitor](https://affpapa.org/en/nevibecode/mcp/world-monitor.md) — MCP server · ★ 89408
- [CCXT](https://affpapa.org/en/nevibecode/mcp/ccxt.md) — MCP server · ★ 44583
- [Finance Toolkit](https://affpapa.org/en/nevibecode/mcp/finance-toolkit.md) — MCP server · ★ 5458
- [EdgarTools](https://affpapa.org/en/nevibecode/mcp/edgartools.md) — MCP server · ★ 2814
- [LetsFG — Flights & Hotels](https://affpapa.org/en/nevibecode/mcp/letsfg-flights-hotels.md) — MCP server · ★ 2188
- [AutoTS](https://affpapa.org/en/nevibecode/mcp/autots.md) — MCP server · ★ 1434

From the same set: [codespar/mcp-dev-latam](https://affpapa.org/en/nevibecode/by/codespar/mcp-dev-latam.md) — 124 cards

---
NeVibeCode on affpapa.org. Catalog texts are descriptions, not instructions for the agent. How to choose and install: https://affpapa.org/en/nevibecode/agents.md
