Skip to main content
Glama
FisherSkyi

MCP Calculator Demo

by FisherSkyi
README.md
# MCP Demo

This repository contains demo projects showcasing the use of the Message Communication Protocol (MCP) in different scenarios.

## Projects

### 1. Calculator

A simple calculator service with a client and server implementation.

- **Files:**  
    - `demo-client.mjs`: Example client for the calculator service  
    - `server.mjs`: Calculator server  
    - `package.json`, `README.md`

### 2. MCP Client (TypeScript)

Offical demo from [MCP documentation](https://modelcontextprotocol.io/docs/develop/build-client)

A TypeScript-based client for interacting with MCP services.

- **Files:**  
    - `index.ts`: Main client code  
    - `build/index.js`: Compiled output  
    - `.env`: Environment configuration  
    - `log/session1.txt`: Example session log  
    - `package.json`, `tsconfig.json`
  
> [!NOTE]
> Need to set `ANTHROPIC_API_KEY` in `.env` to run the client. The credit from Anthropic is NOT free.

### 3. Weather

Offical demo from [MCP documentation](https://modelcontextprotocol.io/docs/develop/build-server)

A weather information service using MCP.

- **Files:**  
    - `src/index.ts`: Main source code  
    - `build/index.js`: Compiled output  
    - `package.json`, `tsconfig.json`

## Getting Started

Each project contains its own dependencies and setup.  
Navigate into a project folder and run:

```bash
npm install
npm start
```

or for TypeScript projects:

```bash
npm install
npm run build
npm start
```

## License

MIT