MCP server

Chargeflux exposes a Model Context Protocol server, so an AI agent can create virtual OCPP charge points, drive charging sessions against your CSMS and read back the OCPP message log — without you writing any API glue.

Ask your agent “connect a virtual charger to wss://my-csms/ocpp and run a full charging session” and it will do exactly that, then tell you what the CSMS did at each step.

Try these tasks

Once connected, paste one of these directly into your agent:

  • Connect an OCPP 1.6 charger called CF-MCP-001 to my CSMS, wait for it to be accepted, and explain the BootNotification response.
  • Run a complete charging session, report whether every step passed, and show the important OCPP messages.
  • Diagnose why this station is failing to connect, explain the likely cause, and clean up anything you create.

The guided setup includes copy-ready client configurations and connection activity on the Automation page.

Endpoint

https://www.chargeflux.io/api/mcp

Transport is streamable HTTP. Authenticate with a Pro plan API key created on your Automation page, sent as a bearer token:

Authorization: Bearer cfk_your_api_key

Connect a client

Claude Code

claude mcp add --transport http chargeflux https://www.chargeflux.io/api/mcp \
  --header "Authorization: Bearer cfk_your_api_key"

Claude Desktop, Cursor, and other config-file clients

{
  "mcpServers": {
    "chargeflux": {
      "type": "http",
      "url": "https://www.chargeflux.io/api/mcp",
      "headers": {
        "Authorization": "Bearer cfk_your_api_key"
      }
    }
  }
}

Tools

Stations

ToolWhat it does
list_stationsList your hosted charge points and their live connection state.
get_stationFetch one station, including per-connector status.
get_station_eventsRead the OCPP message log, with a cursor for polling.
create_stationCreate a charge point and connect it to a CSMS.
restart_stationReconnect a stopped station from its stored config.
delete_stationDisconnect and delete a station, freeing its plan slot.
get_plan_usageReport the plan, station limit and current usage.

Runtime control

One tool per action, so an agent picks the right one from its name: plug_in, plug_out, authorize, start_transaction, stop_transaction, send_heartbeat, send_meter_values, set_connector_status, simulate_fault and clear_fault.

Scenarios

ToolWhat it does
run_charging_sessionPlug in, authorize, start, meter, stop and unplug in one call. Returns the full OCPP transcript plus a pass/fail verdict per step.
wait_for_stateBlock until a station reaches a connection state, so the agent does not have to poll.

Protocol knowledge

search_docs, explain_ocpp_message and get_ocpp_spec_links answer OCPP and OCPI questions without touching a station.

Prompts

  • debug-csms-connection — work out why a charge point cannot connect.
  • run-conformance-check — verify a CSMS handles a normal session correctly.
  • explain-session-log — walk through a station's message log in plain language.

Scopes

API keys carry scopes, and each tool requires one:

ScopeGrants
stations:readListing stations, reading state and reading the event log.
stations:writeCreating, restarting and deleting stations, and sending runtime commands.
sessions:runRunning full scenarios such as run_charging_session.

Things to know

  • A station holds a real WebSocket to your CSMS until it is deleted, and counts against your plan limit the whole time. Agents are instructed to clean up, but your dashboard lists everything running so you can stop it yourself.
  • MCP access requires the Pro plan, the same as the REST API. The plan is checked on every request, so a downgrade takes effect immediately.
  • Authentication is an API key today. The server publishes /.well-known/oauth-protected-resource, so clients that support OAuth discovery will pick up a hosted flow when one is added, with no config change.