Quick setup guide
Integrate smart, EV-specific routing into products built for electric vehicle drivers using the Chargetrip API. This API provide developers with access to the same powerful EV routing engine that is already used and trusted by vehicle manufacturers and e-mobility services around the world.
Integration
The API can be integrated in two ways. Through the GraphQL interface or
by using the MCP server. In both cases a free Chargetrip account and a
x-client-id plus x-app-id are required.
GraphQL Integration
Integration by using GraphQL can be done by using the following base URL
alongside an x-client-id and x-app-id.
API Reference / Integration / Base URL
- 01
https://api.chargetrip.io/graphql
This base url can be used to execute all queries and mutations listed within the API reference. Subscriptions can be implemented by using the graphql-ws or graphql-transport-ws protocol. It is recommended to use the newer graphql-transport-ws protocol. Learn how to use websockets in detail over here.
The graphql-ws protocol uses the following url:
API Reference / Subscriptions / Graphql-WS
- 01
wss://api.chargetrip.io/graphql
The graphql-transport-ws uses:
API Reference / Subscriptions / graphql-transport-ws
- 01
wss://api.chargetrip.io/subscription
MCP Server
Integration of the Chargetrip API through a MCP server can be realised in two ways;
- Quick setup through
npm - Local deployment
Quick setup through npm
To use the Chargetrip MCP in your application you must configure your application to connect to the Chargetrip MCP server.
This can usually be done by referencing the NPM package via npm and setting your x-client-id and x-app-id as environment variables.
Github Copilot users can configure their MCP servers by adding an mcp.json in the .vscode directory with a servers entry.
API Reference / MCP / Copilot
- 01
- 02
- 03
- 04
- 05
- 06
- 07
- 08
- 09
- 10
- 11
- 12
- 13
- 14
{ "servers": { "chargetrip-mcp": { "type": "stdio", "command": "npx", "args": ["@chargetrip/mcp"], "env": { "CLIENT_ID": "___YOUR CLIENT ID HERE___", "APP_ID": "___YOUR APP ID HERE___" } } }, "inputs": []}
Local deployment
To use the MCP server locally with Node.js the following steps need to be taken;
- Clone the repository
- Run
npm install - Run
npm run build
This will result in a index.cjs in the dist directory. Point any application to this
file to start using the MCP server.
Further instructions
To learn more about the MCP server, check out the repository.
Who is this API for?
All vehicle manufacturers, charge point operators, utility providers, and fleet operators, need EV-specific routing to remove adoption barriers, improve the electric driving and charging experience, and optimize their operation. Integrating the Chargetrip API into an end-user application, in-vehicle product or telematics dashboard will give instant access to intelligent route computations for electric vehicles and electric fleets.