{"_id":"@available-dev/e-conomic-mcp","_rev":"3-0e448e98553db9a4b8cd532477d02e97","name":"@available-dev/e-conomic-mcp","dist-tags":{"latest":"0.3.0"},"versions":{"0.1.0":{"name":"@available-dev/e-conomic-mcp","version":"0.1.0","keywords":["mcp","model-context-protocol","e-conomic","economic","visma","accounting","rest-api","claude"],"license":"MIT","_id":"@available-dev/e-conomic-mcp@0.1.0","maintainers":[{"name":"available-rasmus","email":"rasmus@available.dk"}],"homepage":"https://github.com/available-dev/e-conomic-mcp#readme","bugs":{"url":"https://github.com/available-dev/e-conomic-mcp/issues"},"bin":{"e-conomic-mcp":"dist/index.js"},"dist":{"shasum":"4088744f361978b48190a47f8881f1557746376e","tarball":"https://registry.npmjs.org/@available-dev/e-conomic-mcp/-/e-conomic-mcp-0.1.0.tgz","fileCount":38,"integrity":"sha512-no/4Ch5Xeo+xzKTSWH+aENolWV3TfQKFFnmVPt9iyza9i2neZUmQyNjz4tjQvCq/sbcmX4u46EbSfHzAij+UhA==","signatures":[{"sig":"MEUCIQCdLUyRrVWra0h7CIAKmpjR4Wca+J5rs4RrV1KwLcTmsQIgXmoyuV/fJ7YwEWz3WzMCLaq7rryUw/OLkCSGp8GauZE=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":2460119},"type":"module","engines":{"node":">=18"},"gitHead":"d2c3382726c851b98cc576c7a6b9c91b0b592039","scripts":{"build":"tsc -p tsconfig.json","clean":"rm -rf dist","start":"node dist/index.js","watch":"tsc -p tsconfig.json --watch","doctor":"node dist/index.js doctor","prepare":"npm run build","typecheck":"tsc -p tsconfig.json --noEmit","prepublishOnly":"npm run clean && npm run build"},"_npmUser":{"name":"available-rasmus","email":"rasmus@available.dk"},"repository":{"url":"git+https://github.com/available-dev/e-conomic-mcp.git","type":"git"},"_npmVersion":"10.9.0","description":"Model Context Protocol (MCP) server and CLI for the e-conomic REST API. Full API coverage via a generic request tool, schema-driven discovery, optional per-endpoint tool generation, and typed convenience tools.","directories":{},"_nodeVersion":"22.11.0","dependencies":{"@modelcontextprotocol/sdk":"^1.12.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"typescript":"^5.7.0","@types/node":"^22.10.0"},"_npmOperationalInternal":{"tmp":"tmp/e-conomic-mcp_0.1.0_1780645428544_0.23027236686875474","host":"s3://npm-registry-packages-npm-production"}},"0.2.0":{"name":"@available-dev/e-conomic-mcp","version":"0.2.0","keywords":["mcp","model-context-protocol","e-conomic","economic","visma","accounting","rest-api","claude"],"license":"MIT","_id":"@available-dev/e-conomic-mcp@0.2.0","maintainers":[{"name":"available-rasmus","email":"rasmus@available.dk"}],"homepage":"https://github.com/available-dev/e-conomic-mcp#readme","bugs":{"url":"https://github.com/available-dev/e-conomic-mcp/issues"},"bin":{"e-conomic-mcp":"dist/index.js"},"dist":{"shasum":"ba83db1bff68ab783a5d67ec3535d35bccbb8dac","tarball":"https://registry.npmjs.org/@available-dev/e-conomic-mcp/-/e-conomic-mcp-0.2.0.tgz","fileCount":38,"integrity":"sha512-e/LWKb+f1l6NmSyJVVjD4zzjDFTWUJsxw97RVXWNUVEcELLhjD9V6hR3SGxsOaFz8muE/7T57R+oDAkZXHLKCA==","signatures":[{"sig":"MEUCIH5faCIFXrkwh/Rdb6ixUKBw50AAnX8pMapyTA1ZkHeMAiEAl6037YDjzsNoJQ6/E1BmbQrpMSuDzbEUJN+FB1y5J8E=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":2506378},"type":"module","engines":{"node":">=18"},"gitHead":"14e68fbc1dbc2e32318c2c6b0a21261fe1c9424a","scripts":{"build":"tsc -p tsconfig.json","clean":"rm -rf dist","start":"node dist/index.js","watch":"tsc -p tsconfig.json --watch","doctor":"node dist/index.js doctor","prepare":"npm run build","typecheck":"tsc -p tsconfig.json --noEmit","prepublishOnly":"npm run clean && npm run build"},"_npmUser":{"name":"available-rasmus","email":"rasmus@available.dk"},"repository":{"url":"git+https://github.com/available-dev/e-conomic-mcp.git","type":"git"},"_npmVersion":"10.9.0","description":"Model Context Protocol (MCP) server and CLI for the e-conomic REST API. Full API coverage via a generic request tool, schema-driven discovery, optional per-endpoint tool generation, and typed convenience tools.","directories":{},"_nodeVersion":"22.11.0","dependencies":{"@modelcontextprotocol/sdk":"^1.12.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"typescript":"^5.7.0","@types/node":"^22.10.0"},"_npmOperationalInternal":{"tmp":"tmp/e-conomic-mcp_0.2.0_1780662375161_0.40434252069257903","host":"s3://npm-registry-packages-npm-production"}},"0.3.0":{"name":"@available-dev/e-conomic-mcp","version":"0.3.0","description":"Model Context Protocol (MCP) server and CLI for the e-conomic REST API. Full API coverage via a generic request tool, schema-driven discovery, optional per-endpoint tool generation, and typed convenience tools.","license":"MIT","type":"module","bin":{"e-conomic-mcp":"dist/index.js"},"engines":{"node":">=18"},"repository":{"type":"git","url":"git+https://github.com/available-dev/e-conomic-mcp.git"},"homepage":"https://github.com/available-dev/e-conomic-mcp#readme","bugs":{"url":"https://github.com/available-dev/e-conomic-mcp/issues"},"publishConfig":{"access":"public"},"scripts":{"build":"tsc -p tsconfig.json","watch":"tsc -p tsconfig.json --watch","start":"node dist/index.js","doctor":"node dist/index.js doctor","typecheck":"tsc -p tsconfig.json --noEmit","clean":"rm -rf dist","prepare":"npm run build","prepublishOnly":"npm run clean && npm run build"},"keywords":["mcp","model-context-protocol","e-conomic","economic","visma","accounting","rest-api","claude"],"dependencies":{"@modelcontextprotocol/sdk":"^1.12.0"},"devDependencies":{"@types/node":"^22.10.0","typescript":"^5.7.0"},"_id":"@available-dev/e-conomic-mcp@0.3.0","gitHead":"92b6e5512a6bba256043ae066b090231fb5e0448","_nodeVersion":"22.11.0","_npmVersion":"10.9.0","dist":{"integrity":"sha512-uq7Pa59Y5mPfFGczWT16LysQaUIholKsFncOKF2dLSu/ELomtoHuAdQ4jsPn21VZ0m12MNEyVm97QdFRYt9Zjg==","shasum":"f613c8cef598cd05dbb85874b50d2ae45802210f","tarball":"https://registry.npmjs.org/@available-dev/e-conomic-mcp/-/e-conomic-mcp-0.3.0.tgz","fileCount":44,"unpackedSize":2550636,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIHuNgpallYva+8VQzntdI19QHZqQOSh6/hGoRhP6nFOFAiEAh2kV/WaIiioJ4VbK+GxmThdoSfI9y6JgrAWtJjk8s6U="}]},"_npmUser":{"name":"available-rasmus","email":"rasmus@available.dk"},"directories":{},"maintainers":[{"name":"available-rasmus","email":"rasmus@available.dk"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/e-conomic-mcp_0.3.0_1780684832731_0.9436756154192951"},"_hasShrinkwrap":false}},"time":{"created":"2026-06-05T07:43:48.360Z","modified":"2026-06-05T18:40:33.064Z","0.1.0":"2026-06-05T07:43:48.741Z","0.2.0":"2026-06-05T12:26:15.346Z","0.3.0":"2026-06-05T18:40:32.964Z"},"bugs":{"url":"https://github.com/available-dev/e-conomic-mcp/issues"},"license":"MIT","homepage":"https://github.com/available-dev/e-conomic-mcp#readme","keywords":["mcp","model-context-protocol","e-conomic","economic","visma","accounting","rest-api","claude"],"repository":{"type":"git","url":"git+https://github.com/available-dev/e-conomic-mcp.git"},"description":"Model Context Protocol (MCP) server and CLI for the e-conomic REST API. Full API coverage via a generic request tool, schema-driven discovery, optional per-endpoint tool generation, and typed convenience tools.","maintainers":[{"name":"available-rasmus","email":"rasmus@available.dk"}],"readme":"# e-conomic MCP server\n\nA [Model Context Protocol](https://modelcontextprotocol.io) (MCP) server for the\n[e-conomic REST API](https://restdocs.e-conomic.com/). It lets MCP-compatible\nclients (Claude Desktop, Claude Code, Cursor, etc.) read and write e-conomic\naccounting data — customers, suppliers, products, invoices, orders, journals,\naccounts and more.\n\nUnlike the few existing community/hosted e-conomic integrations (which expose\nonly a handful of endpoints), this server is **open-source, self-hostable, and\ncovers the whole API**: a generic request tool reaches every endpoint, typed\nconvenience tools cover the common workflows, and per-endpoint tools can be\ngenerated from an OpenAPI spec.\n\n## Quickstart\n\n```bash\n# install\nnpm install -g @available-dev/e-conomic-mcp\n\n# store your e-conomic credentials locally (app secret + agreement grant token)\ne-conomic-mcp auth login\n\n# verify it talks to the API\ne-conomic-mcp doctor        # → ✓ Authenticated. N resource collections available.\n```\n\nThen add it to your MCP client (e.g. Claude Code):\n\n```bash\nclaude mcp add e-conomic -- e-conomic-mcp\n```\n\n…or in `claude_desktop_config.json`:\n\n```json\n{ \"mcpServers\": { \"e-conomic\": { \"command\": \"e-conomic-mcp\" } } }\n```\n\nNow ask Claude things like *\"list my 5 most recent e-conomic customers\"*.\n\n## Features\n\n- **Full API coverage** via a universal `economic_request` tool — any method,\n  any path.\n- **File uploads** via `economic_upload_file` and typed attachment tools —\n  attach receipts/PDFs to vouchers, draft invoices, orders and quotes using\n  e-conomic's `multipart/form-data` endpoints (which `economic_request` can't\n  reach, as it only sends JSON).\n- **Typed convenience tools** for the high-traffic resources (customers,\n  suppliers, products, draft/booked invoices, orders, quotes, journals,\n  accounts, groups, payment terms, VAT zones, currencies, units, employees).\n- **Built-in pagination, filtering and sorting** for collection reads.\n- **Discovery tools** to list resources and (with a spec) describe an endpoint's\n  parameters and body schema before you call it.\n- **Optional dynamic per-endpoint tools** generated from an OpenAPI/Swagger spec\n  (Swagger 2.0 or OpenAPI 3.x).\n- **stdio transport** — drops straight into local MCP clients.\n\n## Requirements\n\n- Node.js >= 18\n- e-conomic credentials: an **app secret token** and an **agreement grant\n  token** (see below).\n\n## Install\n\n### From npm\n\n```bash\nnpm install -g @available-dev/e-conomic-mcp\n```\n\nThis puts an `e-conomic-mcp` command on your PATH.\n\n### From source\n\n```bash\ngit clone https://github.com/available-dev/e-conomic-mcp.git\ncd e-conomic-mcp\nnpm install            # also builds via the prepare script\nnpm link               # optional: expose the `e-conomic-mcp` command globally\n```\n\n## CLI\n\n```text\ne-conomic-mcp [serve]            Start the MCP server over stdio (default)\ne-conomic-mcp auth login         Interactively store credentials locally\ne-conomic-mcp auth set [flags]   Store credentials non-interactively\ne-conomic-mcp auth list          List configured account profiles\ne-conomic-mcp auth use <name>    Set the default account profile\ne-conomic-mcp auth status        Show where credentials are coming from\ne-conomic-mcp auth remove <name> Remove a stored account profile\ne-conomic-mcp auth logout        Remove all locally stored credentials\ne-conomic-mcp doctor             Check credentials and API connectivity\ne-conomic-mcp --help | --version\n```\n\n## Authentication\n\ne-conomic authenticates every REST call with two tokens, sent as headers:\n\n| Header | Env var | What it is |\n| --- | --- | --- |\n| `X-AppSecretToken` | `ECONOMIC_APP_SECRET_TOKEN` | Identifies your integration/app. From the e-conomic developer portal. |\n| `X-AgreementGrantToken` | `ECONOMIC_AGREEMENT_GRANT_TOKEN` | Identifies the company/agreement that granted your app access. |\n\nYou can provide them two ways (environment variables always take precedence):\n\n1. **Store them locally** with the CLI (recommended for desktop use):\n\n   ```bash\n   e-conomic-mcp auth login                     # interactive prompt\n   # or non-interactively:\n   e-conomic-mcp auth set --app-secret <token> --agreement-grant <token>\n   ```\n\n   Credentials are written to `~/.config/e-conomic-mcp/credentials.json`\n   (override with `$ECONOMIC_CONFIG_DIR` / `$XDG_CONFIG_HOME`) with `0600`\n   permissions. Check with `e-conomic-mcp auth status`; remove with\n   `e-conomic-mcp auth logout`. Multiple companies are supported as named\n   profiles — see [Multiple accounts / profiles](#multiple-accounts--profiles).\n\n2. **Environment variables** — set `ECONOMIC_APP_SECRET_TOKEN` and\n   `ECONOMIC_AGREEMENT_GRANT_TOKEN` (e.g. in your MCP client config, or via\n   `.env`).\n\n> OAuth support is planned; the credential store format is forward-compatible\n> with it.\n\n## Multiple accounts / profiles\n\nThe server can manage several e-conomic companies at once, stored as named\n**profiles**. A single running server can talk to any of them — no need to run\none process per company.\n\nStore a profile per account (omit `--profile` to use the `default` profile):\n\n```bash\ne-conomic-mcp auth set --profile acme   --app-secret <token> --agreement-grant <token>\ne-conomic-mcp auth set --profile globex --app-secret <token> --agreement-grant <token>\n\ne-conomic-mcp auth list                 # show profiles; * marks the active one\ne-conomic-mcp auth use globex           # change the default profile\ne-conomic-mcp doctor --all              # check connectivity for every profile\n```\n\nProfiles live in the same `credentials.json` under a `profiles` map. Existing\nsingle-account files are read transparently and treated as the `default`\nprofile — no migration needed.\n\n**Choosing a profile at runtime.** Every data tool takes an optional `profile`\nargument to target a specific company for that one call:\n\n```jsonc\n// economic_list_customers\n{ \"profile\": \"globex\", \"filter\": \"name$like:Acme\" }\n```\n\nTwo tools manage profiles from within a conversation:\n\n- **`economic_list_profiles`** — list configured profiles and the active one\n  (no secrets are returned).\n- **`economic_use_profile`** — switch the active profile, used as the default\n  for calls that don't pass `profile`.\n\nThe active profile defaults to the stored default (or `ECONOMIC_PROFILE`).\nEnvironment credentials (`ECONOMIC_APP_SECRET_TOKEN` etc.) configure — and take\nprecedence for — the active profile.\n\n## Usage\n\n### With Claude Desktop / Claude Code\n\nIf you ran `e-conomic-mcp auth login`, the MCP config is just:\n\n```json\n{\n  \"mcpServers\": {\n    \"e-conomic\": { \"command\": \"e-conomic-mcp\" }\n  }\n}\n```\n\nOtherwise pass the tokens via `env`:\n\n```json\n{\n  \"mcpServers\": {\n    \"e-conomic\": {\n      \"command\": \"e-conomic-mcp\",\n      \"env\": {\n        \"ECONOMIC_APP_SECRET_TOKEN\": \"your-app-secret-token\",\n        \"ECONOMIC_AGREEMENT_GRANT_TOKEN\": \"your-agreement-grant-token\"\n      }\n    }\n  }\n}\n```\n\n(If you didn't install globally, use `\"command\": \"node\"` with\n`\"args\": [\"/absolute/path/to/e-conomic-mcp/dist/index.js\"]`.)\n\n### Run directly\n\n```bash\nECONOMIC_APP_SECRET_TOKEN=... ECONOMIC_AGREEMENT_GRANT_TOKEN=... e-conomic-mcp\n```\n\nThe server speaks MCP over stdio. Use `e-conomic-mcp doctor` to verify your\ncredentials and connectivity first.\n\n## Configuration\n\n| Env var | Default | Description |\n| --- | --- | --- |\n| `ECONOMIC_APP_SECRET_TOKEN` | _(required)_ | App secret token. |\n| `ECONOMIC_AGREEMENT_GRANT_TOKEN` | _(required)_ | Agreement grant token. |\n| `ECONOMIC_BASE_URL` | `https://restapi.e-conomic.com` | API base URL. |\n| `ECONOMIC_PROFILE` | `default` | Active account profile to use (see [Multiple accounts](#multiple-accounts--profiles)). |\n| `ECONOMIC_OPENAPI_SPEC` | _(bundled)_ | Override the bundled OpenAPI spec with a path/URL (e.g. a newer one). |\n| `ECONOMIC_DYNAMIC_TOOLS` | `false` | Generate one tool per operation from the spec. |\n| `ECONOMIC_DYNAMIC_TOOLS_LIMIT` | `200` | Max number of dynamic tools to generate. |\n| `ECONOMIC_PAGE_SIZE` | `100` | Default page size for collection reads (max 1000). |\n| `ECONOMIC_TIMEOUT_MS` | `30000` | Per-request timeout. |\n\n## Tools\n\n### Generic (always available)\n\n- **`economic_request`** — call any endpoint: `{ method, path, query?, body? }`.\n  Sends a JSON body, so it cannot be used for binary file uploads — use\n  `economic_upload_file` for those.\n- **`economic_upload_file`** — upload a binary file to any `multipart/form-data`\n  endpoint: `{ path, filePath | content, fileName?, contentType?, method? }`.\n  The universal escape hatch for the attachment endpoints. Supply the file as a\n  local `filePath` or base64 `content`. Supported formats: `.pdf`, `.jpg`,\n  `.jpeg`, `.gif`, `.png` (draft invoices/orders/quotes accept PDF only); max\n  9 MB. Use `method: \"PATCH\"` to append pages to an existing voucher attachment.\n- **`economic_list_resources`** — list resource collections (from the spec, or\n  the API's self-describing root).\n- **`economic_get_collection`** — fetch a collection with `filter`, `sort`,\n  `pageSize`, `maxItems`, `fetchAll`.\n- **`economic_describe_endpoint`** — show an endpoint's parameters, request-body\n  and response schema (from the bundled OpenAPI spec).\n- **`economic_list_profiles`** / **`economic_use_profile`** — list configured\n  account profiles and switch the active one (see\n  [Multiple accounts](#multiple-accounts--profiles)). Every data tool also takes\n  an optional `profile` argument.\n\n### Typed convenience tools\n\n`economic_list_*` and `economic_get_*` for: customers, suppliers, products,\naccounts, draft invoices, booked invoices, orders, quotes, journals,\ndepartments, product/customer/supplier groups, payment terms, VAT zones, VAT\naccounts, currencies, units, employees.\n\nWrites: `economic_create_customer`, `economic_update_customer`,\n`economic_create_draft_invoice`, `economic_book_draft_invoice`.\n\nAttachments: `economic_upload_voucher_attachment` (with `append` to add pages),\n`economic_get_voucher_attachment`, `economic_delete_voucher_attachment`, and\n`economic_upload_draft_invoice_attachment` / `_draft_order_attachment` /\n`_draft_quote_attachment`.\n\n### Dynamic per-endpoint tools\n\nWhen `ECONOMIC_DYNAMIC_TOOLS=true`, every operation in the spec is exposed as an\n`economic_op_<operationId>` tool with a generated input schema (176 operations;\nbounded by `ECONOMIC_DYNAMIC_TOOLS_LIMIT`). Operations with a\n`multipart/form-data` body (the attachment uploads) take `filePath`/`content`\ninputs and are sent as multipart automatically.\n\n## Filtering & sorting\n\ne-conomic uses a compact filter syntax, e.g.:\n\n- `name$like:Acme` — name contains \"Acme\"\n- `customerNumber$gte:1000` — customer number ≥ 1000\n- combine with `$and:` / `$or:`\n\nSort by a field name; prefix with `-` for descending (e.g. `-customerNumber`).\n\n## Bundled API spec\n\nThe package ships with [`spec/economic-openapi.json`](./spec/economic-openapi.json)\n— an OpenAPI 3 description of all **160 e-conomic endpoints** (paths, methods,\nand request/response schemas), generated from e-conomic's published per-endpoint\nJSON schemas. It loads automatically and powers `economic_describe_endpoint` and\ndynamic per-endpoint tools with zero configuration.\n\nTo override it (e.g. point at a newer spec), set `ECONOMIC_OPENAPI_SPEC` to your\nown spec path/URL.\n\n## Development\n\n```bash\nnpm run typecheck   # type-check only\nnpm run watch       # incremental compile\nnpm run doctor      # verify credentials/connectivity (needs env vars)\n```\n\n## Publishing to npm\n\nThe package builds to `dist/` and exposes the `e-conomic-mcp` bin. `prepare`\nbuilds on install and `prepublishOnly` does a clean rebuild before publish.\n\n```bash\nnpm run build\nnpm pack --dry-run     # inspect the tarball contents\nnpm publish            # publishConfig.access is already set to public\n```\n\nBump the version with `npm version <patch|minor|major>` first. Publish once the\nserver is verified against a live e-conomic account.\n\n## Disclaimer\n\nThis is an independent, community project and is not affiliated with or endorsed\nby e-conomic / Visma. \"e-conomic\" is a trademark of its respective owner. Use in\naccordance with e-conomic's API terms.\n\n## License\n\n[MIT](./LICENSE)\n","readmeFilename":"README.md"}