@vendemass/mcp-client 0.1.0 → 0.1.2

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 +8 -5
  2. package/package.json +5 -2
package/dist/index.js CHANGED
@@ -61,17 +61,20 @@ async function rpc(op, payload) {
61
61
  }
62
62
  // --- MCP Server ---
63
63
  const server = new Server({ name: 'vendemass', version: '0.1.0' }, { capabilities: { tools: {} } });
64
- // Tools are fetched dynamically from the server — no hardcoded mapping needed.
65
- // The server returns tool names that match operation names directly.
64
+ // Claude Desktop requires tool names matching ^[a-zA-Z0-9_-]{1,64}$
65
+ // Server uses dots (product.list) we convert: dot dash for Claude, dash → dot for RPC
66
+ function toMcpName(serverName) { return serverName.replace(/\./g, '-'); }
67
+ function toServerOp(mcpName) { return mcpName.replace(/-/, '.'); }
66
68
  server.setRequestHandler(ListToolsRequestSchema, async () => {
67
69
  const tools = await fetchTools();
68
- return { tools };
70
+ return {
71
+ tools: tools.map((t) => ({ ...t, name: toMcpName(t.name) })),
72
+ };
69
73
  });
70
74
  server.setRequestHandler(CallToolRequestSchema, async (request) => {
71
75
  const { name, arguments: args } = request.params;
72
76
  try {
73
- // Tool name IS the operation name (server uses dot notation: product.list, etc.)
74
- const response = await rpc(name, args ?? {});
77
+ const response = await rpc(toServerOp(name), args ?? {});
75
78
  if (!response.success) {
76
79
  return {
77
80
  content: [
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@vendemass/mcp-client",
3
- "version": "0.1.0",
4
- "description": "Conecta tu IA a VendeMass via MCP. Proxy ligero al gateway seguro.",
3
+ "version": "0.1.2",
4
+ "description": "Conecta Claude, Cursor, Windsurf o cualquier IA a tu cuenta de VendeMass.",
5
5
  "private": false,
6
6
  "type": "module",
7
7
  "bin": {
@@ -27,5 +27,8 @@
27
27
  },
28
28
  "dependencies": {
29
29
  "@modelcontextprotocol/sdk": "^1.27.1"
30
+ },
31
+ "devDependencies": {
32
+ "typescript": "^5.7"
30
33
  }
31
34
  }