MCP client wrapper for Asset Panda calculator
npm install assetpanda-mcp-calculatorThis is a real MCP server that wraps your calculator Lambda function and makes it available to Claude Desktop via the Model Context Protocol.
```
Claude Desktop (MCP Protocol)
↓
MCP Calculator Wrapper (this package)
↓ HTTP
Calculator Lambda (AWS Lambda Function URL)
↓
Calculator Operations (add, subtract, multiply, divide, power, sqrt)
Your Claude Desktop config at C:\Users\reymondko\AppData\Roaming\Claude\claude_desktop_config.json:
`json`
{
"mcpServers": {
"assetpanda-calculator": {
"command": "npx",
"args": ["-y", "assetpanda-mcp-calculator@1.0.22"]
}
}
}
Steps:
1. Update your Claude Desktop config with the above
2. Restart Claude Desktop
3. Ask Claude: "What's 25 times 4?"
For testing local changes before publishing:
`json`
{
"mcpServers": {
"assetpanda-calculator": {
"command": "node",
"args": ["\\\\wsl.localhost\\Ubuntu\\home\\reymondko\\pioneer\\packages\\mcp-calculator-wrapper\\index.js"]
}
}
}
Steps:
1. Make changes to index.js
2. Update config to point to local file
3. Restart Claude Desktop
Claude Desktop talks to this wrapper using the MCP protocol over standard input/output.
The wrapper registers six calculator tools:
- add: Add two numbers
- Parameters: a (first number), b (second number)
- Returns: Sum of a and b
- subtract: Subtract one number from another
- Parameters: a (number to subtract from), b (number to subtract)
- Returns: Difference of a minus b
- multiply: Multiply two numbers
- Parameters: a (first number), b (second number)
- Returns: Product of a and b
- divide: Divide one number by another
- Parameters: a (dividend), b (divisor)
- Returns: Quotient of a divided by b
- power: Raise a number to a power
- Parameters: base (base number), exponent (exponent)
- Returns: Base raised to the exponent
- sqrt: Calculate square root
- Parameters: a (number to calculate square root of)
- Returns: Square root of a
When Claude calls a calculator tool, the wrapper:
1. Receives MCP request from Claude Desktop
2. Converts it to HTTP POST request
3. Calls your Lambda at https://fwigg2gvf2sbsinmddyrwga2tq0zdthi.lambda-url.us-east-1.on.aws/mcp
4. Converts Zod schemas from Lambda to JSON Schema (for Claude compatibility)
5. Returns results back to Claude via MCP protocol
The wrapper automatically converts Zod schemas returned by the Lambda to proper JSON Schema format that Claude Desktop can understand. This happens in the tools/list handler:
`javascript`
// Convert Zod schemas to JSON Schema for all calculator tools
if (result.result?.tools) {
result.result.tools = result.result.tools.map(tool => {
const schemas = {
'add': {
type: 'object',
properties: {
a: { type: 'number', description: 'First number' },
b: { type: 'number', description: 'Second number' }
},
required: ['a', 'b']
},
// ... other tools
};
return {
name: tool.name,
description: tool.description,
inputSchema: schemas[toolName] || defaultSchema
};
});
}
- index.js - Main MCP server implementation with schema conversion
- package.json - NPM configuration
- mcp.log - Runtime logs (created automatically)
`bashInstall dependencies (if any added)
npm install
This starts the MCP server. It communicates via stdio, so you'll need an MCP client (like Claude Desktop) to interact with it.
Testing Locally
Test the wrapper directly:
`bash
node /home/reymondko/pioneer/packages/mcp-calculator-wrapper/index.js
`Then in another terminal, send MCP messages:
`bash
Initialize
echo '{"jsonrpc":"2.0","method":"initialize","params":{"protocolVersion":"2025-06-18","capabilities":{},"clientInfo":{"name":"test","version":"1.0.0"}},"id":1}' | node index.jsList tools
echo '{"jsonrpc":"2.0","method":"tools/list","id":1}' | node index.jsCall add tool
echo '{"jsonrpc":"2.0","method":"tools/call","params":{"name":"add","arguments":{"a":5,"b":3}},"id":1}' | node index.js
`Publishing to NPM
`bash
Update version in package.json
npm version patch # or minor, or majorPublish (requires NPM account and login)
npm publish --access public
`After publishing, anyone can use:
`bash
npx assetpanda-mcp-calculator@latest
`Important: When updating the package, use specific version numbers in Claude Desktop config to avoid NPM cache issues:
`json
{
"mcpServers": {
"assetpanda-calculator": {
"command": "npx",
"args": ["-y", "assetpanda-mcp-calculator@1.0.22"]
}
}
}
`Change
@1.0.22 to @1.0.23 after publishing a new version to force cache refresh.Environment Variables
- MCP_API_URL: Your Lambda function URL (default:
https://fwigg2gvf2sbsinmddyrwga2tq0zdthi.lambda-url.us-east-1.on.aws)You can override this in Claude Desktop config:
`json
{
"mcpServers": {
"assetpanda-calculator": {
"command": "npx",
"args": ["-y", "assetpanda-mcp-calculator@1.0.22"],
"env": {
"MCP_API_URL": "https://your-custom-lambda-url.amazonaws.com"
}
}
}
}
`Usage Examples
$3
Just ask natural language questions:
- "What's 25 times 4?"
- "Calculate the square root of 144"
- "What's 2 to the power of 8?"
- "Divide 100 by 5"
- "Add 42 and 58"
Claude will automatically use the MCP calculator tools.
Troubleshooting
$3
If you see errors like
Unrecognized key(s) in object: 'error' or ZodError in Claude Desktop logs:Cause: The Lambda is returning Zod schemas instead of JSON Schema.
Fix: This wrapper automatically converts Zod schemas to JSON Schema. Make sure you're using version 1.0.22 or later:
`bash
Clear NPM cache
rm -rf /mnt/c/Users/reymondko/AppData/Local/npm-cache/_npxUpdate Claude Desktop config to specific version
Change: "assetpanda-mcp-calculator@latest"
To: "assetpanda-mcp-calculator@1.0.22"
Restart Claude Desktop
`$3
If Claude Desktop keeps using an old version after publishing updates:
Cause: npx caches packages based on the package spec hash.
Fix:
1. Use specific version numbers instead of
@latest in config
2. Delete NPM cache: rm -rf /mnt/c/Users/reymondko/AppData/Local/npm-cache/_npx
3. Restart Claude Desktop$3
If you installed the package globally and it's not working:
Cause: Global installations can interfere with npx.
Fix:
`bash
Uninstall global package
npm uninstall -g assetpanda-mcp-calculatorClear cache
rm -rf /mnt/c/Users/reymondko/AppData/Local/npm-cache/_npxRestart Claude Desktop
`$3
Make sure Node.js is accessible from Windows:
`powershell
In PowerShell, verify Node.js is installed
node --versionShould output: v18.0.0 or higher
`$3
Check that the Lambda URL is correct and accessible:
`bash
curl -X POST "https://fwigg2gvf2sbsinmddyrwga2tq0zdthi.lambda-url.us-east-1.on.aws/mcp" \
-H "Content-Type: application/json" \
-d '{"jsonrpc":"2.0","method":"tools/list","id":1}'
`Should return a list of calculator tools.
$3
1. Check Claude Desktop logs: Help → View Logs
2. Look for
mcp-server-assetpanda-calculator.log
3. Verify the config file path is correct
4. Make sure you restarted Claude Desktop after changing config
5. Check that the wrapper is starting: look for === MCP Server starting === in logs$3
The wrapper creates a log file at:
`
/home/reymondko/pioneer/packages/mcp-calculator-wrapper/mcp.log
`Check this file for detailed request/response logging:
`bash
tail -f /home/reymondko/pioneer/packages/mcp-calculator-wrapper/mcp.log
`Look for:
-
=== MCP Server starting === - Server initialized
- >>> Making Lambda request - Calling Lambda
- <<< Lambda response - Got Lambda response
- ERROR - Any errorsLambda Function URL
Your current Lambda function URL is:
`
https://fwigg2gvf2sbsinmddyrwga2tq0zdthi.lambda-url.us-east-1.on.aws/mcp
`This Lambda implements the calculator operations and returns results to the wrapper.
Architecture
`
┌─────────────────────┐
│ Claude Desktop │
│ (User asks math) │
└──────────┬──────────┘
│ MCP Protocol (stdio)
│ {"jsonrpc":"2.0","method":"tools/call",...}
↓
┌─────────────────────┐
│ MCP Wrapper │
│ (this package) │
│ - Converts MCP │
│ - Schema transform │
│ - Logging │
└──────────┬──────────┘
│ HTTPS POST
│ {"jsonrpc":"2.0","method":"tools/call",...}
↓
┌─────────────────────┐
│ Lambda Function │
│ (Calculator) │
│ - add, subtract │
│ - multiply, divide │
│ - power, sqrt │
└─────────────────────┘
``- 1.0.22 - Fixed schema conversion (Zod → JSON Schema)
- 1.0.7 - Initial release with basic calculator operations
- assetpanda-mcp-kb - Knowledge Base search MCP wrapper
- @assetpanda/mcp-client - Asset Panda MCP client wrapper
ISC