Integrates with GitHub Copilot to provide transportation engineering calculations and Highway Capacity Manual (HCM) documentation access directly within the VSCode environment.
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., "@HCM-LLM MCP Servercalculate the level of service for a class I two-lane highway"
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.
A FastAPI-based Model Context Protocol (MCP) server for Highway Capacity Manual (HCM) analysis and transportation engineering calculations. So far, this server provides comprehensive two-lane highway analysis following HCM Chapter 15 methodology.
Features
Semantic search over HCM documentation
Complete HCM Chapter 15 two-lane highway analysis
YAML-based function registry for easy extensibility
Function calling interface with 15+ transportation analysis functions
MCP server compatibility for integration with AI assistants (supporting Claude)
RESTful API endpoints for direct access
Dynamic endpoint generation based on registry
Comprehensive test suite and validation tools
Connect to Remote MCP Server
This server can be used as a backend for AI code agents like Claude Desktop, allowing them to perform complex transportation analyses and access HCM documentation dynamically.
To enable this functionality, add the server to your AI assistant's configuration as an MCP server.
For Claude Desktop Users
From user setting, you can find Connectors tab and click Add custom connector.
Then add https://api.hcm-calculator.com/mcp to you Claude configuration.
For GitHub Copilot on VSCode Users
You can also use this server with GitHub Copilot by configuring it as a custom MCP server.
To do this, type Ctrl+p and select MCP: Open User Configuration and modify the following to your mcp.json:
Connect to Local MCP Server
You can also run this server locally for development or testing purposes.
Then running the server.
For Claude Desktop Users
Open Claude Desktop and add the server as a custom MCP server with the URL http://localhost:8000/mcp.
Add to your Claude Desktop configuration (claude_desktop_config.json):
Note: Seems like this json settings are not working these days (https://github.com/anthropics/claude-code/issues/4188), and it did not work in my desktop environment, either.
For GitHub Copilot on VSCode Users
Same thing as above, you can use this server with GitHub Copilot by configuring it as a custom MCP server.
To do this, type Ctrl+p and select MCP: Open User Configuration and modify the following to your mcp.json:
Then you can use the function calling interface directly in your code editor.
Project Structure
Configuration
Environment Variables
Create a .env file based on .env.example. Copy and paste the following content, or cp .env.example .env:
Function Registry
Functions are defined in functions_registry.yaml:
API Usage
Complete Highway Analysis
Function Calling Interface
List Available Functions
Query HCM Documentation
Available Functions
Chapter 15 Functions
chapter15_identify_vertical_class- Step 1: Identify vertical alignment class rangechapter15_determine_demand_flow- Step 2: Calculate demand flow rates and capacitychapter15_determine_vertical_alignment- Step 3: Determine vertical alignment classificationchapter15_determine_free_flow_speed- Step 4: Calculate free flow speedchapter15_estimate_average_speed- Step 5: Estimate average travel speedchapter15_estimate_percent_followers- Step 6: Estimate percentage of following vehicleschapter15_determine_follower_density_pl- Step 8a: Follower density for passing laneschapter15_determine_follower_density_pc_pz- Step 8b: Follower density for PC/PZ segmentschapter15_determine_segment_los- Step 9: Calculate segment Level of Servicechapter15_determine_facility_los- Step 10: Calculate facility Level of Servicechapter15_complete_analysis- Complete HCM Chapter 15 procedure
Research Functions
query_hcm- Query HCM documentation database
API Endpoints
Hit the API endpoints directory to perform analyses or query HCM documentation.
Note: /docs for detail api endpoints description is under construction and will be available soon.
Core Endpoints
POST /tools/call- Execute any registered functionPOST /tools/list- List available functions with filteringGET /mcp/discovery- MCP capability discovery
Chapter 15 Analysis
POST /analysis/chapter15/complete- Complete HCM analysisPOST /analysis/chapter15/segment- Single segment analysis
Research
POST /tools/query-hcm- Query HCM databasePOST /research/search_hcm_by_chapter- Search HCM content by specific chapterGET /research/get_hcm_section- Get specific HCM section contentPOST /research/summarize_hcm_content- Summarize HCM content for a topic
Utility
GET /health- Health checkGET /registry/info- Registry informationPOST /registry/reload- Reload function registry
Data Models
Highway Segment
Highway Facility
Adding New HCM Chapters
1. Create Function Module
Create functions/chapter16.py:
2. Update Registry
Add to functions_registry.yaml:
3. Restart Server
The registry will automatically load the new functions.
Development
Running Tests
Note: Test will be added soon.
Validating Registry
Note: Not used yet.
Setting Up Development Database
Customization
Custom Analysis Models
Extend models in core/models.py:
Custom Functions
Implement function in appropriate module
Add to
functions_registry.yamlRestart server or call
/registry/reload
Support
This project is beta version and mainly for research purpose for now. It is widely appreciated for any contributions or feedback!
For issues and questions:
Open an issue on GitHub
Check the API documentation at
/docsReview function registry at
/registry/infoValidate setup with utility scripts