MCP-Server-Simple-Example

oezguercelebi/MCP-Server-Simple-Example

3.2

If you are the rightful owner of MCP-Server-Simple-Example 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.

A Model Context Protocol (MCP) server implemented with Node.js, Express, and TypeScript.

MCP Express Server

A Model Context Protocol (MCP) server implemented with Node.js, Express, and TypeScript.

Features

  • Implements MCP tools, resources, and prompts
  • Supports both StdioServerTransport for command-line usage
  • Express HTTP server for testing and debugging

Available MCP Capabilities

Tools

  • echo - Echoes back a message
  • getCurrentTime - Returns the current time in ISO format

Resources

  • example://resource - A simple example resource

Prompts

  • greeting - A simple greeting prompt template

Setup

# Install dependencies
npm install

# Build the TypeScript code
npm run build

Running the Server

Using StdioServerTransport (for MCP Clients)

npm start

Running the Express Server for Testing

npm run dev

Adding to Cursor

To add this server to Cursor, add the following to your ~/.cursor/mcp.json file:

{
  "mcpServers": {
    "Express MCP Server": {
      "command": "node",
      "args": ["path/to/dist/index.js"],
      "transport": "stdio"
    }
  }
}

Replace path/to/dist/index.js with the actual path to your built index.js file.

Testing API Endpoints

  • Health check: http://localhost:3000/health
  • Server info: http://localhost:3000/info

Development

# Run in development mode
npm run dev