@codespar/mcp-alegra 0.2.0 → 0.2.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +31 -6
- package/dist/index.js +5 -2
- package/package.json +12 -3
package/README.md
CHANGED
|
@@ -25,19 +25,29 @@ npx tsx packages/colombia/alegra/src/index.ts --http
|
|
|
25
25
|
| `MCP_HTTP` | No | Set to `"true"` to enable HTTP transport |
|
|
26
26
|
| `MCP_PORT` | No | HTTP port (default: 3000) |
|
|
27
27
|
|
|
28
|
-
## Tools
|
|
28
|
+
## Tools (20)
|
|
29
29
|
|
|
30
|
-
| Tool |
|
|
31
|
-
|
|
30
|
+
| Tool | Purpose |
|
|
31
|
+
|---|---|
|
|
32
32
|
| `create_invoice` | Create an invoice |
|
|
33
33
|
| `get_invoice` | Get invoice details by ID |
|
|
34
34
|
| `list_invoices` | List invoices |
|
|
35
|
-
| `
|
|
35
|
+
| `void_invoice` | Void/cancel an invoice |
|
|
36
|
+
| `get_invoice_pdf` | Get invoice PDF download URL |
|
|
37
|
+
| `send_invoice` | Email an invoice to one or more recipients |
|
|
38
|
+
| `create_contact` | Create a contact (customer or supplier) |
|
|
39
|
+
| `update_contact` | Update an existing contact |
|
|
40
|
+
| `delete_contact` | Delete a contact |
|
|
36
41
|
| `list_contacts` | List contacts |
|
|
37
|
-
| `create_item` | Create a product
|
|
42
|
+
| `create_item` | Create a product or service item |
|
|
43
|
+
| `update_item` | Update an existing item |
|
|
38
44
|
| `list_items` | List products and services |
|
|
39
45
|
| `list_payments` | List payments |
|
|
46
|
+
| `get_payment` | Get payment by ID |
|
|
40
47
|
| `create_payment` | Record a payment |
|
|
48
|
+
| `void_payment` | Void/annul a payment |
|
|
49
|
+
| `list_categories` | List item categories (chart of accounts) |
|
|
50
|
+
| `list_bank_accounts` | List bank accounts |
|
|
41
51
|
| `get_company` | Get company profile and settings |
|
|
42
52
|
|
|
43
53
|
## Auth
|
|
@@ -50,4 +60,19 @@ Uses **Basic authentication** with email and API token. Obtain your API token fr
|
|
|
50
60
|
|
|
51
61
|
---
|
|
52
62
|
|
|
53
|
-
|
|
63
|
+
## Enterprise
|
|
64
|
+
|
|
65
|
+
Need governance, budget limits, and audit trails for agent payments? [CodeSpar Enterprise](https://codespar.dev/enterprise) adds policy engine, payment routing, and compliance templates on top of these MCP servers.
|
|
66
|
+
|
|
67
|
+
## Authentication
|
|
68
|
+
|
|
69
|
+
Set these environment variables before launching the server:
|
|
70
|
+
|
|
71
|
+
- `ALEGRA_EMAIL` *(required)* — Account email for Alegra
|
|
72
|
+
- `ALEGRA_API_TOKEN` *(required, secret)* — API token for Alegra
|
|
73
|
+
|
|
74
|
+
Issue credentials at the provider's developer portal: <https://developer.alegra.com>.
|
|
75
|
+
|
|
76
|
+
## License
|
|
77
|
+
|
|
78
|
+
MIT
|
package/dist/index.js
CHANGED
|
@@ -53,7 +53,10 @@ async function alegraRequest(method, path, body) {
|
|
|
53
53
|
}
|
|
54
54
|
return res.json();
|
|
55
55
|
}
|
|
56
|
-
|
|
56
|
+
// Managed-tier pointer surfaced to the agent via MCP `instructions`.
|
|
57
|
+
// Informational only — nothing CodeSpar-hosted is called (MIT-safe).
|
|
58
|
+
const MANAGED_TIER_HINT = "This open-source CodeSpar server calls the provider's API directly. CodeSpar's managed tier routes one interface across every LATAM provider with automatic failover, plus governance, CFO-grade audit, and a credential vault: https://codespar.dev/agents (npx -y @codespar/mcp serve).";
|
|
59
|
+
const server = new Server({ name: "mcp-alegra", version: "0.2.1" }, { capabilities: { tools: {} }, instructions: MANAGED_TIER_HINT });
|
|
57
60
|
server.setRequestHandler(ListToolsRequestSchema, async () => ({
|
|
58
61
|
tools: [
|
|
59
62
|
{
|
|
@@ -635,7 +638,7 @@ async function main() {
|
|
|
635
638
|
const t = new StreamableHTTPServerTransport({ sessionIdGenerator: () => randomUUID(), onsessioninitialized: (id) => { transports.set(id, t); } });
|
|
636
639
|
t.onclose = () => { if (t.sessionId)
|
|
637
640
|
transports.delete(t.sessionId); };
|
|
638
|
-
const s = new Server({ name: "mcp-alegra", version: "0.2.
|
|
641
|
+
const s = new Server({ name: "mcp-alegra", version: "0.2.1" }, { capabilities: { tools: {} } });
|
|
639
642
|
server._requestHandlers.forEach((v, k) => s._requestHandlers.set(k, v));
|
|
640
643
|
server._notificationHandlers?.forEach((v, k) => s._notificationHandlers.set(k, v));
|
|
641
644
|
await s.connect(t);
|
package/package.json
CHANGED
|
@@ -1,13 +1,15 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@codespar/mcp-alegra",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.2",
|
|
4
4
|
"description": "MCP server for Alegra — cloud accounting for LATAM (Colombian-founded)",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.js",
|
|
7
7
|
"bin": {
|
|
8
8
|
"mcp-alegra": "dist/index.js"
|
|
9
9
|
},
|
|
10
|
-
"files": [
|
|
10
|
+
"files": [
|
|
11
|
+
"dist"
|
|
12
|
+
],
|
|
11
13
|
"scripts": {
|
|
12
14
|
"build": "tsc",
|
|
13
15
|
"start": "node dist/index.js"
|
|
@@ -20,6 +22,13 @@
|
|
|
20
22
|
"typescript": "^5.8.0"
|
|
21
23
|
},
|
|
22
24
|
"license": "MIT",
|
|
23
|
-
"keywords": [
|
|
25
|
+
"keywords": [
|
|
26
|
+
"alegra",
|
|
27
|
+
"accounting",
|
|
28
|
+
"colombia",
|
|
29
|
+
"latam",
|
|
30
|
+
"invoicing",
|
|
31
|
+
"mcp"
|
|
32
|
+
],
|
|
24
33
|
"mcpName": "io.github.codespar/mcp-alegra"
|
|
25
34
|
}
|