Skip to main content
Glama
MLValidationDebug

MCP HTTP Server Demo

README.md
# MCP HTTP Server (Standalone)

Minimal MCP server using Streamable HTTP transport and a few demo tools.

## Structure

- mcp_server_http/server.py — HTTP MCP server
- mcp_server/tools — demo tools (calculator, notes, time)

## Install

1. Create and activate a virtual environment (optional).
2. Install dependencies:

   pip install -r requirements.txt

## Run

From this folder:

- PowerShell:

  $env:MCP_HTTP_HOST = "0.0.0.0"
  $env:MCP_HTTP_PORT = "8001"
  python .\mcp_server_http\server.py

The server listens on http://0.0.0.0:8001

## Quick connectivity test

PowerShell:

Invoke-RestMethod -Method Post -Uri http://127.0.0.1:8001/ -ContentType "application/json" -Headers @{Accept="application/json, text/event-stream"} -Body '{"jsonrpc":"2.0","id":1,"method":"initialize","params":{"protocolVersion":"2024-11-05","clientInfo":{"name":"ps","version":"0.1"}}}'

## Gateway registration

Register this server with your gateway using the gateway’s registration endpoint, using transport type "streamable-http" and the server URL.

Example payload:

{
  "name": "mcp-http-server",
  "url": "http://<HOST_OR_IP>:8001/",
  "transport": "streamable-http"
}