gia-mcp-server 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/CHANGELOG.md +12 -0
- package/LICENSE +3 -3
- package/README.md +18 -1
- package/dist/proxy.d.ts +2 -2
- package/dist/proxy.js +73 -40
- package/package.json +3 -2
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,18 @@
|
|
|
2
2
|
|
|
3
3
|
All notable changes to GIA MCP Server will be documented in this file.
|
|
4
4
|
|
|
5
|
+
## [0.2.2] - 2026-02-26
|
|
6
|
+
|
|
7
|
+
### Fixed
|
|
8
|
+
- Proxy no longer crashes when upstream GIA server is unreachable
|
|
9
|
+
- Server stays alive in disconnected mode — returns clear errors on tool calls
|
|
10
|
+
- Local ping responses keep health checks passing (Glama, monitoring)
|
|
11
|
+
- Lazy reconnect: automatically retries upstream on next tool call
|
|
12
|
+
|
|
13
|
+
### Changed
|
|
14
|
+
- Stdio transport starts before upstream connection (resilient startup order)
|
|
15
|
+
- Upstream connection failure is now WARNING, not FATAL
|
|
16
|
+
|
|
5
17
|
## [0.2.0] - 2026-02-25
|
|
6
18
|
|
|
7
19
|
### Changed
|
package/LICENSE
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
GIA MCP Server — Proprietary Software License
|
|
2
2
|
|
|
3
|
-
Copyright (c) 2025-2026 William J. Storey III / ACE
|
|
3
|
+
Copyright (c) 2025-2026 William J. Storey III / Advanced Consulting Experts (ACE)
|
|
4
4
|
All Rights Reserved.
|
|
5
5
|
|
|
6
6
|
NOTICE: This software and all associated documentation, algorithms,
|
|
7
7
|
frameworks, and intellectual property (collectively, "the Software")
|
|
8
|
-
are the proprietary property of William J. Storey III / ACE
|
|
8
|
+
are the proprietary property of William J. Storey III / Advanced Consulting Experts (ACE).
|
|
9
9
|
|
|
10
10
|
GRANT OF USE:
|
|
11
11
|
You may install and use the Software in its compiled/distributed form
|
|
@@ -50,5 +50,5 @@ For licensing inquiries, partnership opportunities, or enterprise
|
|
|
50
50
|
agreements, contact:
|
|
51
51
|
|
|
52
52
|
William J. Storey III
|
|
53
|
-
ACE
|
|
53
|
+
Advanced Consulting Experts (ACE)
|
|
54
54
|
https://gia.aceadvising.com
|
package/README.md
CHANGED
|
@@ -1,11 +1,28 @@
|
|
|
1
1
|
# GIA MCP Server
|
|
2
2
|
|
|
3
|
+
[](https://www.npmjs.com/package/gia-mcp-server)
|
|
4
|
+
[](LICENSE)
|
|
5
|
+
[](https://nodejs.org)
|
|
6
|
+
[](https://modelcontextprotocol.io)
|
|
7
|
+
|
|
3
8
|
**Governance Intelligence Architecture** — the governance layer for Claude AI agents.
|
|
4
9
|
|
|
5
10
|
This package connects [Claude Desktop](https://claude.ai/download) and [Claude Code](https://docs.anthropic.com/en/docs/claude-code) to the hosted GIA governance engine, giving your AI workflows enterprise-grade governance: decision classification, forensic audit trails, human-in-the-loop gates, compliance mapping, and more.
|
|
6
11
|
|
|
7
12
|
Built on Anthropic's [Model Context Protocol](https://modelcontextprotocol.io).
|
|
8
13
|
|
|
14
|
+
## Why GIA?
|
|
15
|
+
|
|
16
|
+
AI agents are powerful — but **ungoverned AI agents are a liability**. GIA solves this by providing:
|
|
17
|
+
|
|
18
|
+
- **Decision Classification** — Every AI decision is classified as Mandatory (human required), Advisory (human optional), or Informational (agent autonomous)
|
|
19
|
+
- **Forensic Audit Trail** — Hash-chained, tamper-evident ledger of every operation, decision, and gate approval
|
|
20
|
+
- **Human-in-the-Loop Gates** — High-impact actions require explicit human approval before execution
|
|
21
|
+
- **Compliance Mapping** — Map governance controls to NIST AI RMF, EU AI Act, ISO 42001, and NIST 800-53
|
|
22
|
+
- **Governed Memory** — Hash-sealed knowledge packs with trust levels, TTL, and role-based access
|
|
23
|
+
|
|
24
|
+
GIA is the governance layer that makes Claude deployments enterprise-ready.
|
|
25
|
+
|
|
9
26
|
## Quick Start
|
|
10
27
|
|
|
11
28
|
### 1. Get an API Key
|
|
@@ -122,4 +139,4 @@ This package is a lightweight proxy. All governance logic runs on the hosted GIA
|
|
|
122
139
|
|
|
123
140
|
Proprietary. See [LICENSE](LICENSE) for details.
|
|
124
141
|
|
|
125
|
-
Copyright (c) 2025-2026 William J. Storey III / ACE
|
|
142
|
+
Copyright (c) 2025-2026 William J. Storey III / Advanced Consulting Experts (ACE)
|
package/dist/proxy.d.ts
CHANGED
package/dist/proxy.js
CHANGED
|
@@ -11,15 +11,15 @@
|
|
|
11
11
|
* Architecture:
|
|
12
12
|
* Claude <--stdio--> this proxy <--HTTPS--> gia.aceadvising.com/mcp
|
|
13
13
|
*
|
|
14
|
-
* @author ACE
|
|
15
|
-
* @version 0.2.
|
|
14
|
+
* @author Advanced Consulting Experts (ACE)
|
|
15
|
+
* @version 0.2.1
|
|
16
16
|
*/
|
|
17
17
|
import { Server } from '@modelcontextprotocol/sdk/server/index.js';
|
|
18
18
|
import { StdioServerTransport } from '@modelcontextprotocol/sdk/server/stdio.js';
|
|
19
19
|
import { Client } from '@modelcontextprotocol/sdk/client/index.js';
|
|
20
20
|
import { StreamableHTTPClientTransport } from '@modelcontextprotocol/sdk/client/streamableHttp.js';
|
|
21
21
|
import { ListToolsResultSchema, CallToolResultSchema, ListResourcesResultSchema, ReadResourceResultSchema, ListResourceTemplatesResultSchema, ListPromptsResultSchema, GetPromptResultSchema, CompleteResultSchema, EmptyResultSchema, } from '@modelcontextprotocol/sdk/types.js';
|
|
22
|
-
const VERSION = '0.2.
|
|
22
|
+
const VERSION = '0.2.2';
|
|
23
23
|
const DEFAULT_SERVER_URL = 'https://gia.aceadvising.com/mcp';
|
|
24
24
|
// Result schema map — tells the SDK how to validate upstream responses
|
|
25
25
|
const RESULT_SCHEMAS = {
|
|
@@ -37,46 +37,55 @@ const RESULT_SCHEMAS = {
|
|
|
37
37
|
function log(msg) {
|
|
38
38
|
process.stderr.write(`[GIA] ${msg}\n`);
|
|
39
39
|
}
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
if (!apiKey) {
|
|
45
|
-
log('ERROR: GIA_API_KEY environment variable is required.');
|
|
46
|
-
log('');
|
|
47
|
-
log('Get your API key at https://gia.aceadvising.com');
|
|
48
|
-
log('Then set it:');
|
|
49
|
-
log(' export GIA_API_KEY=gia_your_key_here');
|
|
50
|
-
log('');
|
|
51
|
-
log('Or configure it in your Claude Desktop / Claude Code settings.');
|
|
52
|
-
process.exit(1);
|
|
53
|
-
}
|
|
54
|
-
// ── Connect to upstream GIA server ──
|
|
40
|
+
// Upstream connection state
|
|
41
|
+
let upstream = null;
|
|
42
|
+
let upstreamConnected = false;
|
|
43
|
+
async function connectUpstream(apiKey, serverUrl) {
|
|
55
44
|
log(`Connecting to ${serverUrl}...`);
|
|
56
|
-
const
|
|
45
|
+
const transport = new StreamableHTTPClientTransport(new URL(serverUrl), {
|
|
57
46
|
requestInit: {
|
|
58
47
|
headers: {
|
|
59
48
|
'Authorization': `Bearer ${apiKey}`,
|
|
60
49
|
},
|
|
61
50
|
},
|
|
62
51
|
});
|
|
63
|
-
|
|
52
|
+
upstream = new Client({ name: 'gia-mcp-proxy', version: VERSION }, { capabilities: {} });
|
|
64
53
|
try {
|
|
65
|
-
await upstream.connect(
|
|
54
|
+
await upstream.connect(transport);
|
|
55
|
+
upstreamConnected = true;
|
|
56
|
+
log('Connected to upstream GIA server.');
|
|
57
|
+
// Handle upstream errors without crashing
|
|
58
|
+
transport.onerror = (err) => {
|
|
59
|
+
log(`Upstream error: ${err.message}`);
|
|
60
|
+
};
|
|
61
|
+
transport.onclose = () => {
|
|
62
|
+
log('Upstream connection closed. Server remains available — reconnect on next request.');
|
|
63
|
+
upstreamConnected = false;
|
|
64
|
+
};
|
|
66
65
|
}
|
|
67
66
|
catch (err) {
|
|
68
67
|
const message = err instanceof Error ? err.message : String(err);
|
|
69
|
-
log(`
|
|
68
|
+
log(`WARNING: Failed to connect to GIA server: ${message}`);
|
|
69
|
+
log('Server is running in disconnected mode.');
|
|
70
|
+
log('Tool calls will return errors until upstream is reachable.');
|
|
71
|
+
upstreamConnected = false;
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
async function main() {
|
|
75
|
+
// ── Read configuration from environment ──
|
|
76
|
+
const apiKey = process.env.GIA_API_KEY;
|
|
77
|
+
const serverUrl = process.env.GIA_SERVER_URL || DEFAULT_SERVER_URL;
|
|
78
|
+
if (!apiKey) {
|
|
79
|
+
log('ERROR: GIA_API_KEY environment variable is required.');
|
|
80
|
+
log('');
|
|
81
|
+
log('Get your API key at https://gia.aceadvising.com');
|
|
82
|
+
log('Then set it:');
|
|
83
|
+
log(' export GIA_API_KEY=gia_your_key_here');
|
|
70
84
|
log('');
|
|
71
|
-
log('
|
|
72
|
-
log(' 1. Your GIA_API_KEY is valid');
|
|
73
|
-
log(` 2. The server at ${serverUrl} is reachable`);
|
|
74
|
-
log(' 3. Your network connection is active');
|
|
85
|
+
log('Or configure it in your Claude Desktop / Claude Code settings.');
|
|
75
86
|
process.exit(1);
|
|
76
87
|
}
|
|
77
|
-
|
|
78
|
-
// ── Create local stdio server ──
|
|
79
|
-
// Advertise capabilities that the upstream server supports
|
|
88
|
+
// ── Create local stdio server FIRST (so health checks work) ──
|
|
80
89
|
const local = new Server({ name: 'gia-mcp-server', version: VERSION }, {
|
|
81
90
|
capabilities: {
|
|
82
91
|
tools: {},
|
|
@@ -84,7 +93,7 @@ async function main() {
|
|
|
84
93
|
prompts: {},
|
|
85
94
|
},
|
|
86
95
|
});
|
|
87
|
-
// ── Bridge: forward
|
|
96
|
+
// ── Bridge: forward requests to upstream (or return error if disconnected) ──
|
|
88
97
|
local.fallbackRequestHandler = async (request) => {
|
|
89
98
|
const method = request.method;
|
|
90
99
|
const params = request.params ?? {};
|
|
@@ -92,12 +101,41 @@ async function main() {
|
|
|
92
101
|
if (!schema) {
|
|
93
102
|
throw new Error(`Unsupported method: ${method}`);
|
|
94
103
|
}
|
|
95
|
-
//
|
|
104
|
+
// Ping always succeeds locally — keeps the server alive for health checks
|
|
105
|
+
if (method === 'ping') {
|
|
106
|
+
return {};
|
|
107
|
+
}
|
|
108
|
+
if (!upstreamConnected || !upstream) {
|
|
109
|
+
// Try to reconnect on demand
|
|
110
|
+
await connectUpstream(apiKey, serverUrl);
|
|
111
|
+
}
|
|
112
|
+
// When disconnected, return empty results for discovery methods
|
|
113
|
+
// so health checks and tool listing still work
|
|
114
|
+
if (!upstreamConnected || !upstream) {
|
|
115
|
+
const disconnectedMsg = `[GIA disconnected] Connect to ${serverUrl} with a valid GIA_API_KEY to enable tools.`;
|
|
116
|
+
switch (method) {
|
|
117
|
+
case 'tools/list':
|
|
118
|
+
return { tools: [{ name: 'gia_system_status', description: disconnectedMsg, inputSchema: { type: 'object', properties: {} } }] };
|
|
119
|
+
case 'resources/list':
|
|
120
|
+
return { resources: [] };
|
|
121
|
+
case 'resources/templates/list':
|
|
122
|
+
return { resourceTemplates: [] };
|
|
123
|
+
case 'prompts/list':
|
|
124
|
+
return { prompts: [] };
|
|
125
|
+
case 'logging/setLevel':
|
|
126
|
+
return {};
|
|
127
|
+
default:
|
|
128
|
+
throw new Error('GIA upstream server is not reachable. Check your GIA_API_KEY and network connection. ' +
|
|
129
|
+
`Server URL: ${serverUrl}`);
|
|
130
|
+
}
|
|
131
|
+
}
|
|
96
132
|
const result = await upstream.request({ method, params }, schema);
|
|
97
133
|
return result;
|
|
98
134
|
};
|
|
99
135
|
// Forward notifications from Claude to upstream
|
|
100
136
|
local.fallbackNotificationHandler = async (notification) => {
|
|
137
|
+
if (!upstreamConnected || !upstream)
|
|
138
|
+
return;
|
|
101
139
|
try {
|
|
102
140
|
await upstream.notification({
|
|
103
141
|
method: notification.method,
|
|
@@ -115,12 +153,15 @@ async function main() {
|
|
|
115
153
|
log(`Upstream: ${serverUrl}`);
|
|
116
154
|
log('Transport: stdio <-> HTTPS');
|
|
117
155
|
log('Ready.');
|
|
156
|
+
// ── Now connect upstream (non-fatal) ──
|
|
157
|
+
await connectUpstream(apiKey, serverUrl);
|
|
118
158
|
// ── Graceful shutdown ──
|
|
119
159
|
const shutdown = async () => {
|
|
120
160
|
log('Shutting down...');
|
|
121
161
|
try {
|
|
122
162
|
await local.close();
|
|
123
|
-
|
|
163
|
+
if (upstream)
|
|
164
|
+
await upstream.close();
|
|
124
165
|
}
|
|
125
166
|
catch {
|
|
126
167
|
// Best-effort cleanup
|
|
@@ -129,14 +170,6 @@ async function main() {
|
|
|
129
170
|
};
|
|
130
171
|
process.on('SIGINT', shutdown);
|
|
131
172
|
process.on('SIGTERM', shutdown);
|
|
132
|
-
// ── Handle upstream errors ──
|
|
133
|
-
upstreamTransport.onerror = (err) => {
|
|
134
|
-
log(`Upstream error: ${err.message}`);
|
|
135
|
-
};
|
|
136
|
-
upstreamTransport.onclose = () => {
|
|
137
|
-
log('Upstream connection closed.');
|
|
138
|
-
process.exit(1);
|
|
139
|
-
};
|
|
140
173
|
}
|
|
141
174
|
main().catch((err) => {
|
|
142
175
|
const message = err instanceof Error ? err.message : String(err);
|
package/package.json
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "gia-mcp-server",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.2",
|
|
4
4
|
"description": "MCP proxy for GIA Governance — connects Claude Desktop and Claude Code to the hosted GIA governance engine.",
|
|
5
5
|
"author": {
|
|
6
6
|
"name": "William J. Storey III",
|
|
7
7
|
"url": "https://github.com/aceadvising"
|
|
8
8
|
},
|
|
9
|
-
"license": "
|
|
9
|
+
"license": "Proprietary",
|
|
10
10
|
"type": "module",
|
|
11
11
|
"main": "dist/proxy.js",
|
|
12
12
|
"types": "dist/proxy.d.ts",
|
|
@@ -38,6 +38,7 @@
|
|
|
38
38
|
"url": "https://github.com/knowledgepa3/gia-mcp-server"
|
|
39
39
|
},
|
|
40
40
|
"homepage": "https://gia.aceadvising.com",
|
|
41
|
+
"mcpName": "io.github.knowledgepa3/gia-mcp-server",
|
|
41
42
|
"engines": {
|
|
42
43
|
"node": ">=18.0.0"
|
|
43
44
|
},
|