invoiceninja-mcp-server

invoiceninja-mcp-server

Exposes all 379 Invoice Ninja v5 REST API endpoints through three consolidated tools (list, describe, call), enabling full invoice management and business operations via natural language.

Category
访问服务器

README

@nightsquawktech/invoiceninja-mcp-server

OpenSSF Scorecard

MCP server for Invoice Ninja v5 (self-hosted). Exposes all 379 API endpoints through 3 consolidated tools backed by a generated endpoint catalog, rather than one tool per endpoint.

Why a catalog, not 379 tools

Invoice Ninja's REST API has ~379 operations across ~31 resources (full CRUD + bulk + actions + 27 reports). One MCP tool per endpoint would be unusable: huge context cost and poor tool selection. Instead, every endpoint is described by a JSON spec file under src/catalog/endpoints/, and three generic tools read that catalog:

Tool Purpose
list_endpoints(category?, mutating?, search?) Discover endpoints (slug, method, path, category, mutating flag, one-line summary).
describe_endpoint(endpoint_name) Full spec for one endpoint: method, path, path/query params, request-body fields (types, required, enums, descriptions), and whenToUse.
call_endpoint(endpoint_name, path_params?, query?, body?, ...) Validate against the catalog, then execute. Mutating endpoints (POST/PUT/DELETE) require authorization_confirmed: true + authorization_note and are backed up to a temp file before the call.

Expected flow: discover → describe → call.

The endpoint catalog

  • src/catalog/endpoints/<slug>.json: one spec per endpoint, generated from the OpenAPI spec (openapi/api-docs.yaml @ invoiceninja v5-stable). Carries method, path, name, category, mutating, description, whenToUse, path/query/header parameters, and request-body fields.
  • src/catalog/index.json: aggregate discovery index (slug, method, path, category, mutating, summary) plus counts.

Regenerate after a spec bump:

curl -sL https://raw.githubusercontent.com/invoiceninja/invoiceninja/v5-stable/openapi/api-docs.yaml -o spec/api-docs.yaml
npm run generate     # parse spec -> src/catalog/endpoints/*.json
npm run catalog      # rebuild src/catalog/index.json
npm run build

The whenToUse field (when-to-reach-for-this guidance) is filled by an enrichment pass (scripts/apply-enrichment.mjs) and surfaced by describe_endpoint / list_endpoints.

Setup

npm install
npm run build

Environment (self-hosted)

Variable Required Description
INVOICENINJA_BASE_URL Yes Instance URL, no trailing slash, no /api/v1 (e.g. https://your-instance.example.com)
INVOICENINJA_API_TOKEN Yes API token (Settings → Account Management → Integrations → API Tokens). Sent as X-Api-Token.
INVOICENINJA_TIMEOUT_MS No Request timeout, default 30000

MCP client configuration

{
  "mcpServers": {
    "invoiceninja": {
      "command": "npx",
      "args": ["-y", "@nightsquawktech/invoiceninja-mcp-server"],
      "env": {
        "INVOICENINJA_BASE_URL": "https://your-instance.example.com",
        "INVOICENINJA_API_TOKEN": "<token>"
      }
    }
  }
}

Write safety

call_endpoint runs read-only GET endpoints freely. Any mutating endpoint requires authorization_confirmed: true and a non-empty authorization_note; without both, the call is refused before any HTTP request is made. Before a mutating call executes, the client writes a JSON backup (request payload, authorization note, and best-effort prior record for PUT/DELETE by id) under the system temp dir. The catalog flags every endpoint's mutating status, and as defense-in-depth any {action} route (email, mark_paid, archive, delete, clone, and similar) is treated as mutating even though some are GETs, so state-changing action endpoints can never run unguarded.

Smoke test (read-only)

scripts/smoke-test.mjs sweeps every non-mutating endpoint against a live instance: 186 of 379, including the 36 POST-but-read-only reports/charts/preview/templates/search (sent with an empty body so no side effect fires). It calls collection/report endpoints first, harvests sample ids, then exercises by-id endpoints, reporting PASS/FAIL/SKIP each. The 193 mutating endpoints (incl. the 6 state-changing action_* GETs) are excluded and the header says so, so a green run is never mistaken for full-API coverage.

INVOICENINJA_BASE_URL=... INVOICENINJA_API_TOKEN=... npm run build && npm run smoke

Layout

src/
  index.ts                          stdio MCP entry point
  server/invoiceninja-mcp-server.ts singleton McpServer
  catalog/
    endpoint-spec.ts                catalog types + loader (traversal-guarded)
    index.json                      generated discovery index
    endpoints/<slug>.json           379 generated endpoint specs
  clients/invoiceninja-client.ts    generic HTTP caller (X-Api-Token, backups)
  tools/
    list-endpoints.ts  describe-endpoint.ts  call-endpoint.ts
  helpers/  types/
scripts/
  generate-catalog.mjs  parse OpenAPI spec -> endpoint files
  assemble-catalog.mjs  endpoint files -> index.json
  apply-enrichment.mjs  write whenToUse from the enrichment pass
  smoke-test.mjs        read-only live sweep

See SCOPING.md for the API inventory and design rationale.

License

Licensed under the GNU AGPL v3.0. Free for personal and open-source use.

Organizations that cannot comply with the AGPL can purchase a commercial license. See COMMERCIAL.md or contact hello@nightsquawk.tech.

推荐服务器

Baidu Map

Baidu Map

百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。

官方
精选
JavaScript
Playwright MCP Server

Playwright MCP Server

一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。

官方
精选
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。

官方
精选
本地
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。

官方
精选
本地
TypeScript
VeyraX

VeyraX

一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。

官方
精选
本地
graphlit-mcp-server

graphlit-mcp-server

模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。

官方
精选
TypeScript
Kagi MCP Server

Kagi MCP Server

一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。

官方
精选
Python
e2b-mcp-server

e2b-mcp-server

使用 MCP 通过 e2b 运行代码。

官方
精选
Neon MCP Server

Neon MCP Server

用于与 Neon 管理 API 和数据库交互的 MCP 服务器

官方
精选
Exa MCP Server

Exa MCP Server

模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。

官方
精选