ocpi-sdk
OCPI SDK & AI MCP Server Implementation for EV Charging Open Charge Point Interface
claude mcp add --transport stdio andreibesleaga-ocpi-sdk npx -y ocpi-sdk \ --env OCPI_SDK_LOG="log level (e.g., debug, info, warn, error) for MCP server logs" \ --env OCPI_SDK_API_KEY="Your OCPI API key (optional; will be used if the server requires API key)"
How to use
This MCP server is built around the OCPI SDK TypeScript API library and includes an OCPI MCP AI communication server as part of the ocpi-sdk package. It enables automated communication with OCPI endpoints and supports typed request/response handling, error classes, retries, timeouts, and advanced usage features such as raw Response access and custom loggers. Use the included MCP server to handle Open Charge Point Interface (OCPI) protocol messaging in an AI-enabled MCP workflow, taking advantage of the library's documented API surface and robust error handling.
To get started, install the ocpi-sdk package in your environment and run the MCP server via the npm-based command. You can then configure the client with your API key and optional settings like log level, timeouts, and retry behavior. The server exposes OCPI v22 operations (and other versions as supported) through a typed client interface, allowing you to retrieve, post, and manage OCPI resources with strong TypeScript typings. Advanced usage includes accessing raw fetch responses, customizing a logger (e.g., pino, winston), and performing undocumented requests when needed.
How to install
Prerequisites:
- Node.js (recommended LTS, e.g., 18.x or newer) and npm
- Internet access to fetch dependencies
- Install the library:
npm install ocpi-sdk
- (Optional) Verify TypeScript tooling if you plan to use TypeScript typings:
npm install -D typescript @types/node
- Prepare environment variables (example):
- OCPI_SDK_API_KEY: Your API key for authenticating with the OCPI API (optional; depends on your setup)
- OCPI_SDK_LOG: Set desired log level (debug, info, warn, error, off)
- Run the MCP server (via npx as per mcp_config or your preferred start script):
# If using the MCP config approach suggested:
npx -y ocpi-sdk
- Use the library in your application by importing OcpiSDK and creating a client instance with your configuration, then call the OCPI methods exposed by the SDK (e.g., ocpi.v22.retrieve()).
Additional notes
Tips and common issues:
- Ensure Node.js version aligns with the ocpi-sdk peer dependencies; upgrade if you encounter compatibility errors.
- If API key is not required by your environment, omit OCPI_SDK_API_KEY, but be aware some endpoints may require authentication.
- When enabling detailed logging (logLevel: 'debug'), sensitive data in request/response bodies may be visible; redact or disable in production.
- For custom logger integrations, you can pass a logger instance via the OcpiSDK options; the wrapper supports popular libraries like pino, winston, and bunyan.
- If you encounter network-related timeouts, adjust the timeout or maxRetries settings on the client as documented in the library usage examples.
- Undocumented endpoints or parameters can be accessed using client.get/post and by explicitly annotating undocumented params; these are not validated at runtime.
- If your environment requires a specific start command or path, adapt the mcp_config to point to the exact server file or script within the ocpi-sdk package.
Related MCP Servers
mcp-graphql
Model Context Protocol server for GraphQL
mcp-google-map
A powerful Model Context Protocol (MCP) server providing comprehensive Google Maps API integration with LLM processing capabilities.
systemprompt-code-orchestrator
MCP server for orchestrating AI coding agents (Claude Code CLI & Gemini CLI). Features task management, process execution, Git integration, and dynamic resource discovery. Full TypeScript implementation with Docker support and Cloudflare Tunnel integration.
mcp-typescript-sdk
A TypeScript SDK for implementing Model Context Protocol (MCP) over MQTT, supporting both browser and Node.js environments.
pluggedin-app
The Crossroads for AI Data Exchanges. A unified, self-hostable web interface for discovering, configuring, and managing Model Context Protocol (MCP) servers—bringing together AI tools, workspaces, prompts, and logs from multiple MCP sources (Claude, Cursor, etc.) under one roof.
rohlik
MCP server that lets you shop groceries across the Rohlik Group platforms (Rohlik.cz, Knuspr.de, Gurkerl.at, Kifli.hu, Sezamo.ro)