Openchargemap Mcp Server

io.github.cyanheads由 GitHub 帳號 cyanheads 發布v0.2.0更新於 Oct 26, 2026

Find EV charging stations, detail, and reliability check-ins via the global Open Charge Map.

已驗證Streamable HTTP可網頁執行位置與生活資料與分析

概覽

AI 產生的概覽

在 Open Charge Map 全球登錄庫中尋找電動車充電站,回傳站點詳細資料,並讀取社群可靠性打卡紀錄。

可以做什麼
  • 依座標點或邊界框尋找充電站,可依連接器、功率、營運商、使用類型、狀態與充電樁數量篩選
  • 依 OCM 編號取得單一站點的完整紀錄:連接器、營運商、使用與存取規則、費用、媒體與最後查核日期
  • 把連接器、營運商、使用類型、狀態與國家名稱解析成搜尋所需的整數篩選 ID,資料來自內建離線快照
  • 讀取某站點的社群打卡與故障回報,含評分、日期與記錄的結果
  • 以資源 URI 形式取得站點紀錄,並附上留言
適用情境
適合需要回答某地區電動車充電選項、比較連接器或營運商網路,或依據查核日期與駕駛打卡判斷充電樁是否可用的情境。此伺服器以座標為核心,需搭配地理編碼伺服器把地名轉成座標。
執行需求
可作為公開託管的 Streamable HTTP 端點使用,也可透過 npx、bunx 或 Docker 在本機執行,需要 Node.js v24+ 或 Bun v1.4+。自行架設必須提供免費的 Open Charge Map API 金鑰,以環境變數 OPENCHARGEMAP_API_KEY 傳入並以 X-API-Key 標頭送出,未設定時啟動即失敗。需要連線至 Open Charge Map API 的網路。
安裝前請注意
API 金鑰屬於憑證,經環境變數傳遞,請勿寫入共用設定。站點狀態由營運商回報,可能過時,應搭配查核日期與留言交叉確認。站點資料署名 Open Charge Map 貢獻者,各資料提供者的授權條款不同。選用的失敗負載日誌會記錄工具參數,自由文字中的金鑰不會被遮蔽。

安裝

在 SourceWeft 中

  1. 開啟 儀表板中的 Openchargemap Mcp Server,將其新增到工作區。
  2. 為需要使用其工具的對話啟用該服務。

Web executable,透過 Streamable HTTP。 遠端服務在工作區中設定後即可從網頁執行環境執行。

交給代理程式安裝

把這段提示詞貼上到 Claude Code、Codex、Cursor 等代理程式,或 SourceWeft 對話中。代理程式會讀取該伺服器的安裝指南,先向你展示發布者、端點和登入方式,經你同意後再把它新增到你的客戶端。金鑰不會寫進任何命令。

閱讀 https://sourceweft.com/mcp/io.github.cyanheads%2Fopenchargemap-mcp-server/install.md,並按其中說明把這個 MCP 伺服器接入我的客戶端。修改任何設定之前,先告訴我它的發布者、端點和登入方式,等我確認。不要把 API 金鑰寫進命令或我會提交的檔案;問我金鑰應從哪裡取得。

檢視代理程式所依據的安裝指南

其他 MCP 客戶端

把它新增到你客戶端的 mcpServers 設定中。

{
  "mcpServers": {
    "openchargemap": {
      "type": "http",
      "url": "https://openchargemap.caseyjhand.com/mcp"
    }
  }
}

README

@cyanheads/openchargemap-mcp-server

Find EV charging stations worldwide by location and connector from the global Open Charge Map registry — full station detail, reference-ID resolution, and community reliability check-ins via MCP. STDIO or Streamable HTTP.

4 Tools • 2 Resources


Overview

EV charging stations worldwide from Open Charge Map. Search by location, connector, and network, pull full station detail, and read community check-ins on whether a charger actually works.

Tools

