home / mcp / commands mcp server

Commands MCP Server

model context protocol

Installation
Add the following to your MCP client configuration file.

Configuration

View docs
{
  "mcpServers": {
    "amandhunna-mcpserver": {
      "command": "npm",
      "args": [
        "run",
        "start:mcp"
      ],
      "env": {
        "PORT": "3000",
        "MCP_PORT": "3001",
        "ANTHROPIC_API_KEY": "YOUR_API_KEY"
      }
    }
  }
}

You set up an MCP server that coordinates a calculator service powered by Claude AI to interpret natural language requests and perform mathematical operations. This setup lets you talk to a single interface, and the system translates your natural language prompts into precise calculations.

How to use

Interact with the calculator MCP using the client interface. You can ask natural language questions like "Add 5 and 3" or "What is 10 plus 20?". The client forwards your request to the MCP server, which routes it to the Calculator API for the actual math, and then replies with the result. You can use phrases such as "Calculate 7.5 + 2.25", "Multiply 4 by 6", or "What is 8 times 3?". Type help for more examples or exit to quit.

How to install

Prerequisites: you need Node.js and npm installed on your system.

Set up the project and install dependencies by running the following commands in your project directory.

npm install

# Create a .env file with required variables
ANTHROPIC_API_KEY=your_api_key_here
PORT=3000
MCP_PORT=3001

# Start all components concurrently
npm start

# Or start components individually
npm run start:calculator
npm run start:mcp
npm run start:client

# Quick health check (after starting) you can access health endpoints to verify status
GET /health on the Calculator API (port 3000)
GET /health on the MCP Server (port 3001)"}]}]}, {

Additional sections

Configuration and environment: The service uses a single .env file to configure the runtime. Key variables are ANTHROPIC_API_KEY for potential AI processing, PORT for the Calculator API, and MCP_PORT for the MCP Server. Ensure you replace the placeholder value with your actual API key and keep these values consistent with your network setup.

Security and access: Keep the ANTHROPIC_API_KEY secure and do not expose it in public repositories or logs. Use a safe method for injecting environment variables in production, such as a secret store or protected deployment pipeline.

Notes and troubleshooting: If you encounter invalid mathematical operations, division by zero, or parameter type issues, check the Calculator API error handling and ensure the MCP server can reach the AI service without network restrictions. If you see LLM parsing errors or network issues, verify that ANTHROPIC_API_KEY is correct and that the MCP_PORT is not blocked by firewalls.