Click on "Install Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@Sloot MCP Servercalculate 15 * 3 + 7"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
Sloot MCP Server
A complete TypeScript Model Context Protocol (MCP) server implementation using Express.js and the official MCP SDK.
Features
π Express.js HTTP Server: RESTful API with MCP protocol support
π§ Session Management: Automatic session handling with UUID-based session IDs
π οΈ Built-in Tools: Example tools including echo, time, and calculator
π‘ Streamable Transport: HTTP-based transport with Server-Sent Events (SSE)
π Type Safety: Full TypeScript implementation with strict typing
β€οΈ Health Monitoring: Built-in health check endpoint
Available Tools
The server provides the following MCP tools:
echo - Echo back any message
get_time - Get current server time
calculate - Perform basic mathematical calculations
Quick Start
Prerequisites
Node.js 18+
npm or yarn
Code Quality Tools
This project includes:
ESLint - Code linting with TypeScript support
Prettier - Code formatting
TypeScript - Type checking and compilation
Installation
Clone or download this project
Install dependencies:
npm installDevelopment
Run the server in development mode with hot reload:
npm run devProduction
Build and run the production server:
npm run build
npm startWatch Mode
Run with file watching for development:
npm run watchCode Quality
Check code quality and formatting:
# Lint the code
npm run lint
# Fix linting issues automatically
npm run lint:fix
# Format code with Prettier
npm run format
# Check if code is properly formatted
npm run format:check
# Run all checks (lint + format check + build)
npm run checkUsage
Starting the Server
The server will start on port 3000 by default (configurable via PORT environment variable):
π MCP Server running on port 3000
π‘ MCP endpoint: http://localhost:3000/mcp
β€οΈ Health check: http://localhost:3000/healthMCP Endpoints
POST /mcp - Main MCP communication endpoint
GET /mcp - Server-to-client notifications (SSE)
DELETE /mcp - Session termination
GET /health - Health check and status
Testing the Server
You can test the health endpoint:
curl http://localhost:3000/healthResponse:
{
"status": "healthy",
"timestamp": "2024-01-01T12:00:00.000Z",
"activeSessions": 0
}MCP Client Integration
This server is designed to work with MCP clients. The server handles:
Session initialization with automatic UUID generation
Session persistence across requests
Proper cleanup when sessions are closed
DNS rebinding protection (configurable)
Session Headers
When making requests to the MCP endpoint, include the session ID in headers:
mcp-session-id: <session-uuid>Configuration
Environment Variables
PORT- Server port (default: 3000)
DNS Rebinding Protection
For local development, you can enable DNS rebinding protection by uncommenting and configuring these options in the transport configuration:
enableDnsRebindingProtection: true,
allowedHosts: ['127.0.0.1'],Development
Project Structure
sloot-mcp/
βββ src/
β βββ index.ts # Main server implementation
βββ dist/ # Compiled JavaScript (generated)
βββ package.json # Dependencies and scripts
βββ tsconfig.json # TypeScript configuration
βββ README.md # This fileScripts
npm run build- Compile TypeScript to JavaScriptnpm run start- Run the compiled servernpm run dev- Run with tsx for developmentnpm run watch- Run with file watchingnpm run lint- Run ESLint to check for code issuesnpm run lint:fix- Run ESLint and automatically fix issuesnpm run format- Format code with Prettiernpm run format:check- Check if code is properly formattednpm run check- Run linting, formatting check, and build
Extending the Server
Adding New Tools
To add new tools, modify the ListToolsRequestSchema handler in src/index.ts:
server.setRequestHandler(ListToolsRequestSchema, async () => {
return {
tools: [
// ... existing tools
{
name: "your_tool",
description: "Description of your tool",
inputSchema: {
type: "object",
properties: {
// Define your tool's parameters
},
required: ["required_param"]
}
}
]
};
});Then add the tool implementation in the CallToolRequestSchema handler.
Adding Resources
You can add MCP resources by implementing the appropriate request handlers for resources.
License
MIT