MCP Server and Client TypeScript Examples
This repository contains TypeScript examples for both MCP (Model Context Protocol) server and client implementations from the official docs.
I refactored it slightly to separate the clients, entities, and helpers into individual files, and also cleaned up the tsconfig.json.
Project Structure```
├── mcp-client-ts-example/ # MCP Client TypeScript example
│ ├── src/
│ │ ├── index.ts
│ │ └── mcpClients/
│ │ └── AnthropicMCPClient.ts
│ ├── package.json
│ └── tsconfig.json
│
└── mcp-server-ts-example/ # MCP Server TypeScript example
├── src/
│ ├── index.ts
│ ├── entities/
│ │ └── weather.ts
│ ├── helpers/
│ │ └── nationalWeatherService.ts
│ └── types.d.ts
├── package.json
└── tsconfig.json
## Getting Started
### Installation```bash
cd mcp-client-ts-example
npm install
cd ../mcp-server-ts-example
npm install
Running the Examples
MCP Server```bash
cd mcp-server-ts-example
npm run build
npm start
#### MCP Client```bash
cd mcp-client-ts-example
npm run build
npm start
