siigo-mcp-server 1.0.0
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/.env.example +10 -0
- package/README.md +245 -0
- package/bin/siigo-mcp +20 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +1094 -0
- package/dist/index.js.map +1 -0
- package/dist/siigo-client.d.ts +113 -0
- package/dist/siigo-client.d.ts.map +1 -0
- package/dist/siigo-client.js +215 -0
- package/dist/siigo-client.js.map +1 -0
- package/dist/types.d.ts +161 -0
- package/dist/types.d.ts.map +1 -0
- package/dist/types.js +3 -0
- package/dist/types.js.map +1 -0
- package/package.json +60 -0
package/.env.example
ADDED
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
# Siigo API Configuration
|
|
2
|
+
SIIGO_USERNAME=your_siigo_username
|
|
3
|
+
SIIGO_ACCESS_KEY=your_siigo_access_key
|
|
4
|
+
SIIGO_BASE_URL=https://api.siigo.com
|
|
5
|
+
SIIGO_PARTNER_ID=siigo-mcp-server
|
|
6
|
+
|
|
7
|
+
# Optional: Use sandbox environment for testing
|
|
8
|
+
# SIIGO_BASE_URL=https://api.siigo.com
|
|
9
|
+
# SIIGO_USERNAME=sandbox@siigoapi.com
|
|
10
|
+
# SIIGO_ACCESS_KEY=your_sandbox_access_key
|
package/README.md
ADDED
|
@@ -0,0 +1,245 @@
|
|
|
1
|
+
# Siigo MCP Server
|
|
2
|
+
|
|
3
|
+
A Model Context Protocol (MCP) server that provides integration with the Siigo API, enabling access to Colombian accounting software features including products, customers, invoices, purchases, credit notes, vouchers, payment receipts, and journals.
|
|
4
|
+
|
|
5
|
+
## Features
|
|
6
|
+
|
|
7
|
+
This MCP server provides access to all major Siigo API endpoints:
|
|
8
|
+
|
|
9
|
+
### Core Resources
|
|
10
|
+
- **Products**: Create, read, update, and delete products/services
|
|
11
|
+
- **Customers**: Manage customer/supplier information
|
|
12
|
+
- **Invoices**: Handle sales invoices with electronic invoicing support
|
|
13
|
+
- **Purchases**: Manage purchase invoices and expenses
|
|
14
|
+
- **Credit Notes**: Create and manage credit notes
|
|
15
|
+
- **Vouchers**: Handle cash receipts (recibos de caja)
|
|
16
|
+
- **Payment Receipts**: Manage payment receipts/disbursements
|
|
17
|
+
- **Journals**: Handle accounting journal entries
|
|
18
|
+
|
|
19
|
+
### Catalogs
|
|
20
|
+
- Document types, taxes, payment types
|
|
21
|
+
- Cost centers, users, warehouses
|
|
22
|
+
- Price lists, account groups, cities
|
|
23
|
+
- ID types, fiscal responsibilities
|
|
24
|
+
|
|
25
|
+
### Reports
|
|
26
|
+
- Trial balance reports
|
|
27
|
+
- Trial balance by third party
|
|
28
|
+
- Accounts payable reports
|
|
29
|
+
|
|
30
|
+
## Installation
|
|
31
|
+
|
|
32
|
+
1. Clone this repository:
|
|
33
|
+
```bash
|
|
34
|
+
git clone <repository-url>
|
|
35
|
+
cd siigo-mcp
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
2. Install dependencies:
|
|
39
|
+
```bash
|
|
40
|
+
npm install
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
3. Build the TypeScript code:
|
|
44
|
+
```bash
|
|
45
|
+
npm run build
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
4. Set up environment variables by copying the example file:
|
|
49
|
+
```bash
|
|
50
|
+
cp .env.example .env
|
|
51
|
+
```
|
|
52
|
+
|
|
53
|
+
5. Edit `.env` with your Siigo credentials:
|
|
54
|
+
```bash
|
|
55
|
+
SIIGO_USERNAME=your_siigo_username
|
|
56
|
+
SIIGO_ACCESS_KEY=your_siigo_access_key
|
|
57
|
+
SIIGO_BASE_URL=https://api.siigo.com
|
|
58
|
+
SIIGO_PARTNER_ID=your_app_name
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
## Configuration
|
|
62
|
+
|
|
63
|
+
### Required Environment Variables
|
|
64
|
+
|
|
65
|
+
- `SIIGO_USERNAME`: Your Siigo API username
|
|
66
|
+
- `SIIGO_ACCESS_KEY`: Your Siigo API access key
|
|
67
|
+
|
|
68
|
+
### Optional Environment Variables
|
|
69
|
+
|
|
70
|
+
- `SIIGO_BASE_URL`: API base URL (defaults to `https://api.siigo.com`)
|
|
71
|
+
- `SIIGO_PARTNER_ID`: Partner ID for API identification (defaults to `siigo-mcp-server`)
|
|
72
|
+
|
|
73
|
+
### Getting Siigo API Credentials
|
|
74
|
+
|
|
75
|
+
1. Sign up for a Siigo account at [siigo.com](https://siigo.com)
|
|
76
|
+
2. Access the API section in your Siigo dashboard
|
|
77
|
+
3. Generate your API credentials (username and access key)
|
|
78
|
+
4. For testing, you can use the sandbox environment
|
|
79
|
+
|
|
80
|
+
## Usage
|
|
81
|
+
|
|
82
|
+
### Running the Server
|
|
83
|
+
|
|
84
|
+
Start the MCP server:
|
|
85
|
+
```bash
|
|
86
|
+
npm start
|
|
87
|
+
```
|
|
88
|
+
|
|
89
|
+
For development with auto-reload:
|
|
90
|
+
```bash
|
|
91
|
+
npm run dev
|
|
92
|
+
```
|
|
93
|
+
|
|
94
|
+
### Available Tools
|
|
95
|
+
|
|
96
|
+
The server provides 40+ tools for interacting with the Siigo API. Here are some examples:
|
|
97
|
+
|
|
98
|
+
#### Products
|
|
99
|
+
- `siigo_get_products` - List all products
|
|
100
|
+
- `siigo_get_product` - Get a specific product by ID
|
|
101
|
+
- `siigo_create_product` - Create a new product
|
|
102
|
+
- `siigo_update_product` - Update an existing product
|
|
103
|
+
- `siigo_delete_product` - Delete a product
|
|
104
|
+
|
|
105
|
+
#### Customers
|
|
106
|
+
- `siigo_get_customers` - List all customers
|
|
107
|
+
- `siigo_get_customer` - Get a specific customer by ID
|
|
108
|
+
- `siigo_create_customer` - Create a new customer
|
|
109
|
+
- `siigo_update_customer` - Update an existing customer
|
|
110
|
+
|
|
111
|
+
#### Invoices
|
|
112
|
+
- `siigo_get_invoices` - List all invoices
|
|
113
|
+
- `siigo_get_invoice` - Get a specific invoice by ID
|
|
114
|
+
- `siigo_create_invoice` - Create a new invoice
|
|
115
|
+
- `siigo_update_invoice` - Update an existing invoice
|
|
116
|
+
- `siigo_delete_invoice` - Delete an invoice
|
|
117
|
+
- `siigo_get_invoice_pdf` - Get invoice PDF
|
|
118
|
+
- `siigo_send_invoice_email` - Send invoice by email
|
|
119
|
+
|
|
120
|
+
#### Catalogs
|
|
121
|
+
- `siigo_get_document_types` - Get document types
|
|
122
|
+
- `siigo_get_taxes` - Get tax information
|
|
123
|
+
- `siigo_get_payment_types` - Get payment methods
|
|
124
|
+
- `siigo_get_cost_centers` - Get cost centers
|
|
125
|
+
- `siigo_get_users` - Get system users
|
|
126
|
+
|
|
127
|
+
#### Reports
|
|
128
|
+
- `siigo_get_trial_balance` - Generate trial balance report
|
|
129
|
+
- `siigo_get_accounts_payable` - Get accounts payable report
|
|
130
|
+
|
|
131
|
+
### Example Usage
|
|
132
|
+
|
|
133
|
+
#### Creating a Product
|
|
134
|
+
```json
|
|
135
|
+
{
|
|
136
|
+
"name": "siigo_create_product",
|
|
137
|
+
"arguments": {
|
|
138
|
+
"product": {
|
|
139
|
+
"code": "PROD001",
|
|
140
|
+
"name": "Test Product",
|
|
141
|
+
"account_group": 1253,
|
|
142
|
+
"type": "Product",
|
|
143
|
+
"active": true,
|
|
144
|
+
"description": "A test product"
|
|
145
|
+
}
|
|
146
|
+
}
|
|
147
|
+
}
|
|
148
|
+
```
|
|
149
|
+
|
|
150
|
+
#### Creating a Customer
|
|
151
|
+
```json
|
|
152
|
+
{
|
|
153
|
+
"name": "siigo_create_customer",
|
|
154
|
+
"arguments": {
|
|
155
|
+
"customer": {
|
|
156
|
+
"person_type": "Person",
|
|
157
|
+
"id_type": "13",
|
|
158
|
+
"identification": "12345678",
|
|
159
|
+
"name": ["John", "Doe"],
|
|
160
|
+
"address": {
|
|
161
|
+
"address": "123 Main St",
|
|
162
|
+
"city": {
|
|
163
|
+
"country_code": "Co",
|
|
164
|
+
"state_code": "11",
|
|
165
|
+
"city_code": "11001"
|
|
166
|
+
}
|
|
167
|
+
},
|
|
168
|
+
"phones": [{"number": "1234567890"}],
|
|
169
|
+
"contacts": [{
|
|
170
|
+
"first_name": "John",
|
|
171
|
+
"last_name": "Doe",
|
|
172
|
+
"email": "john@example.com"
|
|
173
|
+
}]
|
|
174
|
+
}
|
|
175
|
+
}
|
|
176
|
+
}
|
|
177
|
+
```
|
|
178
|
+
|
|
179
|
+
## API Rate Limits
|
|
180
|
+
|
|
181
|
+
Siigo API has the following rate limits:
|
|
182
|
+
- Production: 100 requests per minute per company
|
|
183
|
+
- Sandbox: 10 requests per minute
|
|
184
|
+
|
|
185
|
+
## Error Handling
|
|
186
|
+
|
|
187
|
+
The server handles various Siigo API errors and returns structured error responses. Common error scenarios include:
|
|
188
|
+
|
|
189
|
+
- Authentication failures
|
|
190
|
+
- Invalid parameters
|
|
191
|
+
- Rate limit exceeded
|
|
192
|
+
- Resource not found
|
|
193
|
+
- Validation errors
|
|
194
|
+
|
|
195
|
+
## Development
|
|
196
|
+
|
|
197
|
+
### Project Structure
|
|
198
|
+
|
|
199
|
+
```
|
|
200
|
+
siigo-mcp/
|
|
201
|
+
├── src/
|
|
202
|
+
│ ├── index.ts # Main MCP server implementation
|
|
203
|
+
│ ├── siigo-client.ts # Siigo API client
|
|
204
|
+
│ └── types.ts # TypeScript type definitions
|
|
205
|
+
├── package.json
|
|
206
|
+
├── tsconfig.json
|
|
207
|
+
├── .env.example
|
|
208
|
+
└── README.md
|
|
209
|
+
```
|
|
210
|
+
|
|
211
|
+
### Building
|
|
212
|
+
|
|
213
|
+
```bash
|
|
214
|
+
npm run build
|
|
215
|
+
```
|
|
216
|
+
|
|
217
|
+
### Testing
|
|
218
|
+
|
|
219
|
+
```bash
|
|
220
|
+
npm test
|
|
221
|
+
```
|
|
222
|
+
|
|
223
|
+
## Contributing
|
|
224
|
+
|
|
225
|
+
1. Fork the repository
|
|
226
|
+
2. Create a feature branch
|
|
227
|
+
3. Make your changes
|
|
228
|
+
4. Add tests if applicable
|
|
229
|
+
5. Submit a pull request
|
|
230
|
+
|
|
231
|
+
## License
|
|
232
|
+
|
|
233
|
+
MIT License
|
|
234
|
+
|
|
235
|
+
## Support
|
|
236
|
+
|
|
237
|
+
For issues related to:
|
|
238
|
+
- Siigo API: Contact Siigo support at soporteapi@siigo.com
|
|
239
|
+
- This MCP server: Create an issue in this repository
|
|
240
|
+
|
|
241
|
+
## Links
|
|
242
|
+
|
|
243
|
+
- [Siigo API Documentation](https://siigoapi.docs.apiary.io/)
|
|
244
|
+
- [Model Context Protocol](https://modelcontextprotocol.io/)
|
|
245
|
+
- [Siigo Official Website](https://siigo.com/)
|
package/bin/siigo-mcp
ADDED
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
|
|
3
|
+
const path = require('path');
|
|
4
|
+
const { spawn } = require('child_process');
|
|
5
|
+
|
|
6
|
+
const serverPath = path.join(__dirname, '..', 'dist', 'index.js');
|
|
7
|
+
|
|
8
|
+
const child = spawn('node', [serverPath], {
|
|
9
|
+
stdio: 'inherit',
|
|
10
|
+
env: process.env
|
|
11
|
+
});
|
|
12
|
+
|
|
13
|
+
child.on('error', (error) => {
|
|
14
|
+
console.error('Failed to start Siigo MCP server:', error);
|
|
15
|
+
process.exit(1);
|
|
16
|
+
});
|
|
17
|
+
|
|
18
|
+
child.on('exit', (code) => {
|
|
19
|
+
process.exit(code);
|
|
20
|
+
});
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":""}
|