@cybermem/mcp 0.6.2 → 0.6.6
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 +3 -2
- package/package.json +1 -1
- package/src/index.ts +6 -5
package/dist/index.js
CHANGED
|
@@ -110,8 +110,9 @@ const apiClient = axios_1.default.create({
|
|
|
110
110
|
});
|
|
111
111
|
// Helper to get client with context
|
|
112
112
|
function getClient(customHeaders = {}) {
|
|
113
|
-
//
|
|
114
|
-
const
|
|
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;
|
|
115
116
|
return {
|
|
116
117
|
...apiClient,
|
|
117
118
|
get: (url, config) => apiClient.get(url, { ...config, headers: { "X-Client-Name": clientName, ...config?.headers } }),
|
package/package.json
CHANGED
package/src/index.ts
CHANGED
|
@@ -3,9 +3,9 @@ import { Server } from "@modelcontextprotocol/sdk/server/index.js";
|
|
|
3
3
|
import { SSEServerTransport } from "@modelcontextprotocol/sdk/server/sse.js";
|
|
4
4
|
import { StdioServerTransport } from "@modelcontextprotocol/sdk/server/stdio.js";
|
|
5
5
|
import {
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
6
|
+
CallToolRequestSchema,
|
|
7
|
+
ListToolsRequestSchema,
|
|
8
|
+
Tool
|
|
9
9
|
} from "@modelcontextprotocol/sdk/types.js";
|
|
10
10
|
import axios from "axios";
|
|
11
11
|
import cors from "cors";
|
|
@@ -122,8 +122,9 @@ const apiClient = axios.create({
|
|
|
122
122
|
|
|
123
123
|
// Helper to get client with context
|
|
124
124
|
function getClient(customHeaders: Record<string, string> = {}) {
|
|
125
|
-
//
|
|
126
|
-
const
|
|
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;
|
|
127
128
|
|
|
128
129
|
return {
|
|
129
130
|
...apiClient,
|