@miraigent/free-ai-ops-mcp 0.1.23 → 0.1.24

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 CHANGED
@@ -1,5 +1,13 @@
1
1
  # Changelog
2
2
 
3
+ ## [0.1.24] - 2026-06-25
4
+
5
+ ### Changed
6
+
7
+ - Added smoke-test coverage for the public MCP JSON-RPC session example so npm
8
+ and GitHub users can trust that the copy-ready sample stays aligned with the
9
+ packaged server response fields.
10
+
3
11
  ## [0.1.23] - 2026-06-24
4
12
 
5
13
  ### Changed
package/README.md CHANGED
@@ -19,6 +19,9 @@ examples/human-review-gate/.
19
19
  For a complete public-safe MCP session that covers initialize, tools/list, and
20
20
  one tool call, see examples/mcp-json-rpc-session/.
21
21
 
22
+ That JSON-RPC session is also covered by `npm test`, so the README proof path
23
+ and packaged example stay aligned when the MCP response shape changes.
24
+
22
25
  ## One-Command Public Smoke Test
23
26
 
24
27
  Use this when you want to confirm the npm package works before editing a desktop
@@ -37,6 +40,10 @@ This is the fastest public proof path for npm and GitHub users. If the command
37
40
  starts but the returned status is confusing, open a Tried It feedback issue with
38
41
  the command, synthetic input shape, and returned status only.
39
42
 
43
+ For maintainers and contributors, `npm test` replays the same public
44
+ `examples/mcp-json-rpc-session/sample-session.jsonl` file and checks the
45
+ returned server name, version, tool count, and review-gate fields.
46
+
40
47
  If you are checking the package from npm search, run the public help first:
41
48
 
42
49
  npx -y free-ai-ops-mcp@npm:@miraigent/free-ai-ops-mcp --help
@@ -3,6 +3,10 @@
3
3
  This example gives developers a copy-ready MCP session for the public
4
4
  @miraigent/free-ai-ops-mcp package.
5
5
 
6
+ The sample JSONL file in this directory is part of the repository smoke test.
7
+ When `npm test` passes, this public copy-paste session has been replayed against
8
+ the local MCP server and checked for the expected response fields.
9
+
6
10
  Use it before wiring the package into Claude Desktop, Cursor, or a custom MCP
7
11
  client. It verifies that the server responds to:
8
12
 
@@ -40,6 +44,10 @@ If those fields appear in the terminal but not in Claude Desktop, Cursor, or
40
44
  another client, the package is likely running and the next thing to check is the
41
45
  client config, restart behavior, or command path.
42
46
 
47
+ Maintainers should update this sample and the smoke test together whenever a
48
+ response field or tool name changes. That keeps the GitHub example, npm package,
49
+ and README troubleshooting path from drifting apart.
50
+
43
51
  ## Public-Safe Feedback
44
52
 
45
53
  If the output is unclear, open a Tried It feedback issue and include only:
@@ -1,6 +1,6 @@
1
1
  #!/usr/bin/env node
2
2
 
3
- const serverInfo = { name: 'miraigent-free-ai-ops-mcp', version: '0.1.23' };
3
+ const serverInfo = { name: 'miraigent-free-ai-ops-mcp', version: '0.1.24' };
4
4
 
5
5
  const tools = [
6
6
  {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@miraigent/free-ai-ops-mcp",
3
- "version": "0.1.23",
3
+ "version": "0.1.24",
4
4
  "description": "Free MCP server for developers adding human review gates, prompt risk checks, FAQ review, and CRM note safety to AI tools.",
5
5
  "homepage": "https://github.com/Miraigent/miraigent-free-ai-ops-mcp",
6
6
  "type": "module",
@@ -25,10 +25,6 @@ assert.match(helpStdout, /npx -y free-ai-ops-mcp@npm:@miraigent\/free-ai-ops-mcp
25
25
  assert.match(helpStdout, /human_review_gate/);
26
26
  assert.match(helpStdout, /Do not paste secrets/);
27
27
 
28
- const child = spawn(process.execPath, ['mcp/free-ai-ops-server.mjs'], {
29
- stdio: ['pipe', 'pipe', 'inherit']
30
- });
31
-
32
28
  const requests = [
33
29
  { jsonrpc: '2.0', id: 1, method: 'initialize', params: {} },
34
30
  { jsonrpc: '2.0', id: 2, method: 'tools/list', params: {} },
@@ -93,25 +89,33 @@ const requests = [
93
89
  }
94
90
  ];
95
91
 
96
- let stdout = '';
97
- child.stdout.on('data', (chunk) => {
98
- stdout += chunk;
99
- });
92
+ async function runServerWithRequests(requestLines) {
93
+ const child = spawn(process.execPath, ['mcp/free-ai-ops-server.mjs'], {
94
+ stdio: ['pipe', 'pipe', 'inherit']
95
+ });
100
96
 
101
- for (const request of requests) {
102
- child.stdin.write(JSON.stringify(request) + '\n');
103
- }
104
- child.stdin.end();
97
+ let stdout = '';
98
+ child.stdout.on('data', (chunk) => {
99
+ stdout += chunk;
100
+ });
105
101
 
106
- await new Promise((resolve, reject) => {
107
- child.on('error', reject);
108
- child.on('close', (code) => {
109
- if (code !== 0) reject(new Error('server exited with ' + code));
110
- else resolve();
102
+ for (const requestLine of requestLines) {
103
+ child.stdin.write(requestLine + '\n');
104
+ }
105
+ child.stdin.end();
106
+
107
+ await new Promise((resolve, reject) => {
108
+ child.on('error', reject);
109
+ child.on('close', (code) => {
110
+ if (code !== 0) reject(new Error('server exited with ' + code));
111
+ else resolve();
112
+ });
111
113
  });
112
- });
113
114
 
114
- const responses = stdout.trim().split('\n').map((line) => JSON.parse(line));
115
+ return stdout.trim().split('\n').map((line) => JSON.parse(line));
116
+ }
117
+
118
+ const responses = await runServerWithRequests(requests.map((request) => JSON.stringify(request)));
115
119
  assert.equal(responses.length, requests.length);
116
120
  assert.equal(responses[0].result.serverInfo.name, 'miraigent-free-ai-ops-mcp');
117
121
  assert.equal(responses[0].result.serverInfo.version, packageJson.version);
@@ -121,3 +125,17 @@ assert.match(responses[2].result.content[0].text, /nextLogRow/);
121
125
  assert.match(responses[3].result.content[0].text, /public_faq_candidate/);
122
126
  assert.match(responses[4].result.content[0].text, /crmNote/);
123
127
  assert.match(responses[5].result.content[0].text, /stop_before_ai_use|human_review_required/);
128
+
129
+ const sampleSession = await readFile(
130
+ new URL('../examples/mcp-json-rpc-session/sample-session.jsonl', import.meta.url),
131
+ 'utf8'
132
+ );
133
+ const sampleLines = sampleSession.trim().split('\n');
134
+ const sampleResponses = await runServerWithRequests(sampleLines);
135
+ assert.equal(sampleResponses.length, 3);
136
+ assert.equal(sampleResponses[0].result.serverInfo.name, 'miraigent-free-ai-ops-mcp');
137
+ assert.equal(sampleResponses[0].result.serverInfo.version, packageJson.version);
138
+ assert.equal(sampleResponses[1].result.tools.length, 4);
139
+ assert.match(sampleResponses[2].result.content[0].text, /gateStatus/);
140
+ assert.match(sampleResponses[2].result.content[0].text, /reviewOwner/);
141
+ assert.match(sampleResponses[2].result.content[0].text, /boundary/);