ToolDescription
openchargemap_find_stationsFind charging stations near a point or within a bounding box, filtered by connector, power, network, usage, status, and charge points. Coordinate-native.
openchargemap_get_stationFull record for one station by numeric OCM ID — every connection, operator, access rules, charge points, cost, media, and a computed reliability note.
openchargemap_lookup_referenceResolve connector/operator/usage/status/country names to the integer filter IDs find_stations needs. Served from a bundled snapshot — offline and instant.
openchargemap_get_station_commentsCommunity check-ins for one station alongside the registry status and last-verified date, so registry-vs-reality mismatch is visible.

Resources

ResourceDescription
openchargemap://station/{id}Full station record (with community comments) by numeric OCM ID — the URI-addressable twin of openchargemap_get_station.
skill://openchargemap-guide/SKILL.mdGuide to recommending compatible, accessible chargers, assessing reliability evidence, and checking search coverage. Also ships with plugin, npm, Docker, and MCPB installs.

All station data is also reachable via the tools; the station corpus (~200k locations, geo-scoped) isn't exposed as a listable resource, and reference data is served by openchargemap_lookup_reference rather than a resource.

Capability reference

openchargemap_find_stations tool

  • Radius search (latitude + longitude + distance, distanceUnit KM or Miles, max 500) or boundingbox — exactly one mode per call; optional countrycode (ISO 3166-1 alpha-2) and filters connectiontypeid, minpowerkw, operatorid, usagetypeid, levelid, statustypeid, minchargepoints (the ID filters take one integer ID or an OR-matched array, resolved via openchargemap_lookup_reference)
  • maxresults caps the page (default 25, max 200) and offset pages through a fixed cached pool of up to 500 candidates per search. A 501st record only detects an upstream remainder: totalCount is exact without that sentinel and a floor when it is present; the notice says which
  • No matches returns a successful empty list with search recovery guidance. Unknown country codes are not applied and are disclosed in the summary and notice. Fails with invalid_location (no search area, half a center, or a coordinate beside a boundingbox), auth_failed, or upstream_unavailable

openchargemap_get_station tool

  • Full record for one station by numeric OCM id — every connection, operator/network, usage and access rules, charge-point count, usage cost, data provider, media, and dateLastVerified; includeComments adds every check-in inline, unpaged (use openchargemap_get_station_comments for a heavily-commented station)
  • reliabilityNote is plain prose computed from observable facts (verification age, registry status, operational flag, fault-vs-positive check-ins), omitted when there is nothing to flag; fails with not_found, auth_failed, or upstream_unavailable

openchargemap_lookup_reference tool

  • category (connectiontypes, operators, usagetypes, statustypes, currenttypes, levels, countries) plus an optional case-insensitive query naming a title, code, or alias ("CCS", "Tesla Supercharger", "FR"); omit query to browse the category (limit max 100, default 25, paged via offset/nextOffset)
  • Returns the matching id(s), the filterParam they feed into openchargemap_find_stations, and source (live or bundled) with a snapshotDate — answered offline from the bundled snapshot unless OPENCHARGEMAP_REFERENCE_REFRESH refreshed it at startup. A miss returns a successful empty list with spelling/browse guidance

openchargemap_get_station_comments tool

  • Check-ins for one station by numeric OCM id, newest first, each with rating, date, and recorded outcome — maxresults caps the page (default 25, max 100), paged via offset/nextOffset; totalComments counts the station's whole set, and reliabilityNote's fault ratio is computed over all of it
  • Returns the registry status, isOperational, and dateLastVerified beside the comments; an empty comments: [] is not an error (no reports is not evidence the charger works); fails with not_found, auth_failed, or upstream_unavailable

openchargemap://station/{id} resource

  • Full record for one station by numeric OCM ID, community comments always included — the URI-addressable twin of openchargemap_get_station, cached for 600 seconds, and not listable
  • Fails with not_found when the ID doesn't resolve to a station

Features

Built on @cyanheads/mcp-ts-core: stdio and Streamable HTTP transports, pluggable auth (none / jwt / oauth), swappable storage (in-memory, filesystem, Supabase, Cloudflare KV/R2/D1), structured logging with optional OpenTelemetry tracing.

