byclaw-mcp 0.4.11 → 0.4.12

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.
Files changed (2) hide show
  1. package/dist/index.js +28 -11
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -4,6 +4,23 @@ Object.defineProperty(exports, "__esModule", { value: true });
4
4
  const index_js_1 = require("@modelcontextprotocol/sdk/server/index.js");
5
5
  const stdio_js_1 = require("@modelcontextprotocol/sdk/server/stdio.js");
6
6
  const types_js_1 = require("@modelcontextprotocol/sdk/types.js");
7
+ const fs_1 = require("fs");
8
+ const path_1 = require("path");
9
+ // Single source of truth for the version string. Used in serverInfo,
10
+ // startup banner, User-Agent, and as a [byclaw-mcp vX.Y.Z] prefix on
11
+ // every tool description so MCP clients (and the model running inside
12
+ // them) can see at a glance which version they're talking to without
13
+ // peeking at the MCP-internal serverInfo handshake metadata.
14
+ const SERVER_VERSION = (() => {
15
+ try {
16
+ const pkg = JSON.parse((0, fs_1.readFileSync)((0, path_1.join)(__dirname, '..', 'package.json'), 'utf8'));
17
+ return typeof pkg.version === 'string' ? pkg.version : '0.0.0';
18
+ }
19
+ catch {
20
+ return '0.0.0';
21
+ }
22
+ })();
23
+ const TOOL_PREFIX = `[byclaw-mcp v${SERVER_VERSION}] `;
7
24
  const API_BASE = process.env.BYCLAW_API_URL || 'https://byclaw.io';
8
25
  const API_KEY = process.env.BYCLAW_API_KEY || '';
9
26
  // Brand fallback when the catalog row has no image. Clients (Claude Desktop
@@ -22,7 +39,7 @@ async function fetchImageBase64(url) {
22
39
  try {
23
40
  const res = await fetch(url, {
24
41
  signal: AbortSignal.timeout(8000),
25
- headers: { 'User-Agent': 'Mozilla/5.0 (compatible; byclaw-mcp/0.4.11)' },
42
+ headers: { 'User-Agent': `Mozilla/5.0 (compatible; byclaw-mcp/${SERVER_VERSION})` },
26
43
  redirect: 'follow',
27
44
  });
28
45
  if (!res.ok)
@@ -50,7 +67,7 @@ async function apiCall(path, options = {}) {
50
67
  });
51
68
  return res.json();
52
69
  }
53
- const server = new index_js_1.Server({ name: 'byclaw', version: '0.4.11' }, { capabilities: { tools: {}, prompts: {} } });
70
+ const server = new index_js_1.Server({ name: 'byclaw', version: SERVER_VERSION }, { capabilities: { tools: {}, prompts: {} } });
54
71
  // Prompts
