Big News: Socket raises $60M Series C at a $1B valuation to secure software supply chains for AI-driven development.Announcement
Sign In

@forwardimpact/libmcp

Package Overview
Dependencies
Maintainers
1
Versions
11
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@forwardimpact/libmcp - npm Package Compare versions

Comparing version
0.1.5
to
0.1.6
+13
-7
package.json
{
"name": "@forwardimpact/libmcp",
"version": "0.1.5",
"version": "0.1.6",
"description": "Config-driven gRPC-to-MCP tool registration — agents see protobuf services as MCP tools.",

@@ -11,2 +11,10 @@ "keywords": [

],
"homepage": "https://www.forwardimpact.team",
"repository": {
"type": "git",
"url": "git+https://github.com/forwardimpact/monorepo.git",
"directory": "libraries/libmcp"
},
"license": "Apache-2.0",
"author": "D. Olsson <hi@senzilla.io>",
"forwardimpact": {

@@ -18,4 +26,2 @@ "capability": "agent-infrastructure",

},
"license": "Apache-2.0",
"author": "D. Olsson <hi@senzilla.io>",
"type": "module",

@@ -29,6 +35,2 @@ "main": "./src/index.js",

],
"engines": {
"bun": ">=1.2.0",
"node": ">=18.0.0"
},
"scripts": {

@@ -44,2 +46,6 @@ "test": "bun test test/*.test.js"

},
"engines": {
"bun": ">=1.2.0",
"node": ">=18.0.0"
},
"publishConfig": {

@@ -46,0 +52,0 @@ "access": "public"

@@ -6,2 +6,22 @@ import * as types from "@forwardimpact/libtype";

/**
* Normalizes raw MCP tool params against field metadata.
* Repeated fields become arrays; scalar fields default to empty string.
* @param {object} params - Raw params from MCP tool call
* @param {object} fields - Field metadata from codegen
* @returns {object} Normalized params
*/
function normalizeParams(params, fields) {
const normalized = {};
for (const [k, v] of Object.entries(params)) {
const field = fields[k];
if (field?.repeated) {
normalized[k] = Array.isArray(v) ? v : v ? [v] : [];
} else {
normalized[k] = v || "";
}
}
return normalized;
}
/**
* Register MCP tools from config endpoints using codegen metadata.

@@ -53,11 +73,3 @@ *

server.tool(toolName, endpoint.description, schema, async (params) => {
const normalized = {};
for (const [k, v] of Object.entries(params)) {
const field = methodMeta.fields[k];
if (field?.repeated) {
normalized[k] = Array.isArray(v) ? v : v ? [v] : [];
} else {
normalized[k] = v || "";
}
}
const normalized = normalizeParams(params, methodMeta.fields);
const req = RequestClass.fromObject(normalized);

@@ -64,0 +76,0 @@ const result = await client[methodName](req);