概要
What is TypeScript MCP Server?
A Model Context Protocol (MCP) server implementation using TypeScript and Express for payroll management. It provides standardized tools and resources that AI models can use to access employee information and perform payroll calculations.
How to use TypeScript MCP Server?
Install dependencies with npm install, create a .env file from the template, and start the server with npm run dev. The server runs on port 8089 by default. An example client is included and can be run with npm run client while the server is running.
Key features of TypeScript MCP Server
- Implements the MCP protocol for LLM interactions
- Provides payroll management tools and employee information access
- Uses Express for HTTP handling
- Supports Server-Sent Events (SSE) for real-time communication
- Offers API and partner authentication methods
- Includes typed TypeScript interfaces for API responses
Use cases of TypeScript MCP Server
- View employee information by employee ID using the view-people tool
- Calculate payroll with automatic tax calculation based on hours worked and hourly rate
- List all employees with filtering and pagination support
- Retrieve basic employee data including name, department, and role
- Ask questions through the ask-question prompt template
FAQ from TypeScript MCP Server
What requirements are needed to run the server?
Node.js 18+ and npm or yarn are required.
What authentication methods does the server support?
Two methods: API authentication using authId and authKey, and partner authentication using partnerKey and clientKey.
How does the server communicate with clients?
The server uses Server-Sent Events (SSE) via the GET /sse endpoint, with a POST /messages endpoint for clients to send messages.
What tools does the server provide?
Four tools: view-people, view-all-people, getEmployeeInfo, and calculatePayroll for payroll calculations.
What resources are available?
Two resources: greeting://welcome (a static welcome message) and users://{userId} (a dynamic resource returning user data).