Skip to navigation

Connect a client

Add an OCPPLab MCP server to Claude Code, Codex, Cursor, VS Code, Windsurf, Claude Desktop, claude.ai, ChatGPT or your own code.

Sign in with your browser

Clients that support MCP OAuth only need the URL. Your browser opens on OCPPLab: sign in, choose the organization the agent may use, and select Allow. No token to copy, and the client refreshes its access on its own.

claude mcp add --transport http ocpplab https://api.ocpplab.io/mcp

This works the same way in Cursor, VS Code, claude.ai connectors and ChatGPT: add https://api.ocpplab.io/mcp with no credentials.

  • Reconnecting the same app skips the consent screen and keeps the organization you chose.
  • Disconnect an app in Studio under Settings → Connected apps. It loses access within an hour.

Use an SDK token

For CI, scripts and headless agents, where no browser can open, send an SDK token as a header. The examples use the cpo server; swap the name and URL for any other domain.

claude mcp add --transport http ocpplab-cpo https://api.ocpplab.io/mcp/cpo \
--header 'Authorization: Bearer ${OCPPLAB_TOKEN}'

Add --scope project to share it through .mcp.json. Claude Code reads ${OCPPLAB_TOKEN} from each developer’s environment, so the file holds no secret:

.mcp.json
{
"mcpServers": {
"ocpplab-cpo": {
"type": "http",
"url": "https://api.ocpplab.io/mcp/cpo",
"headers": { "Authorization": "Bearer ${OCPPLAB_TOKEN}" }
}
}
}

Check it with claude mcp list. Tools appear as mcp__ocpplab-cpo__cpo_charge_points_list.

Test the connection

curl -sS -X POST https://api.ocpplab.io/mcp/cpo \
-H "Authorization: Bearer $OCPPLAB_TOKEN" \
-H "Content-Type: application/json" \
-H "Accept: application/json, text/event-stream" \
-d '{"jsonrpc":"2.0","id":1,"method":"initialize","params":{"protocolVersion":"2025-06-18","capabilities":{},"clientInfo":{"name":"curl","version":"0"}}}'

A working setup answers with "name": "ocpplab-cpo" in serverInfo. To browse tools interactively, run npx @modelcontextprotocol/inspector, choose Streamable HTTP, and enter the URL.

Troubleshooting

SymptomFix
401, “failed to connect”, or an unexpected sign-in promptThe token is missing or deleted, or OCPPLAB_TOKEN is not exported in the shell that started the client.
”This app has no OCPPLab organization access”You left the organization you chose. Disconnect the app in Settings → Connected apps and connect again.
The client keeps asking you to sign inIts access was revoked or expired. Run /mcp in Claude Code and sign in again.
403 admin role requiredThe tool needs an organization admin.
404 for an id you know existsThe id belongs to another organization.
429 rate limit exceededOver 120 calls per minute for your user in this organization. Wait for Retry-After seconds.
The agent picks the wrong toolConnect fewer servers: only the domains the task needs.