55
72
  server.setRequestHandler(types_js_1.ListPromptsRequestSchema, async () => ({
56
73
  prompts: [{
@@ -72,7 +89,7 @@ server.setRequestHandler(types_js_1.ListToolsRequestSchema, async () => ({
72
89
  // ── Core: one-shot shopping ──
73
90
  {
74
91
  name: 'shop',
75
- description: 'Search and compare products across multiple shops. Returns a JSON object with `picked` (the recommendation) and `alternatives` (other candidates). Each product object includes `title`, `price`, `brand`, `merchant`, `affiliate_url`, and `image_url` (absolute HTTPS URL). Render every product image inline using markdown image syntax: `![title](image_url)`. The server also emits native MCP image content blocks for clients that render them natively — use whichever your client supports, prefer markdown when in doubt.',
92
+ description: TOOL_PREFIX + 'Search and compare products across multiple shops. Returns a JSON object with `picked` (the recommendation) and `alternatives` (other candidates). Each product object includes `title`, `price`, `brand`, `merchant`, `affiliate_url`, and `image_url` (absolute HTTPS URL). Render every product image inline using markdown image syntax: `![title](image_url)`. The server also emits native MCP image content blocks for clients that render them natively — use whichever your client supports, prefer markdown when in doubt.',
76
93
  inputSchema: {
77
94
  type: 'object',
78
95
  properties: {
@@ -88,7 +105,7 @@ server.setRequestHandler(types_js_1.ListToolsRequestSchema, async () => ({
88
105
  // ── Optional: browse & explore ──
89
106
  {
90
107
  name: 'search_products',
91
- description: 'Browse products without triggering a recommendation. Use this only if the user explicitly wants to see a list of options. Each result item has `image_url` (absolute HTTPS URL) — render it inline with markdown `![title](image_url)` so users see what each product looks like.',
108
+ description: TOOL_PREFIX + 'Browse products without triggering a recommendation. Use this only if the user explicitly wants to see a list of options. Each result item has `image_url` (absolute HTTPS URL) — render it inline with markdown `![title](image_url)` so users see what each product looks like.',
92
109
  inputSchema: {
93
110
  type: 'object',
94
111
  properties: {
@@ -103,7 +120,7 @@ server.setRequestHandler(types_js_1.ListToolsRequestSchema, async () => ({
103
120
  },
104
121
  {
105
122
  name: 'leave_review',
106
- description: 'Write a product review. Only call if the user explicitly asks to leave a review. Only de and en allowed.',
123
+ description: TOOL_PREFIX + 'Write a product review. Only call if the user explicitly asks to leave a review. Only de and en allowed.',
107
124
  inputSchema: {
108
125
  type: 'object',
109
126
  properties: {
@@ -119,17 +136,17 @@ server.setRequestHandler(types_js_1.ListToolsRequestSchema, async () => ({
119
136
  // ── Discovery ──
120
137
  {
121
138
  name: 'list_categories',
122
- description: 'Browse all available product categories.',
139
+ description: TOOL_PREFIX + 'Browse all available product categories.',
123
140
  inputSchema: { type: 'object', properties: {} },
124
141
  },
125
142
  {
126
143
  name: 'get_trending',
127
- description: 'Get trending products that agents are buying right now.',
144
+ description: TOOL_PREFIX + 'Get trending products that agents are buying right now.',
128
145
  inputSchema: { type: 'object', properties: {} },
129
146
  },
130
147
  {
131
148
  name: 'get_product_reviews',
132
- description: 'Get agent reviews for a product.',
149
+ description: TOOL_PREFIX + 'Get agent reviews for a product.',
133
150
  inputSchema: {
134
151
  type: 'object',
135
152
  properties: {
@@ -139,13 +156,13 @@ server.setRequestHandler(types_js_1.ListToolsRequestSchema, async () => ({
139
156
  },
140
157
  {
141
158
  name: 'get_platform_stats',
142
- description: 'Get platform statistics: products compared, reviews written, recommendations sent.',
159
+ description: TOOL_PREFIX + 'Get platform statistics: products compared, reviews written, recommendations sent.',
143
160
  inputSchema: { type: 'object', properties: {} },
144
161
  },
145
162
  // ── QA / Testing ──
146
163
  {
147
164
  name: 'test_web_search',
148
- description: 'Test the web agent search endpoint (same as dashboard search). Use for QA to verify web search behavior vs MCP shop behavior.',
165
+ description: TOOL_PREFIX + 'Test the web agent search endpoint (same as dashboard search). Use for QA to verify web search behavior vs MCP shop behavior.',
149
166
  inputSchema: {
150
167
  type: 'object',
151
168
  properties: {
@@ -538,6 +555,6 @@ server.setRequestHandler(types_js_1.CallToolRequestSchema, async (request) => {
538
555
  async function main() {
539
556
  const transport = new stdio_js_1.StdioServerTransport();
540
557
  await server.connect(transport);
541
- console.error('byclaw MCP server v0.4.11 running on stdio');
558
+ console.error(`byclaw MCP server v${SERVER_VERSION} running on stdio`);
542
559
  }
543
560
  main().catch(console.error);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "byclaw-mcp",
3
- "version": "0.4.11",
3
+ "version": "0.4.12",
4
4
  "description": "MCP Server for byclaw.io — Your AI shopping advisor. Connects Claude Desktop and other MCP clients to the byclaw.io product catalog.",
5
5
  "main": "dist/index.js",
6
6
  "bin": {