Open Charge Map-specific:

  • Type-safe client for the OCM v3 POI API with retry and session-scoped result caching
  • Reference data (connectors, operators, usage/status types, countries) bundled as an offline snapshot — name→ID resolution needs no live /referencedata call, with an optional startup refresh to prevent drift
  • Curated connector aliases (CCS, NACS/Supercharger, J1772, Type 2, CHAdeMO) so the names agents actually use resolve to the right IDs
  • Geocoding intentionally delegated — the server is coordinate-native and composes with any geocoding MCP server (e.g. the openstreetmap server's openstreetmap_search_places) rather than rebuilding place-name lookup
  • Stations are addressed by numeric OCM ID, discovered through openchargemap_find_stations — the OCM API has no UUID lookup

Agent-friendly output:

  • Reliability surfaced as first-class signal — status, statusTypeId, isOperational, and dateLastVerified on every station, plus a plain-prose reliabilityNote derived only from observable facts (no fabricated confidence score)
  • Honest sparsity — heavily-omitted upstream fields are optional with "absence means unknown, not zero/false" descriptions; the server never invents data OCM didn't return
  • Attribution to Open Charge Map contributors and station data providers on every response; per-station provider license terms and open-data flags when supplied

Getting started

Public Hosted Instance

A public instance is available at https://openchargemap.caseyjhand.com/mcp — no installation required. Point any MCP client at it via Streamable HTTP, with this client config:

json
{  "mcpServers": {    "openchargemap-mcp-server": {      "type": "streamable-http",      "url": "https://openchargemap.caseyjhand.com/mcp"    }  }}

Self-Hosted / Local

Add the following to your MCP client configuration file. An Open Charge Map API key is required — see Prerequisites.

json
{  "mcpServers": {    "openchargemap-mcp-server": {      "type": "stdio",      "command": "bunx",      "args": ["@cyanheads/openchargemap-mcp-server@latest"],      "env": {        "MCP_TRANSPORT_TYPE": "stdio",        "MCP_LOG_LEVEL": "info",        "OPENCHARGEMAP_API_KEY": "your-api-key"      }    }  }}

Or with npx (no Bun required):

json
{  "mcpServers": {    "openchargemap-mcp-server": {      "type": "stdio",      "command": "npx",      "args": ["-y", "@cyanheads/openchargemap-mcp-server@latest"],      "env": {        "MCP_TRANSPORT_TYPE": "stdio",        "MCP_LOG_LEVEL": "info",        "OPENCHARGEMAP_API_KEY": "your-api-key"      }    }  }}

Or with Docker:

json
{  "mcpServers": {    "openchargemap-mcp-server": {      "type": "stdio",      "command": "docker",      "args": [        "run", "-i", "--rm",        "-e", "MCP_TRANSPORT_TYPE=stdio",        "-e", "OPENCHARGEMAP_API_KEY=your-api-key",        "ghcr.io/cyanheads/openchargemap-mcp-server:latest"      ]    }  }}

For Streamable HTTP, set the transport and start the server:

sh
MCP_TRANSPORT_TYPE=http MCP_HTTP_PORT=3010 OPENCHARGEMAP_API_KEY=... bun run start:http# Server listens at http://localhost:3010/mcp

Prerequisites

  • Bun v1.4 or higher (or Node.js v24+).
  • An Open Charge Map API key — free instant signup: register an application at openchargemap.org. Sent as the X-API-Key header on every request; the server fails fast at startup if it's unset.

Installation

  1. Clone the repository:
sh
git clone https://github.com/cyanheads/openchargemap-mcp-server.git
  1. Navigate into the directory:
sh
cd openchargemap-mcp-server
  1. Install dependencies:
sh
bun install
  1. Configure environment:
sh
cp .env.example .env# edit .env and set OPENCHARGEMAP_API_KEY

Configuration

All configuration is validated at startup via Zod schemas in src/config/server-config.ts. Key environment variables:

VariableDescriptionDefault
OPENCHARGEMAP_API_KEYRequired. Open Charge Map API key, sent as the X-API-Key header. Free signup at openchargemap.org.—
OPENCHARGEMAP_BASE_URLOCM API base URL. Override for a private mirror or testing.https://api.openchargemap.io/v3
OPENCHARGEMAP_REFERENCE_REFRESHWhen true, refresh reference data from the live /referencedata endpoint at startup, falling back to the bundled snapshot on failure. When false, stay fully offline on the bundled snapshot.false
OPENCHARGEMAP_CLAMP_LIMITSClamp oversized positive integer page sizes to the tool maximum (stations 200, comments/reference 100), with a notice, log and openchargemap.pagination.clamps counter. false restores rejection. Zero, negative and fractional sizes always reject.true
MCP_TRANSPORT_TYPETransport: stdio or http.stdio
MCP_HTTP_PORTPort for the HTTP server.3010
MCP_AUTH_MODEAuth mode: none, jwt, or oauth.none
MCP_LOG_LEVELLog level (RFC 5424).info
LOGS_DIRDirectory for log files (Node.js only).<project-root>/logs
LOG_TOOL_FAILURE_PAYLOADSLog each failed tool call's arguments and result, redacted by key name and capped at LOG_TOOL_FAILURE_PAYLOAD_MAX_BYTES (default 16384). A secret inside a free-form value is not redacted.false
STORAGE_PROVIDER_TYPEStorage backend.in-memory
OTEL_ENABLEDEnable OpenTelemetry instrumentation (spans, metrics, completion logs).false

See .env.example for the full list of optional overrides.

Running the server

Local development

  • Build and run:

    sh
    # One-time buildbun run rebuild
    # Run the built serverbun run start:stdio# orbun run start:http
  • Run checks and tests:

    sh
    bun run devcheck   # Lint, format, typecheck, security, changelog syncbun run test       # Vitest test suitebun run lint:mcp   # Validate MCP definitions against spec

Docker

sh
docker build -t openchargemap-mcp-server .docker run --rm -e OPENCHARGEMAP_API_KEY=your-key -p 3010:3010 openchargemap-mcp-server

The Dockerfile defaults to HTTP transport, stateless session mode, and logs to /var/log/openchargemap-mcp-server. OpenTelemetry peer dependencies are installed by default — build with --build-arg OTEL_ENABLED=false to omit them.

Project structure

DirectoryPurpose
src/index.tscreateApp() entry point — registers tools/resources and inits services.
src/configServer-specific environment variable parsing and validation with Zod.
src/dataBundled Open Charge Map reference snapshot (ocm-reference-data.ts) — the offline source for ID resolution.
src/mcp-server/toolsTool definitions (*.tool.ts) plus the shared station schema and renderers.
src/mcp-server/resourcesResource definitions (*.resource.ts).
src/services/openchargemapOCM POI API client, response normalization, attribution, and the reliability-note helper.
src/services/reference-dataReference-data service — snapshot loading, lookup indices, curated aliases, optional live refresh.
tests/Unit and integration tests mirroring src/.

Development guide

See AGENTS.md (and CLAUDE.md) for development guidelines and architectural rules. The short version:

  • Handlers throw, framework catches — no try/catch in tool logic
  • Use ctx.log for request-scoped logging, ctx.state for tenant-scoped storage
  • Register new tools and resources in the createApp() arrays
  • Wrap external API calls: validate raw → normalize to domain type → return output schema; never fabricate missing fields

Attribution and data license

Charging-station, connector, and operator data is sourced from Open Charge Map, the community-maintained global registry of EV charging locations. License terms vary by data provider. Station records expose dataProviderLicense and isOpenDataLicensed when supplied; an unspecified license is unknown.

Station data © Open Charge Map contributors and the providers named on each station (openchargemap.org). License terms vary by provider.

Every tool response carries this attribution string, and the server restates it in its session-level instructions. Preserve attribution to Open Charge Map, its contributors, and each station's provider, and consult that provider's license terms before reuse. This server's own code is Apache-2.0 (below).

Contributing

Issues are welcome. Run checks and tests before submitting:

sh
bun run devcheckbun run test

License

Apache-2.0 — see LICENSE for details. Open Charge Map data carries its own license; see Attribution and data license.

來源:README.md,提交 063492b

工具

4

openchargemap_find_stations

openchargemap-mcp-server: find stations

Find EV charging stations from the global Open Charge Map registry near a point or within a bounding box. Provide either a center (latitude + longitude + distance) or a boundingbox; optionally scope to a country with countrycode. This tool is coordinate-native and does not geocode place names — resolve a place like "Ballard, Seattle" to coordinates with openstreetmap_search_places first, then pass them here. Filter by connector type, minimum power (kW), operator/network, usage type (public/free/membership), charge level, operational status, and minimum charge points. Filter IDs are integers — resolve a connector or network name to its IDs with openchargemap_lookup_reference and pass every returned ID (e.g. "CCS" -> [32, 33]; Open Charge Map distinguishes CCS Type 1 (32, common in North America) and Type 2 (33, common in Europe); 33 alone can miss Type 1 stations). Each result includes title, address, distance from the search point, connections (type, power, count), operator, access rules, registry operational status, and the last-verified date. Results come back one page at a time: when a page reports truncated, repeat the same search with the reported nextOffset to read the next one.

輸入參數offsetleveliddistancelatitudelongitudemaxresultsminpowerkwoperatoridboundingboxcountrycodeusagetypeiddistanceUnit另有 3 個

openchargemap_get_station

openchargemap-mcp-server: get station

Get the full record for one Open Charge Map station by its numeric OCM ID. Returns every connection (type, level, power, current, quantity, per-connection status), the operator and network, usage and access restrictions (pay-at-location, membership, access key), the number of charge points, general comments, usage cost, the data provider, media, and verification recency. Set includeComments to also return community check-ins inline.

輸入參數id必填includeComments

openchargemap_lookup_reference

openchargemap-mcp-server: lookup reference

Resolve Open Charge Map reference data to the integer IDs that openchargemap_find_stations filters require. Pick a category and pass a name or code to resolve — "CCS" or "Tesla Supercharger" -> a connectiontypeid, "ChargePoint" -> an operatorid, "Public - Pay At Location" -> a usagetypeid, "France" or "FR" -> a country. A connector name can resolve to several regional variants ("CCS" matches CCS Type 2 = 33 and CCS Type 1 = 32, the North American form) — pass every returned ID to find_stations as an array, not just the first. Omit the query to browse the whole category. Large categories come back one page at a time: when a page reports truncated, repeat the call with the reported nextOffset to read the next one.

輸入參數limitqueryoffsetcategory必填

openchargemap_get_station_comments

openchargemap-mcp-server: get station comments

Read community check-ins and comments for one Open Charge Map station — the real-world reliability signal beyond the operator-reported registry status. Returns user comments and fault reports with ratings, dates, and the outcome the driver recorded ("Charged Successfully", "Failed to Charge (Equipment Not Operational)", …), alongside the station's current registry status and last-verified date, surfacing mismatches like "listed operational, but the last few check-ins report a fault." A busy station's check-ins come back one page at a time: when a page reports truncated, repeat the call with the reported nextOffset to read the next one.

輸入參數id必填offsetmaxresults

版本歷史

4
  1. v0.2.0最新Oct 26, 2026
  2. v0.1.10Oct 9, 2026
  3. v0.1.9Sep 21, 2026
  4. v0.1.8Sep 16, 2026

評分

已滿足適用檢查項的 100%

該評分衡量此收錄條目的完整程度,依據註冊中心條目、端點與公開來源計算得出。它不是對伺服器本身的評價,也不表示伺服器安全或目前可用:可連通性是帶日期的檢查結果,評分也不包含安裝量或使用者評價。

  • 近 30 天內可連通必需25 分
  • 已宣告認證方式必需10 分
  • 已列出工具必需15 分
  • 描述必需15 分
  • 圖示10 分
  • 文件15 分
  • 授權條款10 分