@cybermem/mcp 0.6.0 → 0.6.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/dist/index.js CHANGED
@@ -1,3 +1,4 @@
1
+ #!/usr/bin/env node
1
2
  "use strict";
2
3
  var __importDefault = (this && this.__importDefault) || function (mod) {
3
4
  return (mod && mod.__esModule) ? mod : { "default": mod };
@@ -109,8 +110,9 @@ const apiClient = axios_1.default.create({
109
110
  });
110
111
  // Helper to get client with context
111
112
  function getClient(customHeaders = {}) {
112
- // Identity is taken from currentClientName which is updated per-request in SSE mode
113
- const clientName = customHeaders["X-Client-Name"] || currentClientName;
113
+ // Get client name from MCP protocol (sent during initialize) or fallback to CLI arg
114
+ const clientVersion = server.getClientVersion();
115
+ const clientName = customHeaders["X-Client-Name"] || clientVersion?.name || currentClientName;
114
116
  return {
115
117
  ...apiClient,
116
118
  get: (url, config) => apiClient.get(url, { ...config, headers: { "X-Client-Name": clientName, ...config?.headers } }),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cybermem/mcp",
3
- "version": "0.6.0",
3
+ "version": "0.6.4",
4
4
  "description": "CyberMem MCP Server (TypeScript)",
5
5
  "main": "dist/index.js",
6
6
  "bin": {
package/src/index.ts CHANGED
@@ -1,3 +1,4 @@
1
+ #!/usr/bin/env node
1
2
  import { Server } from "@modelcontextprotocol/sdk/server/index.js";
2
3
  import { SSEServerTransport } from "@modelcontextprotocol/sdk/server/sse.js";
3
4
  import { StdioServerTransport } from "@modelcontextprotocol/sdk/server/stdio.js";
@@ -121,8 +122,9 @@ const apiClient = axios.create({
121
122
 
122
123
  // Helper to get client with context
123
124
  function getClient(customHeaders: Record<string, string> = {}) {
124
- // Identity is taken from currentClientName which is updated per-request in SSE mode
125
- const clientName = customHeaders["X-Client-Name"] || currentClientName;
125
+ // Get client name from MCP protocol (sent during initialize) or fallback to CLI arg
126
+ const clientVersion = server.getClientVersion();
127
+ const clientName = customHeaders["X-Client-Name"] || clientVersion?.name || currentClientName;
126
128
 
127
129
  return {
128
130
  ...apiClient,