Simple MCP Server

Simple MCP Server

A minimal MCP server providing basic calculator operations (add, echo) and Android device management tools (list connected devices and available emulators via ADB).

Category
Visit Server

README

Simple MCP Server with Add Functionality

This is a minimal MCP (Model Context Protocol) server that provides two tools:

  1. echo - Echoes back any text you send
  2. add - Adds two numbers together

How it Works

This MCP server acts as a bridge between an AI Model (like Claude) and your local environment (Android tools and system commands).

Communication Flow

The following diagram illustrates how a user prompt triggers a tool execution:

sequenceDiagram
    participant User
    participant AI as AI Model (Claude)
    participant MCP as MCP Server (Node.js)
    participant Tools as Android Tools (ADB/Emulator)

    User->>AI: "Are there any Android phones connected?"
    AI->>MCP: Call tool: list_android_devices
    MCP->>Tools: Execute: adb devices
    Tools-->>MCP: Return device list
    MCP-->>AI: Return tool result (JSON)
    AI-->>User: "Yes, you have 2 emulators connected..."

Detailed Process

  1. User Prompt: You send a natural language request to the AI.
  2. Tool Selection: The AI identifies that the request requires a specific tool (e.g., list_android_devices) based on the tool descriptions provided by the MCP server.
  3. MCP Request: The AI sends a JSON-RPC request to the MCP server via the standard transport (stdio).
  4. Execution: The MCP server executes the corresponding system command (like adb or emulator) using Node.js child_process.
  5. Response: The server captures the command output and sends it back to the AI as a structured response.
  6. AI Interpretation: The AI interprets the raw data and provides a human-friendly answer to you.

PlantUML Source

If you wish to render this diagram elsewhere, here is the PlantUML source:

@startuml
actor User
participant "AI Model (Claude)" as AI
participant "MCP Server (Node.js)" as MCP
participant "Android Tools (ADB/Emulator)" as Tools

User -> AI : "Are there any Android phones connected?"
AI -> MCP : Call tool: list_android_devices
MCP -> Tools : Execute: adb devices
Tools -> MCP : Return device list
MCP -> AI : Return tool result (JSON)
AI -> User : "Yes, you have 2 emulators connected..."
@enduml

Prerequisites

  • Node.js installed
  • Dependencies installed (npm install)

Installation

npm install

Running as a Local MCP Server

Option 1: Direct Node Execution

node server.js

Option 2: Configure in Claude Desktop (or other MCP clients)

Add this to your MCP client configuration (e.g., claude_desktop_config.json):

{
  "mcpServers": {
    "simple-calculator": {
      "command": "node",
      "args": ["d:\\work\\mcp\\mcp-min\\server.js"]
    }
  }
}

Note: Update the path in args to match your actual installation directory.

Available Tools

1. echo

Echoes back whatever text you send.

Input:

  • text (string, required): The text to echo back

Output:

  • echoed (string): The echoed text

Example:

{
  "text": "Hello, World!"
}

2. add

Adds two numbers together.

Input:

  • a (number, required): First number
  • b (number, required): Second number

Output:

  • result (number): Sum of a and b

Example:

{
  "a": 5,
  "b": 3
}

Returns: { "result": 8 }

3. list_android_devices

Lists connected Android devices using the adb command.

Input:

  • None

Output:

  • text (string): The output of the adb devices command.

Example: Returns: List of devices attached\nemulator-5554\tdevice

4. list_android_emulators

Lists available Android emulators (AVDs) using the emulator -list-avds command.

Input:

  • None

Output:

  • text (string): The list of available AVD names.

Example: Returns: Pixel_9a\nPixel_Tablet

Testing the Server

You can test the server by:

  1. Running it directly with node server.js
  2. Connecting it to an MCP client like Claude Desktop
  3. Using the tools through the client interface

The server communicates via stdio (standard input/output), which is the standard transport for MCP servers.

Example Prompts

Once the MCP server is connected to your client (like Claude Desktop), you can use prompts like these to trigger the tools:

For the add tool:

  • "Can you add 25 and 37 for me?"
  • "What is the sum of 123.45 and 67.89?"
  • "I have 15 apples and my friend gives me 28 more. How many do I have in total? (Use the add tool)"
  • "Calculate 1024 + 2048."

For the echo tool:

  • "Echo the phrase 'MCP is awesome!'"
  • "Can you repeat back exactly what I say: 'Testing the echo functionality'?"
  • "Use the echo tool to send back 'Hello from the other side'."

For the list_android_devices tool:

  • "List my connected Android devices."
  • "Show me all Android devices currently attached via adb."
  • "Are there any Android phones connected?"

For the list_android_emulators tool:

  • "What Android emulators do I have available?"
  • "List all my AVDs."
  • "Show me the list of Android emulators I can start."

Server Details

  • Name: simple-mcp-server
  • Version: 0.0.1
  • Transport: stdio (StdioServerTransport)
  • Module Type: ES Modules (import/export)

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
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
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
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