
mcp ts
使用TypeScript和Node.js实现的基本模型上下文协议(MCP)服务器。
Repository Info
About This Server
使用TypeScript和Node.js实现的基本模型上下文协议(MCP)服务器。
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
Simple MCP Server
A basic implementation of a Model Context Protocol (MCP) server using TypeScript and Node.js.
Features
- Echo Tool: Echoes back any message you send
- Add Numbers: Adds two numbers together
- Current Time: Returns the current timestamp
Setup
-
Install dependencies:
npm install -
Build the project:
npm run build -
Run the server:
npm startOr for development:
npm run dev
Usage
The server communicates via stdio and implements the MCP protocol. It can be used with any MCP-compatible client.
Available Tools
-
echo
- Description: Echo back the provided message
- Parameters:
message(string)
-
add_numbers
- Description: Add two numbers together
- Parameters:
a(number),b(number)
-
get_current_time
- Description: Get the current time
- Parameters: none
Configuration
The server can be configured by modifying the SimpleMCPServer constructor in src/index.ts.
Architecture
src/index.ts: Main server implementationsrc/types.ts: Type definitions- Uses the official MCP SDK for protocol handling
- Communicates via stdio transport
Development
To extend this server:
- Add new tools to the
ListToolsRequestSchemahandler - Implement the tool logic in the
CallToolRequestSchemahandler - Add proper error handling and validation
- Update the tool schema as needed
Quick Start
Clone the repository
git clone https://github.com/cdimascio/mcp-tsInstall dependencies
cd mcp-ts
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.