
mcp server
使用 TypeScript 和 Express.js 构建的模型上下文协议(MCP)服务器,支持 HTTP 和 stdio 通信。
Repository Info
About This Server
使用 TypeScript 和 Express.js 构建的模型上下文协议(MCP)服务器,支持 HTTP 和 stdio 通信。
Model Context Protocol (MCP) - This server can be integrated with AI applications to provide additional context and capabilities, enabling enhanced AI interactions and functionality.
Documentation
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:
aandb(numbers)
-
BMI Calculator
- Calculates Body Mass Index
- Parameters:
weightKgandheightM
-
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
Quick Start
Clone the repository
git clone https://github.com/ataur39n-sharif/mcp-serverInstall dependencies
cd mcp-server
npm installFollow the documentation
Check the repository's README.md file for specific installation and usage instructions.
Repository Details
Recommended MCP Servers
Discord MCP
Enable AI assistants to seamlessly interact with Discord servers, channels, and messages.
Knit MCP
Connect AI agents to 200+ SaaS applications and automate workflows.
Apify MCP Server
Deploy and interact with Apify actors for web scraping and data extraction.
BrowserStack MCP
BrowserStack MCP Server for automated testing across multiple browsers.
Zapier MCP
A Zapier server that provides automation capabilities for various apps.