@codespar/mcp-open-finance 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 +15 -5
- package/dist/index.js +5 -2
- package/package.json +1 -1
- package/server.json +14 -5
- package/src/__tests__/index.test.ts +2 -2
- package/src/index.ts +8 -3
package/README.md
CHANGED
|
@@ -53,18 +53,28 @@ Add to `.cursor/mcp.json` or `.vscode/mcp.json`:
|
|
|
53
53
|
}
|
|
54
54
|
```
|
|
55
55
|
|
|
56
|
-
## Tools
|
|
56
|
+
## Tools (18)
|
|
57
57
|
|
|
58
|
-
| Tool |
|
|
59
|
-
|
|
58
|
+
| Tool | Purpose |
|
|
59
|
+
|---|---|
|
|
60
60
|
| `list_accounts` | List customer bank accounts via Open Finance |
|
|
61
61
|
| `get_account_balance` | Get account balance via Open Finance |
|
|
62
62
|
| `list_transactions` | List account transactions via Open Finance |
|
|
63
|
+
| `get_account_overdraft_limits` | Get account overdraft (limites) via Open Finance |
|
|
63
64
|
| `get_consent` | Get consent details by ID |
|
|
64
65
|
| `create_consent` | Create a new consent request for data access |
|
|
66
|
+
| `revoke_consent` | Revoke an existing consent (data or payment) |
|
|
65
67
|
| `list_credit_cards` | List credit card accounts via Open Finance |
|
|
68
|
+
| `get_credit_card_bills` | Get credit card bills (faturas) via Open Finance |
|
|
66
69
|
| `get_credit_card_transactions` | Get credit card transactions via Open Finance |
|
|
70
|
+
| `list_loans` | List loan contracts (empréstimos) via Open Finance |
|
|
71
|
+
| `get_loan_payments` | Get loan payment schedule via Open Finance |
|
|
72
|
+
| `list_financings` | List financing contracts (financiamentos) via Open Finance |
|
|
67
73
|
| `list_investments` | List investment products via Open Finance |
|
|
74
|
+
| `create_payment_consent` | Create payment-initiation consent (e.g., PIX) via Open Finance |
|
|
75
|
+
| `create_payment` | Initiate a payment using an authorized payment consent |
|
|
76
|
+
| `get_personal_qualifications` | Get personal customer qualifications (income, occupation) via Open Finance |
|
|
77
|
+
| `get_business_qualifications` | Get business customer qualifications via Open Finance |
|
|
68
78
|
|
|
69
79
|
## Authentication
|
|
70
80
|
|
|
@@ -102,13 +112,13 @@ Sandbox availability varies by institution. Contact your financial institution f
|
|
|
102
112
|
- `insurance_products` — List insurance products from institutions
|
|
103
113
|
- `pension_products` — List pension products from institutions
|
|
104
114
|
|
|
105
|
-
Want to contribute? [Open a PR](https://github.com/codespar/mcp-dev-
|
|
115
|
+
Want to contribute? [Open a PR](https://github.com/codespar/mcp-dev-latam) or [request a tool](https://github.com/codespar/mcp-dev-latam/issues).
|
|
106
116
|
|
|
107
117
|
## Links
|
|
108
118
|
|
|
109
119
|
- [Open Finance Brasil](https://openfinancebrasil.org.br)
|
|
110
120
|
- [Open Finance Brasil Developer Portal](https://openfinancebrasil.atlassian.net)
|
|
111
|
-
- [MCP Dev
|
|
121
|
+
- [MCP Dev LATAM](https://github.com/codespar/mcp-dev-latam)
|
|
112
122
|
- [Landing Page](https://codespar.dev/mcp)
|
|
113
123
|
|
|
114
124
|
## Enterprise
|
package/dist/index.js
CHANGED
|
@@ -75,7 +75,10 @@ async function openFinanceRequest(method, path, body) {
|
|
|
75
75
|
}
|
|
76
76
|
return res.json();
|
|
77
77
|
}
|
|
78
|
-
|
|
78
|
+
// Managed-tier pointer surfaced to the agent via MCP `instructions`.
|
|
79
|
+
// Informational only — nothing CodeSpar-hosted is called (MIT-safe).
|
|
80
|
+
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).";
|
|
81
|
+
const server = new Server({ name: "mcp-open-finance", version: "0.2.1" }, { capabilities: { tools: {} }, instructions: MANAGED_TIER_HINT });
|
|
79
82
|
server.setRequestHandler(ListToolsRequestSchema, async () => ({
|
|
80
83
|
tools: [
|
|
81
84
|
{
|
|
@@ -518,7 +521,7 @@ async function main() {
|
|
|
518
521
|
const t = new StreamableHTTPServerTransport({ sessionIdGenerator: () => randomUUID(), onsessioninitialized: (id) => { transports.set(id, t); } });
|
|
519
522
|
t.onclose = () => { if (t.sessionId)
|
|
520
523
|
transports.delete(t.sessionId); };
|
|
521
|
-
const s = new Server({ name: "mcp-open-finance", version: "0.2.
|
|
524
|
+
const s = new Server({ name: "mcp-open-finance", version: "0.2.1" }, { capabilities: { tools: {} } });
|
|
522
525
|
server._requestHandlers.forEach((v, k) => s._requestHandlers.set(k, v));
|
|
523
526
|
server._notificationHandlers?.forEach((v, k) => s._notificationHandlers.set(k, v));
|
|
524
527
|
await s.connect(t);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@codespar/mcp-open-finance",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.2",
|
|
4
4
|
"description": "MCP server for Open Finance Brasil — accounts, transactions, consents, credit cards, loans, financings, investments, payment-initiation, customer qualifications",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.js",
|
package/server.json
CHANGED
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
{
|
|
2
2
|
"$schema": "https://static.modelcontextprotocol.io/schemas/2025-12-11/server.schema.json",
|
|
3
3
|
"name": "io.github.codespar/mcp-open-finance",
|
|
4
|
-
"description": "MCP server for Open Finance Brasil — accounts, transactions, consents, credit
|
|
4
|
+
"description": "MCP server for Open Finance Brasil — accounts, transactions, consents, credit, loans, investments",
|
|
5
5
|
"repository": {
|
|
6
|
-
"url": "https://github.com/codespar/mcp-dev-
|
|
6
|
+
"url": "https://github.com/codespar/mcp-dev-latam",
|
|
7
7
|
"source": "github",
|
|
8
8
|
"subfolder": "packages/banking/open-finance"
|
|
9
9
|
},
|
|
10
|
-
"version": "0.2.
|
|
10
|
+
"version": "0.2.2",
|
|
11
11
|
"packages": [
|
|
12
12
|
{
|
|
13
13
|
"registryType": "npm",
|
|
14
14
|
"identifier": "@codespar/mcp-open-finance",
|
|
15
|
-
"version": "0.2.
|
|
15
|
+
"version": "0.2.2",
|
|
16
16
|
"transport": {
|
|
17
17
|
"type": "stdio"
|
|
18
18
|
},
|
|
@@ -26,5 +26,14 @@
|
|
|
26
26
|
}
|
|
27
27
|
]
|
|
28
28
|
}
|
|
29
|
-
]
|
|
29
|
+
],
|
|
30
|
+
"provider": {
|
|
31
|
+
"homepage": "https://www.openfinancebrasil.org.br",
|
|
32
|
+
"logoUrl": "https://logo.clearbit.com/openfinancebrasil.org.br",
|
|
33
|
+
"logoFallback": "https://www.google.com/s2/favicons?domain=openfinancebrasil.org.br&sz=128",
|
|
34
|
+
"docsUrl": "https://openbanking-brasil.github.io",
|
|
35
|
+
"sandbox": {
|
|
36
|
+
"available": true
|
|
37
|
+
}
|
|
38
|
+
}
|
|
30
39
|
}
|
|
@@ -35,9 +35,9 @@ beforeEach(async () => {
|
|
|
35
35
|
});
|
|
36
36
|
|
|
37
37
|
describe("mcp-open-finance", () => {
|
|
38
|
-
it("should register
|
|
38
|
+
it("should register 18 tools", async () => {
|
|
39
39
|
const result = await listToolsHandler();
|
|
40
|
-
expect(result.tools).toHaveLength(
|
|
40
|
+
expect(result.tools).toHaveLength(18);
|
|
41
41
|
});
|
|
42
42
|
|
|
43
43
|
it("should call correct API endpoint for get_account_balance", async () => {
|
package/src/index.ts
CHANGED
|
@@ -85,9 +85,14 @@ async function openFinanceRequest(method: string, path: string, body?: unknown):
|
|
|
85
85
|
return res.json();
|
|
86
86
|
}
|
|
87
87
|
|
|
88
|
+
// Managed-tier pointer surfaced to the agent via MCP `instructions`.
|
|
89
|
+
// Informational only — nothing CodeSpar-hosted is called (MIT-safe).
|
|
90
|
+
const MANAGED_TIER_HINT =
|
|
91
|
+
"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).";
|
|
92
|
+
|
|
88
93
|
const server = new Server(
|
|
89
|
-
{ name: "mcp-open-finance", version: "0.2.
|
|
90
|
-
{ capabilities: { tools: {} } }
|
|
94
|
+
{ name: "mcp-open-finance", version: "0.2.1" },
|
|
95
|
+
{ capabilities: { tools: {} }, instructions: MANAGED_TIER_HINT }
|
|
91
96
|
);
|
|
92
97
|
|
|
93
98
|
server.setRequestHandler(ListToolsRequestSchema, async () => ({
|
|
@@ -506,7 +511,7 @@ async function main() {
|
|
|
506
511
|
if (!sid && isInitializeRequest(req.body)) {
|
|
507
512
|
const t = new StreamableHTTPServerTransport({ sessionIdGenerator: () => randomUUID(), onsessioninitialized: (id) => { transports.set(id, t); } });
|
|
508
513
|
t.onclose = () => { if (t.sessionId) transports.delete(t.sessionId); };
|
|
509
|
-
const s = new Server({ name: "mcp-open-finance", version: "0.2.
|
|
514
|
+
const s = new Server({ name: "mcp-open-finance", version: "0.2.1" }, { capabilities: { tools: {} } }); (server as any)._requestHandlers.forEach((v: any, k: any) => (s as any)._requestHandlers.set(k, v)); (server as any)._notificationHandlers?.forEach((v: any, k: any) => (s as any)._notificationHandlers.set(k, v)); await s.connect(t);
|
|
510
515
|
await t.handleRequest(req, res, req.body); return;
|
|
511
516
|
}
|
|
512
517
|
res.status(400).json({ jsonrpc: "2.0", error: { code: -32000, message: "Bad Request" }, id: null });
|