ataur39n-sharif/mcp-server
3.2
If you are the rightful owner of mcp-server and would like to certify it and/or have it hosted online, please leave a comment on the right or send an email to henry@mcphub.com.
This project implements a Model Context Protocol server using TypeScript and Express.js, providing both HTTP and stdio-based transport layers for MCP communication.
Tools
4
Resources
0
Prompts
0
Model Context Protocol (MCP) Server
This project implements a Model Context Protocol server using TypeScript and Express.js. It provides both HTTP and stdio-based transport layers for MCP communication.
Features
- Express.js based HTTP server implementation
- Stdio-based transport layer support
- Session management for client connections
- Built-in tools and resources:
- Basic arithmetic operations
- BMI calculator
- Dynamic greeting generator
- Weather data fetching (example of external API integration)
Prerequisites
- Node.js (Latest LTS version recommended)
- TypeScript
- npm or pnpm package manager
Installation
# Install dependencies
pnpm install
# Build the project
pnpm run build
Usage
Starting the HTTP Server
# Development mode with hot reload
pnpm run dev
# Production mode
pnpm start
The server will start on port 3000 by default.
Using the Stdio Transport
Run the stdio-based server:
ts-node stdio-index.ts
Project Structure
index.ts
- Main HTTP server implementationstdio-index.ts
- Stdio transport implementationdist/
- Compiled JavaScript outputtsconfig.json
- TypeScript configuration
Available Tools
-
Addition Tool
- Adds two numbers
- Parameters:
a
andb
(numbers)
-
BMI Calculator
- Calculates Body Mass Index
- Parameters:
weightKg
andheightM
-
Dynamic Greeting
- Generates personalized greetings
- Resource template:
greeting://{name}
-
Weather Fetcher
- Fetches weather data for a given city
- Parameter:
city
(string)
Development
Building
pnpm run build
Running Tests
# Add test commands here once implemented
License
ISC