sp13ceg/distance-calculator-mcp
If you are the rightful owner of distance-calculator-mcp 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.
The Distance Calculator MCP server calculates the distance between two locations using the Google Distance Matrix API.
Distance Calculator MCP server
This project calculates the distance between two locations using the Google Distance Matrix API.
Setup
-
Install the dependencies:
pip install -r requirements.txt -
Create a
config.inifile in the root of the project with the following content:[google] api_key = YOUR_API_KEYReplace
YOUR_API_KEYwith your actual Google Distance Matrix API key.
Running the Application
-
Start the server:
uvicorn main:app --reload -
The API will be available at
http://127.0.0.1:8000.
API Usage
Send a POST request to /distance with a JSON payload like this:
{
"origin": {
"location": "90210"
},
"destination": {
"location": "New York, NY"
}
}
Running the MCP Server
-
Make sure you have configured your API key in
config.inias described in the "Setup" section. -
Start the MCP server:
python mcp_server.py -
The MCP server will be available at
http://127.0.0.1:8001.
Example with gemini CLI
