
Company News
Socket Joins New OpenJS Program to Fund Node.js Security Work
Socket is joining the OpenJS Security Stewardship Program to fund Node.js vulnerability research, maintainer remediation, and security releases.
@beel_es/mcp
Advanced tools
MCP server for the BeeL invoicing API — VeriFactu-compliant electronic invoicing tools for LLM agents, derived from the public OpenAPI contract.
Facturación electrónica española con VeriFactu, para agentes de IA.
Spanish e-invoicing with VeriFactu compliance, built for AI agents.
beel.es · API docs · MCP guide · npm
An MCP server that lets an AI agent issue legally compliant Spanish electronic invoices — VeriFactu registration with AEAT, F1/F2 invoice types, R1–R5 correctives, NIF validation against the census, and the regime keys the regulation requires.
It is not a generated wrapper around an API. Three things make it usable by a model:
One codebase, two transports: the hosted remote server at
https://mcp.beel.es/mcp (Streamable HTTP + OAuth — one login per user, nothing to
install), and a local stdio server built from this repository for headless use, where
an API key works and a browser-based login does not.
Add https://mcp.beel.es/mcp as a connector in Claude, ChatGPT, Cursor or VS Code and
log in with your BeeL account. Nothing to install and no API key to handle: the server acts
with your own credentials, and the OAuth flow is discovered from the URL.
# Claude Code
claude mcp add --transport http beel https://mcp.beel.es/mcp
That is the whole setup for interactive use. Read on only if you need the local server.
Use the local server when OAuth cannot: a scheduled job that issues invoices, a CI pipeline, or any headless process where no one is present to complete a browser login. It authenticates with an API key instead.
Requires Node ≥ 20.
// Claude Desktop / Claude Code MCP config
{
"mcpServers": {
"beel": {
"command": "npx",
"args": ["-y", "@beel_es/mcp"],
"env": { "BEEL_API_KEY": "beel_sk_test_xxx" }
}
}
}
# Claude Code
claude mcp add beel --env BEEL_API_KEY=beel_sk_test_xxx -- npx -y @beel_es/mcp
Keys prefixed beel_sk_test_ are safe to experiment with; beel_sk_live_ issues real
fiscal documents.
Releases are published from CI through npm trusted
publishing, so they carry provenance: npm
records the exact commit and workflow each build came from. Verify it with npm audit signatures.
openapi/public-api.yaml — invoices, customers,
products, recurring invoices, series and tax configuration, NIF validation, companies.beel_docs_search,
beel_docs_get, beel_docs_list over the documentation, and
beel_get_setup_status, which reports per NIF exactly what is missing before it can
issue and the one next action to take.beel://guardrails/* — the fiscal invariants, plus
beel://guardrails/errors, a catalogue of every error code with the action it calls
for. Their summaries are woven into the description of every tool they constrain.issue-invoice (validate NIF → choose F1/F2 → check the
VeriFactu gates → issue), fix-invoice (void vs correct), onboard-nif,
setup-representation, invite-member, connect-payments and upgrade-integration.A generated catalogue of every tool, with the scopes each requires, lives at
docs.beel.es/mcp/tools (npm run tools:catalog).
Binary downloads (PDF preview, bulk ZIP, Excel/CSV export), multipart uploads (CSV/Holded
import, signed-PDF submission), webhook infrastructure, and every deprecated operation.
An agent cannot drive them, and each one costs context that a usable tool needs. The rules
are in src/policy/tool-policy.ts.
Spanish e-invoicing has invariants an LLM will get wrong from the schema alone — voiding an invoice that should have been corrected, using R1 on a simplified invoice, editing one AEAT has already registered. The server addresses that in three layers, and the difference between them matters:
1. Advisory — src/guardrails/rules/*.md, one Markdown file per topic: the invoice
lifecycle, void vs rectify, invoice types, invoice lines, regime keys, series numbering,
NIF validation, the VeriFactu gates, multi-NIF accounts. Each is exposed as an MCP
resource under beel://guardrails/* and its one-line summary is appended to the
description of every tool it constrains, so the constraint travels with the call.
2. Enforced — src/guardrails/validate.ts, checked before the request is sent, so a
bad payload never even consumes an idempotency key:
| Check | Code |
|---|---|
| Exactly one pricing field per line | LINE_UNIT_PRICE_XOR_DECLARED_TOTAL |
| No discount on a declared total | LINE_DECLARED_TOTAL_FORBIDS_DISCOUNT |
| No IRPF withholding on a simplified (F2) invoice | SIMPLIFICADA_FORBIDS_IRPF |
Equivalence surcharge only under regime 18, and 18 only with one | SURCHARGE_REQUIRES_REGIME / REGIME_REQUIRES_SURCHARGE |
| Series format can tell its reset periods apart | SERIES_ANNUAL_REQUIRES_YEAR / SERIES_MONTHLY_REQUIRES_MONTH_AND_YEAR |
| Numbering is only seeded in the call that activates the company | NUMBERING_REQUIRES_ACTIVATION |
SUPLIDO lines carry their source reference | checked locally |
Exemption text only under reason OTRO | checked locally |
Correctives go through their own operation, not type: CORRECTIVE | checked locally |
3. Explained — the BeeL API already answers well: its message is written for a
human in the caller's language, error.details carries the specifics, and the RFC 7807
type field links to a documentation page for that exact code (around 357 of them). The
server relays all of that untouched, and adds only the two things a response cannot
carry: the remedy as a tool call — the docs address someone with the dashboard open
("create a series in settings"), an agent needs beel_set_default_series — and
whether retrying can possibly help, which is what stops an agent looping on a 403
that needs an administrator. src/guardrails/catalog.ts holds only codes where one of
those applies; anything else passes through, because a paraphrase would be worse than the
original and would drift from it. The nested blockers[] of EMISSION_NOT_READY are the
clearest case: they arrive as bare strings with no message and no link, and each comes
back out naming the tool that clears it.
The BeeL API is the authority on all of it. Every enforced rule mirrors a rejection
the contract documents, so the pre-flight is a strict subset of what the API refuses: it
can only make failure faster and better explained, never permit something the API would
reject. Rules that depend on server-side state — AEAT census matching, the €3 000 F2
ceiling, whether a series exists — stay advisory on purpose, because guessing at them
locally would reject valid invoices. Set BEEL_DISABLE_PREFLIGHT=1 to bypass the local
checks entirely.
Hand-curated lists are anchored by tests: every catalogued code must still appear in the
contract, every checked operationId must still resolve to a real tool, and every
guardrail reference must point at a guardrail that exists. An API rename fails CI instead
of silently switching a fiscal check off.
| Variable | Purpose |
|---|---|
BEEL_API_KEY | API key. The prefix selects the environment: beel_sk_test_ → Test, beel_sk_live_ → Live. |
BEEL_ENV / BEEL_CONFIG_DIR | Optional. With BEEL_API_KEY unset, falls back to the CLI's ~/.config/beel/config.json (beel login); BEEL_ENV (test/live, default test) picks which stored key. |
| Variable | Purpose |
|---|---|
BEEL_BASE_URL | API base URL. Default https://app.beel.es/api. |
BEEL_DOCS_URL | Documentation source for the docs tools. Default https://docs.beel.es. |
BEEL_REQUEST_TIMEOUT_MS | Hard ceiling on a single API call. Default 30000. |
BEEL_DISABLE_PREFLIGHT | Set to 1 to skip the enforced guardrails. |
Every default lives in src/shared/defaults.ts; nothing is hardcoded twice. Remote
deployment variables are documented in DEPLOY.md.
The server starts and lists tools with no credentials at all — it only errors when an API
tool is actually called. POST requests carry a stable Idempotency-Key derived from the
request itself, so an agent retrying "create invoice" can never mint a second invoice.
The remote server runs on Cloudflare Workers. See DEPLOY.md for the KV namespace, the OAuth client BeeL must have registered, and the secrets involved.
npm ci
npm run dev # stdio server from source
npm test # vitest
npm run typecheck # both the Node and the Worker configs
npm run build # single-file bundle to dist/index.js
npm run inspect # MCP Inspector against the local build
npm run spec:verify # the vendored contract still matches its lock
openapi/public-api.yaml is a generated copy of the API contract, and
openapi/spec.lock.json records its version, operation count and hash. CI fails if the
two disagree, which is what keeps a vendored contract honest. See
CONTRIBUTING.md.
Everything below derives from the same OpenAPI contract, so the vocabulary — invoice types, regime keys, series, VeriFactu states — is identical wherever you meet it.
| REST API | The contract itself. Everything else is a projection of it |
| CLI | The same surface from a terminal, sandbox by default |
| n8n node | Invoicing inside a no-code workflow |
| Claude Code plugin | Implement, audit and maintain a BeeL integration |
| Machine-readable docs | llms.txt for agents that would rather read than guess |
Bug reports and pull requests are welcome — see CONTRIBUTING.md for how the project is laid out and which conventions are load-bearing. Security issues go to security@beel.es rather than a public issue; see SECURITY.md.
MIT © BeeL
FAQs
MCP server for the BeeL invoicing API — VeriFactu-compliant electronic invoicing tools for LLM agents, derived from the public OpenAPI contract.
The npm package @beel_es/mcp receives a total of 43 weekly downloads. As such, @beel_es/mcp popularity was classified as not popular.
We found that @beel_es/mcp demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.

Company News
Socket is joining the OpenJS Security Stewardship Program to fund Node.js vulnerability research, maintainer remediation, and security releases.

Security News
Two compromised GitHub Actions were re-enabled with malicious tags intact, exposing thousands of downstream repositories to Mini Shai-Hulud.

Research
/Security News
A malicious Firefox extension fetches its payload after installation to evade detection, steal Google session cookies, and automate account takeover.