Skip to content

Commit 7f7e7d6

Browse files
committed
added user-agent versioning
1 parent 564d6c4 commit 7f7e7d6

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

build/index.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import { StdioServerTransport } from "@modelcontextprotocol/sdk/server/stdio.js"
44
import { z } from "zod";
55
import fetch from 'node-fetch';
66
import winston from 'winston';
7+
const VERSION = "0.0.1"; // Version of the MCP server
78
// Configure winston logger
89
const logger = winston.createLogger({
910
level: 'info',
@@ -20,14 +21,15 @@ if (!SOCKET_API_KEY) {
2021
process.exit(1);
2122
}
2223
const SOCKET_HEADERS = {
24+
"user-agent": `socket-mcp/${VERSION}`,
2325
"accept": "application/x-ndjson",
2426
"content-type": "application/json",
2527
"authorization": `Bearer ${SOCKET_API_KEY}`
2628
};
2729
// Create server instance
2830
const server = new McpServer({
2931
name: "socket",
30-
version: "0.0.1",
32+
version: VERSION,
3133
description: "Socket MCP server",
3234
capabilities: {
3335
resources: {},

src/index.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@ import { z } from "zod";
55
import fetch from 'node-fetch';
66
import winston from 'winston';
77

8+
const VERSION = "0.0.1"; // Version of the MCP server
9+
810
// Configure winston logger
911
const logger = winston.createLogger({
1012
level: 'info',
@@ -28,6 +30,7 @@ if (!SOCKET_API_KEY) {
2830
}
2931

3032
const SOCKET_HEADERS = {
33+
"user-agent": `socket-mcp/${VERSION}`,
3134
"accept": "application/x-ndjson",
3235
"content-type": "application/json",
3336
"authorization": `Bearer ${SOCKET_API_KEY}`
@@ -36,7 +39,7 @@ const SOCKET_HEADERS = {
3639
// Create server instance
3740
const server = new McpServer({
3841
name: "socket",
39-
version: "0.0.1",
42+
version: VERSION,
4043
description: "Socket MCP server",
4144
capabilities: {
4245
resources: {},

0 commit comments

Comments
 (0)