demo-mcp-01

demo-mcp-01

A starter MCP server that provides a calculator tool for performing basic arithmetic operations within Claude Desktop. It serves as a demonstration project for building and extending local tools using the Model Context Protocol.

Category
Visit Server

README

demo-mcp-01

A local MCP (Model Context Protocol) server for Claude Desktop.


Table of Contents


Overview

This project is a local MCP (Model Context Protocol) server that extends Claude Desktop with custom tools. MCP is an open protocol that allows Claude to interact with local services, files, APIs, and more โ€” turning Claude into a powerful assistant tailored to your specific workflow.

This server is built with the MCP TypeScript SDK and runs locally on your machine via stdio transport. Once configured, Claude Desktop automatically starts the server and makes its tools available in every conversation.

What's included

  • calculate โ€” Performs basic math operations: add, subtract, multiply, and divide

This is a starter project โ€” you can easily extend it by adding more tools in src/index.js.


๐Ÿ“ Project Structure

demo-mcp-01/
โ”‚
โ”œโ”€โ”€ src/
โ”‚   โ””โ”€โ”€ index.js          # MCP server entry point
โ”‚
โ”œโ”€โ”€ tools/
โ”‚   โ””โ”€โ”€ calculate.js      # Calculate tool logic
โ”‚
โ”œโ”€โ”€ .gitignore            # Ignore node_modules, .env, etc.
โ”œโ”€โ”€ package.json          # Dependencies and scripts
โ””โ”€โ”€ README.md             # This file

Getting Started

Prerequisites


1. Clone the Repository

git clone https://github.com/santanu2908/demo-mcp-01.git
cd demo-mcp-01

2. Install Dependencies

npm install

3. Configure Claude Desktop

Create a file named claude_desktop_config.json in the Claude config folder.

Config folder path (Windows):

C:\Users\<YourUsername>\AppData\Roaming\Claude\

๐Ÿ’ก To quickly open this folder, press Win + R and type: %APPDATA%\Claude If the Claude folder doesn't exist, create it manually.

Paste the following into claude_desktop_config.json, updating the path to match where you cloned the repo:

{
  "mcpServers": {
    "my-local-server": {
      "command": "node",
      "args": [
        "C:\\Users\\<YourUsername>\\path\\to\\demo-mcp-01\\src\\index.js"
      ]
    }
  }
}

โš ๏ธ On Windows, use double backslashes \\ in the path. Example: "C:\\Users\\John\\Documents\\demo-mcp-01\\src\\index.js"

4. Restart Claude Desktop

Fully quit Claude Desktop (check the system tray โ†’ right-click โ†’ Quit) and reopen it.

5. Verify the Setup

Open Claude Desktop and go to Settings โ†’ Developer. You should see my-local-server listed with a green status indicator showing it is running. If it shows an error or is missing, revisit the config path and restart Claude Desktop.


โš™๏ธ How the Server Starts โ€” No npm start Needed

You never need to manually run npm start or keep a terminal open. Claude Desktop launches the server for you automatically.

When Claude Desktop reads your config:

{
  "command": "node",
  "args": ["C:\\...\\src\\index.js"]
}

It runs node src/index.js as a child process in the background every time Claude Desktop opens. When you close Claude Desktop, it shuts the process down too.

This works because the server uses StdioServerTransport โ€” it communicates via stdin/stdout rather than HTTP or a network port. Claude Desktop pipes messages directly to the process, so there is nothing to manually start or keep alive. Claude Desktop owns the entire process lifecycle.

Traditional Server MCP stdio Server
Who starts it? You (npm start) Claude Desktop
How does it communicate? HTTP / WebSocket stdin / stdout
Who keeps it alive? You Claude Desktop
Port needed? Yes No

๐Ÿ”„ How It Works โ€” End-to-End Flow

Here's a walkthrough of a real tool call: "Multiply 12 by 7"

Step 1 โ€” User Prompt

The user sends a message to Claude Desktop:

Use the calculate tool to multiply 12 by 7

Step 2 โ€” Tool Discovery

  • Claude used the internal tool_search mechanism to locate the calculate tool by querying "math multiply".
  • The tool schema was returned with the following parameters:
    • a โ†’ number (first operand)
    • b โ†’ number (second operand)
    • operation โ†’ one of add | subtract | multiply | divide

Step 3 โ€” Tool Invocation

  • Claude called the calculate tool with:
    a = 12
    b = 7
    operation = multiply
    
  • The server executed the operation and returned:
    Result: 84
    

Step 4 โ€” Result Verification

  • Claude received 84 from the tool and confirmed it as correct.
  • This validated the full MCP loop: Claude โ†’ Tool Call โ†’ Local Server โ†’ Result โ†’ Claude.

๐Ÿ›  Tool Reference

calculate

Performs a basic arithmetic operation on two numbers.

Parameter Type Required Values
a number โœ… Any numeric value
b number โœ… Any numeric value
operation string โœ… add, subtract, multiply, divide

Example Request:

{
  "a": 12,
  "b": 7,
  "operation": "multiply"
}

Example Response:

Result: 84

Troubleshooting

No hammer icon showing?

  • Double-check the path in your config file points to the correct index.js
  • Validate your JSON at jsonlint.com
  • Make sure Node.js is installed: run node --version in a terminal
  • Fully quit Claude Desktop from the system tray before restarting

Config not loading?

  • Confirm the file is named exactly claude_desktop_config.json (not .json.txt)
  • Confirm it lives in %APPDATA%\Claude\, not inside the project folder

๐Ÿ“Œ Key Takeaways

  • MCP lets Claude call real, external code โ€” not guess answers.
  • The calculate tool is deterministic: same input always yields the same output.
  • This pattern scales to databases, APIs, file systems, and hardware.

Built with Model Context Protocol ยท Connected via Claude.ai Developer Tools

Recommended Servers

playwright-mcp

playwright-mcp

A Model Context Protocol server that enables LLMs to interact with web pages through structured accessibility snapshots without requiring vision models or screenshots.

Official
Featured
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

An AI-powered tool that generates modern UI components from natural language descriptions, integrating with popular IDEs to streamline UI development workflow.

Official
Featured
Local
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

Enables interaction with Audiense Insights accounts via the Model Context Protocol, facilitating the extraction and analysis of marketing insights and audience data including demographics, behavior, and influencer engagement.

Official
Featured
Local
TypeScript
VeyraX MCP

VeyraX MCP

Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.

Official
Featured
Local
graphlit-mcp-server

graphlit-mcp-server

The Model Context Protocol (MCP) Server enables integration between MCP clients and the Graphlit service. Ingest anything from Slack to Gmail to podcast feeds, in addition to web crawling, into a Graphlit project - and then retrieve relevant contents from the MCP client.

Official
Featured
TypeScript
Kagi MCP Server

Kagi MCP Server

An MCP server that integrates Kagi search capabilities with Claude AI, enabling Claude to perform real-time web searches when answering questions that require up-to-date information.

Official
Featured
Python
E2B

E2B

Using MCP to run code via e2b.

Official
Featured
Neon Database

Neon Database

MCP server for interacting with Neon Management API and databases

Official
Featured
Exa Search

Exa Search

A Model Context Protocol (MCP) server lets AI assistants like Claude use the Exa AI Search API for web searches. This setup allows AI models to get real-time web information in a safe and controlled way.

Official
Featured
Qdrant Server

Qdrant Server

This repository is an example of how to create a MCP server for Qdrant, a vector search engine.

Official
Featured