marqeta-diva-mcp 0.2.0__py3-none-any.whl
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.
- marqeta_diva_mcp/__init__.py +3 -0
- marqeta_diva_mcp/__main__.py +6 -0
- marqeta_diva_mcp/client.py +471 -0
- marqeta_diva_mcp/embeddings.py +131 -0
- marqeta_diva_mcp/local_storage.py +348 -0
- marqeta_diva_mcp/rag_tools.py +366 -0
- marqeta_diva_mcp/server.py +940 -0
- marqeta_diva_mcp/vector_store.py +274 -0
- marqeta_diva_mcp-0.2.0.dist-info/METADATA +515 -0
- marqeta_diva_mcp-0.2.0.dist-info/RECORD +13 -0
- marqeta_diva_mcp-0.2.0.dist-info/WHEEL +4 -0
- marqeta_diva_mcp-0.2.0.dist-info/entry_points.txt +2 -0
- marqeta_diva_mcp-0.2.0.dist-info/licenses/LICENSE +21 -0
|
@@ -0,0 +1,515 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: marqeta-diva-mcp
|
|
3
|
+
Version: 0.2.0
|
|
4
|
+
Summary: MCP server for Marqeta DiVA API - Data insights, Visualization, and Analytics
|
|
5
|
+
Project-URL: Homepage, https://github.com/zvika-finally/marqeta-diva-mcp
|
|
6
|
+
Project-URL: Repository, https://github.com/zvika-finally/marqeta-diva-mcp
|
|
7
|
+
Project-URL: Issues, https://github.com/zvika-finally/marqeta-diva-mcp/issues
|
|
8
|
+
Project-URL: Documentation, https://github.com/zvika-finally/marqeta-diva-mcp#readme
|
|
9
|
+
Author-email: Zvika Badalov <zvika.badalov@finally.com>
|
|
10
|
+
License: MIT
|
|
11
|
+
License-File: LICENSE
|
|
12
|
+
Keywords: analytics,api,diva,fintech,marqeta,mcp,model-context-protocol
|
|
13
|
+
Classifier: Development Status :: 4 - Beta
|
|
14
|
+
Classifier: Intended Audience :: Developers
|
|
15
|
+
Classifier: License :: OSI Approved :: MIT License
|
|
16
|
+
Classifier: Programming Language :: Python :: 3
|
|
17
|
+
Classifier: Programming Language :: Python :: 3.10
|
|
18
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
19
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
20
|
+
Classifier: Topic :: Office/Business :: Financial
|
|
21
|
+
Classifier: Topic :: Software Development :: Libraries :: Python Modules
|
|
22
|
+
Requires-Python: >=3.10
|
|
23
|
+
Requires-Dist: httpx>=0.27.0
|
|
24
|
+
Requires-Dist: mcp>=1.0.0
|
|
25
|
+
Requires-Dist: pydantic>=2.0.0
|
|
26
|
+
Requires-Dist: python-dotenv>=1.0.0
|
|
27
|
+
Provides-Extra: all
|
|
28
|
+
Requires-Dist: black>=23.0.0; extra == 'all'
|
|
29
|
+
Requires-Dist: chromadb>=0.4.22; extra == 'all'
|
|
30
|
+
Requires-Dist: pytest>=7.0.0; extra == 'all'
|
|
31
|
+
Requires-Dist: ruff>=0.1.0; extra == 'all'
|
|
32
|
+
Requires-Dist: sentence-transformers>=2.3.1; extra == 'all'
|
|
33
|
+
Provides-Extra: dev
|
|
34
|
+
Requires-Dist: black>=23.0.0; extra == 'dev'
|
|
35
|
+
Requires-Dist: pytest>=7.0.0; extra == 'dev'
|
|
36
|
+
Requires-Dist: ruff>=0.1.0; extra == 'dev'
|
|
37
|
+
Provides-Extra: rag
|
|
38
|
+
Requires-Dist: chromadb>=0.4.22; extra == 'rag'
|
|
39
|
+
Requires-Dist: sentence-transformers>=2.3.1; extra == 'rag'
|
|
40
|
+
Description-Content-Type: text/markdown
|
|
41
|
+
|
|
42
|
+
# Marqeta DiVA API MCP Server
|
|
43
|
+
|
|
44
|
+
[](https://badge.fury.io/py/marqeta-diva-mcp)
|
|
45
|
+
[](https://www.python.org/downloads/)
|
|
46
|
+
[](https://opensource.org/licenses/MIT)
|
|
47
|
+
|
|
48
|
+
A Model Context Protocol (MCP) server that provides programmatic access to the Marqeta DiVA (Data insights, Visualization, and Analytics) API. This server enables AI assistants and applications to retrieve aggregated production data from the Marqeta platform for reporting, analytics, and data-driven business decisions.
|
|
49
|
+
|
|
50
|
+
> **Note:** This is an unofficial community project and is not officially supported by Marqeta.
|
|
51
|
+
|
|
52
|
+
## Features
|
|
53
|
+
|
|
54
|
+
### Core Features (Always Available)
|
|
55
|
+
- **Transaction Data**: Access authorizations, settlements, clearings, declines, and loads
|
|
56
|
+
- **Financial Data**: Retrieve program balances, settlement balances, and activity balances
|
|
57
|
+
- **Card & User Data**: Get card and user details with flexible filtering
|
|
58
|
+
- **Chargeback Data**: Access chargeback status and detailed information
|
|
59
|
+
- **Metadata Tools**: Discover available views and retrieve schema definitions
|
|
60
|
+
- **Export Tools**: Export data to JSON or CSV files
|
|
61
|
+
- **Rate Limiting**: Built-in rate limiting to comply with API limits (300 requests per 5 minutes)
|
|
62
|
+
- **Error Handling**: Comprehensive error handling with meaningful messages
|
|
63
|
+
- **Flexible Querying**: Support for filtering, sorting, field selection, date ranges, and more
|
|
64
|
+
|
|
65
|
+
### Optional RAG Features (Requires `[rag]` extras)
|
|
66
|
+
- **Local Storage**: Store complete transaction data in SQLite (bypasses MCP token limits)
|
|
67
|
+
- **Semantic Search**: Natural language queries on transaction data using AI embeddings
|
|
68
|
+
- **Vector Store**: ChromaDB integration for similarity-based transaction search
|
|
69
|
+
- **Offline Analysis**: Query local data without API calls or token limits
|
|
70
|
+
|
|
71
|
+
## Prerequisites
|
|
72
|
+
|
|
73
|
+
- Python 3.10 or higher
|
|
74
|
+
- [uv](https://docs.astral.sh/uv/) package manager (for running with `uvx`)
|
|
75
|
+
- Marqeta DiVA API credentials (Application Token, Access Token, and Program Name)
|
|
76
|
+
|
|
77
|
+
## Installation
|
|
78
|
+
|
|
79
|
+
### Option 1: Run with uvx (Recommended)
|
|
80
|
+
|
|
81
|
+
No installation needed! `uvx` will automatically handle dependencies when you run the server.
|
|
82
|
+
|
|
83
|
+
**For basic features only:**
|
|
84
|
+
```bash
|
|
85
|
+
uvx marqeta-diva-mcp
|
|
86
|
+
```
|
|
87
|
+
|
|
88
|
+
**For RAG features (local storage + semantic search):**
|
|
89
|
+
```bash
|
|
90
|
+
uvx --with marqeta-diva-mcp[rag] marqeta-diva-mcp
|
|
91
|
+
```
|
|
92
|
+
|
|
93
|
+
### Option 2: Traditional Installation
|
|
94
|
+
|
|
95
|
+
**Basic installation (core features only):**
|
|
96
|
+
```bash
|
|
97
|
+
pip install marqeta-diva-mcp
|
|
98
|
+
```
|
|
99
|
+
|
|
100
|
+
**With RAG features (recommended for advanced analytics):**
|
|
101
|
+
```bash
|
|
102
|
+
pip install marqeta-diva-mcp[rag]
|
|
103
|
+
```
|
|
104
|
+
|
|
105
|
+
**From source:**
|
|
106
|
+
```bash
|
|
107
|
+
cd marqeta-diva-mcp
|
|
108
|
+
pip install -e . # Basic features
|
|
109
|
+
pip install -e ".[rag]" # With RAG features
|
|
110
|
+
```
|
|
111
|
+
|
|
112
|
+
## Configuration
|
|
113
|
+
|
|
114
|
+
1. Copy the example environment file:
|
|
115
|
+
|
|
116
|
+
```bash
|
|
117
|
+
cp .env.example .env
|
|
118
|
+
```
|
|
119
|
+
|
|
120
|
+
2. Edit `.env` and add your Marqeta DiVA API credentials:
|
|
121
|
+
|
|
122
|
+
```env
|
|
123
|
+
# Required: Marqeta DiVA API credentials
|
|
124
|
+
MARQETA_APP_TOKEN=your_application_token_here
|
|
125
|
+
MARQETA_ACCESS_TOKEN=your_access_token_here
|
|
126
|
+
MARQETA_PROGRAM=your_program_name_here
|
|
127
|
+
|
|
128
|
+
# Optional: Enable local storage and RAG features
|
|
129
|
+
# Requires: pip install marqeta-diva-mcp[rag]
|
|
130
|
+
# ENABLE_LOCAL_STORAGE=true
|
|
131
|
+
```
|
|
132
|
+
|
|
133
|
+
**How to obtain credentials:**
|
|
134
|
+
- Contact your Marqeta representative, OR
|
|
135
|
+
- Generate via Marqeta Dashboard (Reports section)
|
|
136
|
+
|
|
137
|
+
**Enabling RAG Features:**
|
|
138
|
+
|
|
139
|
+
To use local storage, semantic search, and other RAG features:
|
|
140
|
+
|
|
141
|
+
1. Install RAG dependencies: `pip install marqeta-diva-mcp[rag]`
|
|
142
|
+
2. Set environment variable: `ENABLE_LOCAL_STORAGE=true`
|
|
143
|
+
3. Restart the MCP server
|
|
144
|
+
|
|
145
|
+
When enabled, you'll see this message in the logs:
|
|
146
|
+
```
|
|
147
|
+
[MCP Server] Local storage and RAG features ENABLED
|
|
148
|
+
```
|
|
149
|
+
|
|
150
|
+
When disabled (default):
|
|
151
|
+
```
|
|
152
|
+
[MCP Server] Local storage and RAG features DISABLED (set ENABLE_LOCAL_STORAGE=true to enable)
|
|
153
|
+
```
|
|
154
|
+
|
|
155
|
+
## Usage
|
|
156
|
+
|
|
157
|
+
### Running the Server Locally
|
|
158
|
+
|
|
159
|
+
#### With uvx (Recommended)
|
|
160
|
+
|
|
161
|
+
```bash
|
|
162
|
+
cd marqeta-diva-mcp
|
|
163
|
+
uvx marqeta-diva-mcp
|
|
164
|
+
```
|
|
165
|
+
|
|
166
|
+
#### With Python
|
|
167
|
+
|
|
168
|
+
```bash
|
|
169
|
+
cd marqeta-diva-mcp
|
|
170
|
+
python -m marqeta_diva_mcp.server
|
|
171
|
+
```
|
|
172
|
+
|
|
173
|
+
### Adding to Claude Desktop
|
|
174
|
+
|
|
175
|
+
Add this configuration to your Claude Desktop config file:
|
|
176
|
+
|
|
177
|
+
**macOS**: `~/Library/Application Support/Claude/claude_desktop_config.json`
|
|
178
|
+
**Windows**: `%APPDATA%/Claude/claude_desktop_config.json`
|
|
179
|
+
|
|
180
|
+
#### Using uvx (Recommended)
|
|
181
|
+
|
|
182
|
+
**Basic configuration (core features only):**
|
|
183
|
+
```json
|
|
184
|
+
{
|
|
185
|
+
"mcpServers": {
|
|
186
|
+
"marqeta-diva": {
|
|
187
|
+
"command": "uvx",
|
|
188
|
+
"args": ["marqeta-diva-mcp"],
|
|
189
|
+
"env": {
|
|
190
|
+
"MARQETA_APP_TOKEN": "your_application_token",
|
|
191
|
+
"MARQETA_ACCESS_TOKEN": "your_access_token",
|
|
192
|
+
"MARQETA_PROGRAM": "your_program_name"
|
|
193
|
+
}
|
|
194
|
+
}
|
|
195
|
+
}
|
|
196
|
+
}
|
|
197
|
+
```
|
|
198
|
+
|
|
199
|
+
**With RAG features (local storage + semantic search):**
|
|
200
|
+
```json
|
|
201
|
+
{
|
|
202
|
+
"mcpServers": {
|
|
203
|
+
"marqeta-diva": {
|
|
204
|
+
"command": "uvx",
|
|
205
|
+
"args": ["--with", "marqeta-diva-mcp[rag]", "marqeta-diva-mcp"],
|
|
206
|
+
"env": {
|
|
207
|
+
"MARQETA_APP_TOKEN": "your_application_token",
|
|
208
|
+
"MARQETA_ACCESS_TOKEN": "your_access_token",
|
|
209
|
+
"MARQETA_PROGRAM": "your_program_name",
|
|
210
|
+
"ENABLE_LOCAL_STORAGE": "true"
|
|
211
|
+
}
|
|
212
|
+
}
|
|
213
|
+
}
|
|
214
|
+
}
|
|
215
|
+
```
|
|
216
|
+
|
|
217
|
+
#### Using Python
|
|
218
|
+
|
|
219
|
+
**Basic configuration (core features only):**
|
|
220
|
+
```json
|
|
221
|
+
{
|
|
222
|
+
"mcpServers": {
|
|
223
|
+
"marqeta-diva": {
|
|
224
|
+
"command": "python",
|
|
225
|
+
"args": ["-m", "marqeta_diva_mcp.server"],
|
|
226
|
+
"cwd": "/path/to/marqeta-diva-mcp",
|
|
227
|
+
"env": {
|
|
228
|
+
"MARQETA_APP_TOKEN": "your_application_token",
|
|
229
|
+
"MARQETA_ACCESS_TOKEN": "your_access_token",
|
|
230
|
+
"MARQETA_PROGRAM": "your_program_name"
|
|
231
|
+
}
|
|
232
|
+
}
|
|
233
|
+
}
|
|
234
|
+
}
|
|
235
|
+
```
|
|
236
|
+
|
|
237
|
+
**With RAG features (requires `pip install -e ".[rag]"` first):**
|
|
238
|
+
```json
|
|
239
|
+
{
|
|
240
|
+
"mcpServers": {
|
|
241
|
+
"marqeta-diva": {
|
|
242
|
+
"command": "python",
|
|
243
|
+
"args": ["-m", "marqeta_diva_mcp.server"],
|
|
244
|
+
"cwd": "/path/to/marqeta-diva-mcp",
|
|
245
|
+
"env": {
|
|
246
|
+
"MARQETA_APP_TOKEN": "your_application_token",
|
|
247
|
+
"MARQETA_ACCESS_TOKEN": "your_access_token",
|
|
248
|
+
"MARQETA_PROGRAM": "your_program_name",
|
|
249
|
+
"ENABLE_LOCAL_STORAGE": "true"
|
|
250
|
+
}
|
|
251
|
+
}
|
|
252
|
+
}
|
|
253
|
+
}
|
|
254
|
+
```
|
|
255
|
+
|
|
256
|
+
## Available Tools
|
|
257
|
+
|
|
258
|
+
### Transaction Tools
|
|
259
|
+
|
|
260
|
+
#### `get_authorizations`
|
|
261
|
+
Get authorization transaction data with amounts, counts, acting users/cards, and merchant information.
|
|
262
|
+
|
|
263
|
+
**Parameters:**
|
|
264
|
+
- `aggregation` (string): `detail`, `day`, `week`, or `month` (default: `detail`)
|
|
265
|
+
- `start_date` (string): Start date in ISO format (YYYY-MM-DD or YYYY-MM-DDTHH:MM:SS)
|
|
266
|
+
- `end_date` (string): End date in ISO format
|
|
267
|
+
- `fields` (array): Specific fields to return
|
|
268
|
+
- `filters` (object): Additional filters (e.g., `{"transaction_amount": ">100"}`)
|
|
269
|
+
- `sort_by` (string): Field to sort by (prefix with `-` for descending)
|
|
270
|
+
- `count` (integer): Maximum records to return (up to 10,000)
|
|
271
|
+
- `program` (string): Override default program name
|
|
272
|
+
|
|
273
|
+
**Example:**
|
|
274
|
+
```json
|
|
275
|
+
{
|
|
276
|
+
"aggregation": "day",
|
|
277
|
+
"start_date": "2024-01-01",
|
|
278
|
+
"end_date": "2024-01-31",
|
|
279
|
+
"filters": {"transaction_amount": ">1000"},
|
|
280
|
+
"sort_by": "-request_amount",
|
|
281
|
+
"count": 100
|
|
282
|
+
}
|
|
283
|
+
```
|
|
284
|
+
|
|
285
|
+
#### `get_settlements`
|
|
286
|
+
Get settlement transaction data including status, post dates, purchase amounts, and network information.
|
|
287
|
+
|
|
288
|
+
**Parameters:** Same as `get_authorizations`
|
|
289
|
+
|
|
290
|
+
#### `get_clearings`
|
|
291
|
+
Get accounting-level line items for transaction lifecycle. Ideal for reconciliation.
|
|
292
|
+
|
|
293
|
+
**Parameters:** Same as `get_authorizations`
|
|
294
|
+
|
|
295
|
+
#### `get_declines`
|
|
296
|
+
Get declined transaction data with tokens, decline reasons, merchant info, and amounts.
|
|
297
|
+
|
|
298
|
+
**Parameters:** Same as `get_authorizations`
|
|
299
|
+
|
|
300
|
+
#### `get_loads`
|
|
301
|
+
Get load transaction data including amounts and transaction details.
|
|
302
|
+
|
|
303
|
+
**Parameters:** Same as `get_authorizations`
|
|
304
|
+
|
|
305
|
+
### Financial Tools
|
|
306
|
+
|
|
307
|
+
#### `get_program_balances`
|
|
308
|
+
Get program-level balance data including beginning/ending bank balances and amounts to send/receive.
|
|
309
|
+
|
|
310
|
+
**Parameters:**
|
|
311
|
+
- `start_date`, `end_date`, `fields`, `filters`, `sort_by`, `count`, `program`
|
|
312
|
+
|
|
313
|
+
#### `get_program_balances_settlement`
|
|
314
|
+
Get settlement-based program balance data and fund transfers.
|
|
315
|
+
|
|
316
|
+
**Parameters:** Same as `get_program_balances`
|
|
317
|
+
|
|
318
|
+
#### `get_activity_balances`
|
|
319
|
+
Get cardholder-level balance data, expandable by network.
|
|
320
|
+
|
|
321
|
+
**Parameters:**
|
|
322
|
+
- All standard parameters plus:
|
|
323
|
+
- `expand` (string): Field to expand for more detail (e.g., network data)
|
|
324
|
+
|
|
325
|
+
### Card & User Tools
|
|
326
|
+
|
|
327
|
+
#### `get_cards`
|
|
328
|
+
Get card detail data including user tokens, card state, active status, and UAI.
|
|
329
|
+
|
|
330
|
+
**Parameters:**
|
|
331
|
+
- `fields`, `filters`, `sort_by`, `count`, `program`
|
|
332
|
+
|
|
333
|
+
**Example filters:**
|
|
334
|
+
```json
|
|
335
|
+
{
|
|
336
|
+
"filters": {
|
|
337
|
+
"state": "ACTIVE",
|
|
338
|
+
"user_token": "abc123"
|
|
339
|
+
}
|
|
340
|
+
}
|
|
341
|
+
```
|
|
342
|
+
|
|
343
|
+
#### `get_users`
|
|
344
|
+
Get user detail data including tokens, UAI, and number of physical/virtual cards.
|
|
345
|
+
|
|
346
|
+
**Parameters:** Same as `get_cards`
|
|
347
|
+
|
|
348
|
+
### Chargeback Tools
|
|
349
|
+
|
|
350
|
+
#### `get_chargebacks_status`
|
|
351
|
+
Get chargeback status data including state, tokens, and provisional credit status.
|
|
352
|
+
|
|
353
|
+
**Parameters:**
|
|
354
|
+
- `start_date`, `end_date`, `fields`, `filters`, `sort_by`, `count`, `program`
|
|
355
|
+
|
|
356
|
+
#### `get_chargebacks_detail`
|
|
357
|
+
Get detailed chargeback information with transaction dates and types.
|
|
358
|
+
|
|
359
|
+
**Parameters:** Same as `get_chargebacks_status`
|
|
360
|
+
|
|
361
|
+
### Metadata Tools
|
|
362
|
+
|
|
363
|
+
#### `list_available_views`
|
|
364
|
+
Get a list of all available DiVA API view endpoints with metadata.
|
|
365
|
+
|
|
366
|
+
**Parameters:** None
|
|
367
|
+
|
|
368
|
+
#### `get_view_schema`
|
|
369
|
+
Get the schema definition for any view endpoint with field names, types, and descriptions.
|
|
370
|
+
|
|
371
|
+
**Parameters:**
|
|
372
|
+
- `view_name` (string, required): Name of the view (e.g., `authorizations`, `settlements`, `cards`)
|
|
373
|
+
- `aggregation` (string): Aggregation level if applicable (default: `detail`)
|
|
374
|
+
|
|
375
|
+
## Query Filtering
|
|
376
|
+
|
|
377
|
+
The DiVA API supports powerful filtering operators:
|
|
378
|
+
|
|
379
|
+
| Operator | Description | Example |
|
|
380
|
+
|----------|-------------|---------|
|
|
381
|
+
| `~` | Like (wildcard) | `{"company": "Mar~eta"}` |
|
|
382
|
+
| `..` | Range | `{"date": "2023-10-01..2023-10-03"}` |
|
|
383
|
+
| `<`, `<=` | Less than | `{"amount": "<=100"}` |
|
|
384
|
+
| `>`, `>=` | Greater than | `{"date": ">=2023-04-01"}` |
|
|
385
|
+
| `=` | Equal/In list | `{"amount": "0"}` or `{"country": "United States,Mexico"}` |
|
|
386
|
+
| `=!` | Not equal/Not in | `{"amount": "=!0"}` |
|
|
387
|
+
|
|
388
|
+
**Example:**
|
|
389
|
+
```json
|
|
390
|
+
{
|
|
391
|
+
"filters": {
|
|
392
|
+
"transaction_amount": ">1000",
|
|
393
|
+
"post_date": "2023-02-01..2023-02-28",
|
|
394
|
+
"state": "COMPLETION"
|
|
395
|
+
}
|
|
396
|
+
}
|
|
397
|
+
```
|
|
398
|
+
|
|
399
|
+
## Rate Limits
|
|
400
|
+
|
|
401
|
+
- **Maximum:** 300 requests per 5-minute interval (≈1 per second)
|
|
402
|
+
- **Enforcement:** Built-in rate limiter automatically throttles requests
|
|
403
|
+
- **Error Code:** HTTP 429 if limit exceeded
|
|
404
|
+
|
|
405
|
+
## Data Synchronization
|
|
406
|
+
|
|
407
|
+
Report data is synchronized **3 times daily**. See Marqeta documentation for specific refresh timelines.
|
|
408
|
+
|
|
409
|
+
## Error Handling
|
|
410
|
+
|
|
411
|
+
The server handles all common DiVA API errors:
|
|
412
|
+
|
|
413
|
+
| Code | Description |
|
|
414
|
+
|------|-------------|
|
|
415
|
+
| 400 | Bad Request - Malformed query or filter |
|
|
416
|
+
| 403 | Forbidden - Unauthorized access to field, filter, or program |
|
|
417
|
+
| 404 | Not Found - Malformed URL or endpoint doesn't exist |
|
|
418
|
+
| 429 | Rate limit exceeded |
|
|
419
|
+
|
|
420
|
+
## Example Usage with Claude
|
|
421
|
+
|
|
422
|
+
Once configured in Claude Desktop, you can use natural language queries:
|
|
423
|
+
|
|
424
|
+
**Example queries:**
|
|
425
|
+
- "Get all authorization transactions from last week with amounts over $1000"
|
|
426
|
+
- "Show me the settlement data for January 2024"
|
|
427
|
+
- "List all active cards for user token abc123"
|
|
428
|
+
- "What are the available views in the DiVA API?"
|
|
429
|
+
- "Get the schema for the settlements view"
|
|
430
|
+
- "Show me chargeback status for the last 30 days"
|
|
431
|
+
- "Get program balances for February 2024"
|
|
432
|
+
|
|
433
|
+
## API Documentation
|
|
434
|
+
|
|
435
|
+
For complete DiVA API documentation, visit:
|
|
436
|
+
https://www.marqeta.com/docs/diva-api/introduction/
|
|
437
|
+
|
|
438
|
+
## Troubleshooting
|
|
439
|
+
|
|
440
|
+
### Missing Credentials Error
|
|
441
|
+
```
|
|
442
|
+
Error: Missing required environment variables: MARQETA_APP_TOKEN, MARQETA_ACCESS_TOKEN, MARQETA_PROGRAM
|
|
443
|
+
```
|
|
444
|
+
**Solution:** Ensure your `.env` file exists and contains all three required variables.
|
|
445
|
+
|
|
446
|
+
### Authentication Error (403)
|
|
447
|
+
```
|
|
448
|
+
Error 403: Forbidden - Unauthorized access
|
|
449
|
+
```
|
|
450
|
+
**Solution:** Verify your Application Token and Access Token are correct. Check that you have access to the specified program.
|
|
451
|
+
|
|
452
|
+
### Rate Limit Error (429)
|
|
453
|
+
```
|
|
454
|
+
Error 429: Rate limit exceeded - Maximum 300 requests per 5 minutes
|
|
455
|
+
```
|
|
456
|
+
**Solution:** The built-in rate limiter should prevent this, but if you see it, wait a few minutes before making more requests.
|
|
457
|
+
|
|
458
|
+
## Development
|
|
459
|
+
|
|
460
|
+
### Running Tests
|
|
461
|
+
|
|
462
|
+
```bash
|
|
463
|
+
pytest
|
|
464
|
+
```
|
|
465
|
+
|
|
466
|
+
### Code Formatting
|
|
467
|
+
|
|
468
|
+
```bash
|
|
469
|
+
black src/
|
|
470
|
+
ruff check src/
|
|
471
|
+
```
|
|
472
|
+
|
|
473
|
+
## Contributing
|
|
474
|
+
|
|
475
|
+
Contributions are welcome! Please feel free to submit a Pull Request. For major changes, please open an issue first to discuss what you would like to change.
|
|
476
|
+
|
|
477
|
+
### Development Setup
|
|
478
|
+
|
|
479
|
+
```bash
|
|
480
|
+
# Clone the repository
|
|
481
|
+
git clone https://github.com/zvika-finally/marqeta-diva-mcp.git
|
|
482
|
+
cd marqeta-diva-mcp
|
|
483
|
+
|
|
484
|
+
# Install with development dependencies
|
|
485
|
+
pip install -e ".[dev,rag]"
|
|
486
|
+
|
|
487
|
+
# Run tests
|
|
488
|
+
python test_fixes_unit.py
|
|
489
|
+
|
|
490
|
+
# Format code
|
|
491
|
+
black src/
|
|
492
|
+
ruff check src/
|
|
493
|
+
```
|
|
494
|
+
|
|
495
|
+
## License
|
|
496
|
+
|
|
497
|
+
This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.
|
|
498
|
+
|
|
499
|
+
## Author
|
|
500
|
+
|
|
501
|
+
**Zvika Badalov** - [zvika.badalov@finally.com](mailto:zvika.badalov@finally.com)
|
|
502
|
+
|
|
503
|
+
## Acknowledgments
|
|
504
|
+
|
|
505
|
+
- Built with [Model Context Protocol (MCP)](https://modelcontextprotocol.io/)
|
|
506
|
+
- Powered by [Marqeta's DiVA API](https://www.marqeta.com/docs/diva-api/)
|
|
507
|
+
|
|
508
|
+
## Support
|
|
509
|
+
|
|
510
|
+
- **Issues:** [GitHub Issues](https://github.com/zvika-finally/marqeta-diva-mcp/issues)
|
|
511
|
+
- **Marqeta API Questions:** Contact your Marqeta representative or refer to the [official Marqeta documentation](https://www.marqeta.com/docs/diva-api/introduction/)
|
|
512
|
+
|
|
513
|
+
## Disclaimer
|
|
514
|
+
|
|
515
|
+
This is an unofficial community project and is not officially endorsed or supported by Marqeta, Inc. Use at your own risk.
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
marqeta_diva_mcp/__init__.py,sha256=CcNeajXZ20SqiZY_XJHvPoN7GEJKmo7Vo4HYZexgHBA,58
|
|
2
|
+
marqeta_diva_mcp/__main__.py,sha256=kXVU3ep8u6O2QBRWo2QR03DGQisp3MzS5CTqNnBdQh0,125
|
|
3
|
+
marqeta_diva_mcp/client.py,sha256=_1z-si-zvQg4F6o7cfc6wI2kpjK7s0wQuwA5s38yzAA,16957
|
|
4
|
+
marqeta_diva_mcp/embeddings.py,sha256=6BTSdsmhowH5vF5MHe7jDz2l-__RvjlE02H1zgRmx5I,4357
|
|
5
|
+
marqeta_diva_mcp/local_storage.py,sha256=-tHRXa7WcNsTvVlZ1QCqtkULVBSHEmbPi6NVqu9ME2E,11414
|
|
6
|
+
marqeta_diva_mcp/rag_tools.py,sha256=DYMOGzwhXIIgAuhm78ZNuyxrO2IZ5JzHi5L0QIWAl_w,11944
|
|
7
|
+
marqeta_diva_mcp/server.py,sha256=L2zpH7qEeWvhGPiRsV1Sp_NK1jiEPCxY8y-dHVaP4zU,40249
|
|
8
|
+
marqeta_diva_mcp/vector_store.py,sha256=LWbjY_i10W-PI92ApE5zCvdQBOrBBYXDdStYawbk5zE,9753
|
|
9
|
+
marqeta_diva_mcp-0.2.0.dist-info/METADATA,sha256=5_FkB8tZqwUsqQUdyJO3-CU9vhXvgC7jFGugZjZ9c_w,15285
|
|
10
|
+
marqeta_diva_mcp-0.2.0.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
|
|
11
|
+
marqeta_diva_mcp-0.2.0.dist-info/entry_points.txt,sha256=McJosMo_ymnQhLuOpJ3l62qM7z9U_ssW3Ugn-Y8HZJ4,66
|
|
12
|
+
marqeta_diva_mcp-0.2.0.dist-info/licenses/LICENSE,sha256=bxGQUnY1nbevspSFL72pJrNvPwdFFExKHEKnQ665kfs,1070
|
|
13
|
+
marqeta_diva_mcp-0.2.0.dist-info/RECORD,,
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2025 Zvika Badalov
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|