home / mcp / hcm mcp server

HCM MCP Server

RESTful MCP server for HCM Chapter 15 two-lane analysis with function calling and doc query capabilities.

Installation
Add the following to your MCP client configuration file.

Configuration

View docs
{
  "mcpServers": {
    "crosstraffic-highway-capacity-manual-mcp": {
      "url": "https://api.hcm-calculator.com/mcp",
      "headers": {
        "HOST": "127.0.0.1",
        "PORT": "8000",
        "DB_MODE": "local",
        "LOG_LEVEL": "INFO",
        "CHROMA_DB_PATH": "./chroma_db",
        "ALLOWED_ORIGINS": "http://localhost:3000,http://localhost:3001",
        "PUBLIC_SUPABASE_API": "your-anon-key / service-role-key",
        "PUBLIC_SUPABASE_URL": "https://"
      }
    }
  }
}

You can run and connect to an MCP server that specializes in Highway Capacity Manual (HCM) analysis, enabling AI assistants and code editors to perform detailed two-lane highway analyses and access HCM documentation through a RESTful interface and dynamic function calling.

How to use

Connect your MCP client to either the remote server or a local development instance to perform HCM Chapter 15 analyses and to query HCM content. Use the function calling interface to run the registered transportation analysis functions, and use the query tools to fetch relevant HCM sections or summaries. The server exposes endpoints for complete Chapter 15 analysis, individual function calls, and registry queries, and it supports AI assistants like Claude and Copilot through standard MCP protocols.

How to install

Prerequisites: you need Python and a working network connection. You will set up a virtual environment, install the package, initialize the database with HCM docs, and start the FastAPI server.

uv venv

# Windows
.venv\Scripts\activate
# Linux
source .venv/bin/activate

uv pip install .

Configuration and usage notes

You can connect to the MCP server remotely or run it locally for development and testing. For remote usage, point your MCP client to the remote URL shown in the configuration examples. For local usage, run the local server and point your client to the local endpoint at the specified port.

Security and environment considerations

If you enable remote access, ensure your server is protected behind appropriate authentication and network controls. When running locally, configure environment variables to control database paths, host/port, allowed origins, and access keys as needed.

Examples and next steps

After starting the local server, import HCM documentation to prepare the knowledge base, and then you can begin performing complete Chapter 15 analyses or individual function calls. You can also connect AI assistants to the server for automated reasoning and documentation retrieval.

Available tools

chapter15_identify_vertical_class

Identify vertical alignment class range for a segment in Chapter 15 two-lane highway analysis.

chapter15_determine_demand_flow

Calculate demand flow rates and capacity for a highway segment.

chapter15_determine_vertical_alignment

Determine vertical alignment classification for a segment.

chapter15_determine_free_flow_speed

Calculate free flow speed for a segment.

chapter15_estimate_average_speed

Estimate average travel speed across segments.

chapter15_estimate_percent_followers

Estimate percentage of following vehicles.

chapter15_determine_follower_density_pl

Determine follower density for passing lanes (PL).

chapter15_determine_follower_density_pc_pz

Determine follower density for PC/PZ segments.

chapter15_determine_segment_los

Calculate segment Level of Service.

chapter15_determine_facility_los

Calculate facility Level of Service.

chapter15_complete_analysis

Run the complete HCM Chapter 15 procedure.

query_hcm

Query HCM documentation database.