@openfinance-sh/mcp 0.1.2 → 0.1.4
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/build/index.js +7 -2
- package/manifest.json +1 -1
- package/openfinance.mcpb +0 -0
- package/package.json +1 -1
package/build/index.js
CHANGED
|
@@ -5,6 +5,9 @@ import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
|
|
|
5
5
|
import { StdioServerTransport } from "@modelcontextprotocol/sdk/server/stdio.js";
|
|
6
6
|
import { StreamableHTTPServerTransport } from "@modelcontextprotocol/sdk/server/streamableHttp.js";
|
|
7
7
|
import { createServer } from "http";
|
|
8
|
+
import { readFileSync } from "fs";
|
|
9
|
+
import { dirname, join } from "path";
|
|
10
|
+
import { fileURLToPath } from "url";
|
|
8
11
|
|
|
9
12
|
// src/client.ts
|
|
10
13
|
var OpenFinanceClient = class {
|
|
@@ -184,6 +187,8 @@ Example queries:
|
|
|
184
187
|
}
|
|
185
188
|
|
|
186
189
|
// src/index.ts
|
|
190
|
+
var __dirname = dirname(fileURLToPath(import.meta.url));
|
|
191
|
+
var pkg = JSON.parse(readFileSync(join(__dirname, "..", "package.json"), "utf-8"));
|
|
187
192
|
function parseArgs() {
|
|
188
193
|
const args = process.argv.slice(2);
|
|
189
194
|
let transport = "stdio";
|
|
@@ -201,7 +206,7 @@ function parseArgs() {
|
|
|
201
206
|
}
|
|
202
207
|
async function main() {
|
|
203
208
|
const apiKey = process.env.OPENFINANCE_API_KEY;
|
|
204
|
-
const baseUrl = process.env.OPENFINANCE_URL || "
|
|
209
|
+
const baseUrl = process.env.OPENFINANCE_URL || "https://api.openfinance.sh";
|
|
205
210
|
if (!apiKey) {
|
|
206
211
|
console.error(
|
|
207
212
|
"Error: OPENFINANCE_API_KEY environment variable is required"
|
|
@@ -212,7 +217,7 @@ async function main() {
|
|
|
212
217
|
const client = new OpenFinanceClient({ baseUrl, apiKey });
|
|
213
218
|
const server = new McpServer({
|
|
214
219
|
name: "openfinance",
|
|
215
|
-
version:
|
|
220
|
+
version: pkg.version
|
|
216
221
|
});
|
|
217
222
|
registerAccountTools(server, client);
|
|
218
223
|
registerTransactionTools(server, client);
|
package/manifest.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"manifest_version": "0.3",
|
|
3
3
|
"name": "openfinance",
|
|
4
4
|
"display_name": "OpenFinance",
|
|
5
|
-
"version": "0.1.
|
|
5
|
+
"version": "0.1.4",
|
|
6
6
|
"description": "Connect your financial accounts to view balances, search transactions, and get spending insights.",
|
|
7
7
|
"author": {
|
|
8
8
|
"name": "OpenFinance"
|
package/openfinance.mcpb
CHANGED
|
Binary file
|