@gpsglobal-ai/gpsglobal 1.4.1

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.
@@ -0,0 +1,108 @@
1
+ import { z } from 'zod';
2
+ import { assertMcpEligibleRole } from '../config/env.js';
3
+ const listFundsSchema = {
4
+ include_closed: z.boolean().optional().describe('If false (default), omit funds whose closing_date is in the past.'),
5
+ };
6
+ const getFundWikiSchema = {
7
+ fund_id: z.string().describe('Fund identifier from list_funds (e.g. fund_1776212451730_0).'),
8
+ format: z.enum(['markdown', 'summary']).optional().describe('markdown = full wiki; summary = YAML header + section titles only.'),
9
+ };
10
+ function isClosed(closingDate) {
11
+ if (!closingDate)
12
+ return false;
13
+ const d = new Date(closingDate);
14
+ if (Number.isNaN(d.getTime()))
15
+ return false;
16
+ const today = new Date();
17
+ today.setHours(0, 0, 0, 0);
18
+ return d < today;
19
+ }
20
+ function mapFund(f) {
21
+ const meta = f.metadata ?? {};
22
+ return {
23
+ fund_id: f.fundId,
24
+ fund_name: meta.fund_name ?? f.fundId,
25
+ fund_subtitle: meta.fund_subtitle ?? '',
26
+ closing_date: meta.closing_date ?? '',
27
+ has_extraction: f.hasExtraction ?? false,
28
+ has_wiki: f.hasWiki ?? false,
29
+ strategy: f.strategy ?? '',
30
+ geography: f.geography ?? '',
31
+ sector: f.sector ?? '',
32
+ fund_summary: f.fundSummary ?? '',
33
+ };
34
+ }
35
+ function wikiSummary(content) {
36
+ const lines = content.split('\n');
37
+ const header = [];
38
+ let inYaml = false;
39
+ for (const line of lines) {
40
+ if (line.trim() === '---') {
41
+ inYaml = !inYaml;
42
+ header.push(line);
43
+ if (!inYaml && header.length > 1)
44
+ break;
45
+ continue;
46
+ }
47
+ if (inYaml)
48
+ header.push(line);
49
+ }
50
+ const titles = lines.filter((l) => l.startsWith('#')).slice(0, 20);
51
+ return [...header, '', ...titles].join('\n').trim();
52
+ }
53
+ function extractSchemaVersion(content) {
54
+ const m = content.match(/schema_version:\s*["']?([^"'\n]+)/);
55
+ return m?.[1]?.trim();
56
+ }
57
+ export function registerGpsTools(server, client) {
58
+ server.registerTool('list_funds', {
59
+ description: 'List all funds in the authenticated LP vault with metadata and has_wiki flags.',
60
+ inputSchema: listFundsSchema,
61
+ }, async ({ include_closed }) => {
62
+ assertMcpEligibleRole(client.config.role);
63
+ const funds = await client.listFunds();
64
+ const filtered = include_closed ? funds : funds.filter((f) => !isClosed(f.metadata?.closing_date));
65
+ const mapped = filtered.map(mapFund);
66
+ const text = `Found ${mapped.length} fund(s) in vault for ${client.config.lpId}.\nUse get_fund_wiki(fund_id) to retrieve full wiki markdown.`;
67
+ return {
68
+ content: [{ type: 'text', text }],
69
+ structuredContent: {
70
+ lp_id: client.config.lpId,
71
+ count: mapped.length,
72
+ funds: mapped,
73
+ },
74
+ };
75
+ });
76
+ server.registerTool('get_fund_wiki', {
77
+ description: 'Retrieve NMG wiki markdown for one fund in the authenticated LP vault.',
78
+ inputSchema: getFundWikiSchema,
79
+ }, async ({ fund_id, format }) => {
80
+ assertMcpEligibleRole(client.config.role);
81
+ const wiki = await client.getWikiContent(client.config.lpId, fund_id);
82
+ if (!wiki.has_wiki) {
83
+ const msg = `Fund ${fund_id} has no wiki yet (status: ${wiki.wiki_status}).`;
84
+ return {
85
+ content: [{ type: 'text', text: msg }],
86
+ structuredContent: {
87
+ fund_id: wiki.fund_id,
88
+ fund_name: wiki.fund_name,
89
+ has_wiki: false,
90
+ wiki_status: wiki.wiki_status,
91
+ },
92
+ isError: true,
93
+ };
94
+ }
95
+ const body = format === 'summary' ? wikiSummary(wiki.content) : wiki.content;
96
+ return {
97
+ content: [{ type: 'text', text: body }],
98
+ structuredContent: {
99
+ fund_id: wiki.fund_id,
100
+ fund_name: wiki.fund_name,
101
+ has_wiki: true,
102
+ wiki_status: wiki.wiki_status,
103
+ schema_version: extractSchemaVersion(wiki.content),
104
+ byte_length: wiki.content.length,
105
+ },
106
+ };
107
+ });
108
+ }
package/package.json ADDED
@@ -0,0 +1,57 @@
1
+ {
2
+ "name": "@gpsglobal-ai/gpsglobal",
3
+ "version": "1.4.1",
4
+ "description": "GPS LP fund wiki MCP server — list_funds and get_fund_wiki for Cursor, Copilot, Claude",
5
+ "type": "module",
6
+ "main": "./dist/index.js",
7
+ "bin": {
8
+ "gpsglobal": "./dist/cli.js"
9
+ },
10
+ "repository": {
11
+ "type": "git",
12
+ "url": "git+https://github.com/Gateway-Private-Solutions/gps-front.git",
13
+ "directory": "mcp-server"
14
+ },
15
+ "publishConfig": {
16
+ "access": "public"
17
+ },
18
+ "files": [
19
+ "dist",
20
+ "templates",
21
+ "README.md",
22
+ "CHANGELOG.md"
23
+ ],
24
+ "scripts": {
25
+ "build": "tsc",
26
+ "dev": "tsc --watch",
27
+ "start": "node dist/index.js",
28
+ "test": "vitest run",
29
+ "prepublishOnly": "npm run build"
30
+ },
31
+ "engines": {
32
+ "node": ">=18"
33
+ },
34
+ "dependencies": {
35
+ "@modelcontextprotocol/sdk": "^1.29.0",
36
+ "axios": "^1.8.4",
37
+ "zod": "^3.24.2"
38
+ },
39
+ "devDependencies": {
40
+ "@types/express": "^5.0.0",
41
+ "@types/node": "^22.13.10",
42
+ "typescript": "^5.8.2",
43
+ "vitest": "^3.0.9"
44
+ },
45
+ "keywords": [
46
+ "mcp",
47
+ "gps",
48
+ "gpsglobal",
49
+ "fund",
50
+ "wiki",
51
+ "cursor",
52
+ "copilot",
53
+ "claude"
54
+ ],
55
+ "license": "UNLICENSED",
56
+ "private": false
57
+ }
@@ -0,0 +1,9 @@
1
+ {
2
+ "mcpServers": {
3
+ "gpsglobal": {
4
+ "command": "npx",
5
+ "args": ["-y", "@gpsglobal-ai/gpsglobal", "--stdio"],
6
+ "envFile": "${userHome}/.gps/mcp.env"
7
+ }
8
+ }
9
+ }
@@ -0,0 +1,7 @@
1
+ {
2
+ "mcpServers": {
3
+ "gpsglobal": {
4
+ "url": "https://lp.gpsglobal.ai/mcp"
5
+ }
6
+ }
7
+ }
@@ -0,0 +1,9 @@
1
+ {
2
+ "mcpServers": {
3
+ "gpsglobal": {
4
+ "command": "npx",
5
+ "args": ["-y", "@gpsglobal-ai/gpsglobal", "--stdio"],
6
+ "envFile": "${userHome}/.gps/mcp.env"
7
+ }
8
+ }
9
+ }
@@ -0,0 +1,8 @@
1
+ {
2
+ "servers": {
3
+ "gpsglobal": {
4
+ "type": "http",
5
+ "url": "https://lp.gpsglobal.ai/mcp"
6
+ }
7
+ }
8
+ }
@@ -0,0 +1,10 @@
1
+ {
2
+ "servers": {
3
+ "gpsglobal": {
4
+ "type": "stdio",
5
+ "command": "npx",
6
+ "args": ["-y", "@gpsglobal-ai/gpsglobal", "--stdio"],
7
+ "envFile": "${userHome}/.gps/mcp.env"
8
+ }
9
+ }
10
+ }
@@ -0,0 +1,8 @@
1
+ {
2
+ "servers": {
3
+ "gpsglobal": {
4
+ "type": "http",
5
+ "url": "https://lp.gpsglobal.ai/mcp"
6
+ }
7
+ }
8
+ }
@@ -0,0 +1,10 @@
1
+ {
2
+ "servers": {
3
+ "gpsglobal": {
4
+ "type": "stdio",
5
+ "command": "npx",
6
+ "args": ["-y", "@gpsglobal-ai/gpsglobal", "--stdio"],
7
+ "envFile": "${userHome}/.gps/mcp.env"
8
+ }
9
+ }
10
+ }