mcp-server

dpedneka/mcp-server

3.1

If you are the rightful owner of mcp-server 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.

This document provides a structured overview of a basic Model Context Protocol (MCP) server implemented using Node.js and Express.

Basic MCP Server

This is a basic implementation of a Model Context Protocol (MCP) server using Node.js and Express.

Features

  • Basic MCP endpoints:
    • /v1/generate - Text generation endpoint
    • /v1/embeddings - Text embeddings endpoint
    • /health - Health check endpoint
  • CORS enabled
  • Environment variable support

Getting Started

  1. Install dependencies:

    npm install
    
  2. Start the server:

    node server.js
    

The server will start on port 3000 by default (configurable via PORT environment variable).

API Endpoints

Generate Text

POST /v1/generate
Content-Type: application/json

{
    "messages": [
        {
            "role": "user",
            "content": "Hello!"
        }
    ],
    "parameters": {}
}

Generate Embeddings

POST /v1/embeddings
Content-Type: application/json

{
    "text": "Sample text for embedding"
}

Health Check

GET /health

$htmlContent = Get-Content -Path "d:\Darshan\test\test.html" -Raw; Invoke-WebRequest -Uri "http://localhost:3000/snapshot" -Method Post -Body $htmlContent -ContentType "text/html"