MCP Weather Client & Server Example with Typescript

by ijshd7

302 downloads
Not rated
GitHub

About

This is a tutorial project demonstrating the Model Context Protocol (MCP) with Anthropic’s Claude models. It includes a CLI-based client and a weather tools server that communicate via MCP over stdio.

Details

Author
ijshd7
Downloads
302
Categories
Media

- MCP‑compliant server exposing get-alerts and get-forecast tools
- CLI client using Anthropic Claude to call weather tools
- Written in TypeScript for both client and server
- Communicates over stdio transport
- Supports .env configuration with ANTHROPIC_API_KEY

Prerequisites are Node.js v20+, an Anthropic API key with credits, and the @anthropic-ai/sdk. Run npm install && npm run build in both the client and server directories, then from client execute node build/index.js ../server/build/index.js.

MCP Weather Client & Server Example with Typescript

This is a tutorial project demonstrating the use of the Model Context Protocol (MCP) with Anthropic's Claude models. The app includes a simple CLI-based client and a weather tools server, which communicates via MCP over stdio.

Features

- 🔌 MCP-compliant server exposing tools like get-alerts and get-forecast
- 🤖 CLI client using Anthropic Claude (via the @anthropic-ai/sdk) to call tools
- 🛠️ Written in TypeScript for the client and server
- 🌦️ Example tools provide weather alert and forecast info
- 🔐 Supports .env configuration with ANTHROPIC_API_KEY

---

Getting Started

Prerequisites

- Node.js v20+
- An Anthropic API key
- NOTE: You will need credits added

Running

- In client: npm install && npm run build - In server: npm install && npm run build - In client: node build/index.js ../server/build/index.js
No reviews yet — be the first

Sign in to leave a review

Use Google, GitHub, or an email account so ratings stay tied to real people.

Email sign in

No reviews posted yet.