MCP Setup Guide
Connect AI assistants to your Shocking Energy team data using the Model Context Protocol (MCP).
The Model Context Protocol (MCP) lets AI assistants query and manage your team data through a standardised interface of tools, resources, and prompts. This guide covers how to enable MCP and connect popular AI clients.
MCP integration is in beta. We recommend starting with read-only scopes and verifying AI actions before granting write access. Responses and tool behaviour may change between releases.
Prerequisites
Before connecting an AI assistant:
- You must be a team owner to enable MCP
- MCP must be enabled in Settings > MCP
- For clients other than Claude.ai, you need an API key from Settings > Developer > API Keys
Enable MCP
Navigate to Settings > MCP in the Shocking Energy dashboard.
Toggle Enable MCP on. This exposes the MCP endpoint for your team.
Copy the MCP Endpoint URL shown on the page. You will need this to configure your AI client.
Connect your AI assistant
Claude.ai
Claude.ai connects via OAuth — no API key is required.
Open Claude.ai > Settings > Connectors.
Click Add Custom Connector.
Paste the MCP endpoint URL and confirm.
You will be redirected to Shocking Energy to sign in and approve the requested scopes. After approval, Claude.ai has access.
Claude.ai uses OAuth 2.1 with PKCE for secure authentication. Your access token is scoped to the permissions you approve during consent. No API key is needed.
Claude Code (CLI)
Run this command in your terminal:
claude mcp add --transport http shocking-energy YOUR_MCP_ENDPOINT \
--header "Authorization: Bearer YOUR_API_KEY"Replace:
YOUR_MCP_ENDPOINTwith the MCP endpoint URL from Settings > MCPYOUR_API_KEYwith your API key from Settings > Developer > API Keys
Claude Desktop
Add the following to your claude_desktop_config.json:
{
"mcpServers": {
"shocking-energy": {
"command": "npx",
"args": [
"mcp-remote@latest",
"YOUR_MCP_ENDPOINT",
"--header",
"Authorization: Bearer YOUR_API_KEY"
]
}
}
}Config file location:
- macOS:
~/Library/Application Support/Claude/claude_desktop_config.json - Windows:
%APPDATA%\Claude\claude_desktop_config.json
Requires Node.js 18+. If using nvm, replace npx with the full path (e.g. ~/.nvm/versions/node/v22.20.0/bin/npx).
If your MCP endpoint uses http:// (local development), add --allow-http after the endpoint URL.
Cursor / Other MCP clients
Add to your .cursor/mcp.json or the MCP settings in your editor:
{
"mcpServers": {
"shocking-energy": {
"url": "YOUR_MCP_ENDPOINT",
"headers": {
"Authorization": "Bearer YOUR_API_KEY"
}
}
}
}This configuration works with any MCP client that supports HTTP Streamable transport.
Available tools
MCP exposes tools organised by resource. Each tool includes annotations that tell AI clients whether a tool is read-only, writes data, or is destructive.
Jobs
Scope: jobs.read / jobs.write
| Tool | Type | Description |
|---|---|---|
jobs_list | Read | List jobs with filters (status, date range, engineer) |
jobs_get | Read | Get full details of a specific job |
jobs_count | Read | Count jobs by status |
jobs_audits | Read | View audit history for a job |
jobs_create | Write | Create a new job |
jobs_assign_engineer | Write | Assign an engineer to a job |
jobs_start | Write | Start a job |
jobs_complete | Write | Mark a job as completed |
jobs_reschedule | Write | Reschedule a job to a new date |
jobs_delegate | Write | Delegate a job to another team |
jobs_cancel | Destructive | Cancel a job (cannot be undone) |
jobs_abort | Destructive | Abort a job (cannot be undone) |
Flows
Scope: flows.read / flows.write
| Tool | Type | Description |
|---|---|---|
flows_list_groups | Read | List flow groups (paginated, filterable by category, direction, status, date range) |
flows_get_group | Read | Get a flow group with all its flows, responses, and rendered file content |
flows_list_by_group | Read | List flows in a group with full context data, error info, and generatedContent (the actual SIP/RGMA file text) |
flows_get | Read | Get a single flow with status and responses |
flows_stats | Read | Aggregate stats for a date window: counts by status, error type, category, scenario, plus top failing flow types. Excludes ARCHIVED rows. |
flows_diagnose | Read | Classify a flow's failure (e.g. missing-rgma-rooting) and recommend a remediation action (regenerate, resend, fix-supplier, manual) |
flows_render_image | Read | Render a flow's text content (SIP / CSV / ONAGE) as a PNG card. Returns a 7-day signed URL. Cached by content hash. |
flows_regenerate | Write | Regenerate a failed flow with optional updated context |
flows_resend | Write | Resend a previously sent flow |
flows_fix | Destructive | Two-phase fix (regenerate or resend, picked from status). Server-enforced: dry-run issues a confirmToken; apply requires it. See Two-phase confirm flow below. |
Metrics
Scope: metrics.read
| Tool | Type | Description |
|---|---|---|
metrics_jobs | Read | Job completion metrics over time |
metrics_jobs_by_type | Read | Job metrics grouped by job type |
metrics_logs_by_type | Read | Log metrics grouped by type |
metrics_flows_by_time | Read | Flow metrics over time |
Search
Scope: search.read
| Tool | Type | Description |
|---|---|---|
search_global | Read | Semantic search across all team data |
Team
Scope: team.read
| Tool | Type | Description |
|---|---|---|
team_info | Read | Team profile and configuration |
team_members | Read | List team members |
team_job_types | Read | Available job types |
team_job_type_detail | Read | Full details of a job type |
team_suppliers | Read | Available suppliers |
Assets
Scope: assets.read / assets.write
| Tool | Type | Description |
|---|---|---|
assets_list | Read | List assets with filters |
assets_get | Read | Get asset by UUID/reference |
assets_history_list | Read | List asset history events |
asset_types_list | Read | List asset types |
assets_create | Write | Create new asset |
assets_update | Write | Update asset fields |
assets_archive | Destructive | Archive an asset |
assets_restore | Write | Restore asset from history |
asset_types_create | Write | Create asset type |
asset_type_versions_publish | Write | Publish asset type version |
Projects
Scope: projects.read / projects.write
| Tool | Type | Description |
|---|---|---|
projects_list | Read | List projects |
projects_get | Read | Get project by UUID/document reference |
projects_revisions_list | Read | List project revisions |
project_templates_list | Read | List project templates |
clients_list | Read | List clients |
sites_list | Read | List sites |
projects_create | Write | Create project |
projects_revisions_create | Write | Create revision from current |
projects_jobs_add | Write | Link job to project |
projects_assets_add | Write | Link asset to project |
projects_invoices_add | Write | Link invoice to project |
projects_export | Write | Trigger PDF/DOCX export |
project_templates_create | Write | Create project template |
clients_create | Write | Create client |
sites_create | Write | Create site |
Invoices
Scope: invoices.read / invoices.write
| Tool | Type | Description |
|---|---|---|
invoices_list | Read | List invoices |
invoices_get | Read | Get invoice by UUID/number |
invoices_summary | Read | Invoice totals/counts summary |
invoicing_profile_get | Read | Get team invoicing profile |
invoicing_contracts_list | Read | List contracts |
invoicing_rates_list | Read | List rates |
invoices_draft_upsert | Write | Create/update draft invoice |
invoices_finalize | Write | Finalize and optionally send |
invoices_approve | Write | Approve invoice |
invoices_cancel | Destructive | Cancel invoice |
invoices_delete | Destructive | Delete draft/cancelled invoice |
invoicing_profile_upsert | Write | Upsert company/bank profile |
invoicing_contracts_create | Write | Create contract |
invoicing_rates_create | Write | Create rate |
invoice_template_upsert | Write | Upsert invoice template |
Tool annotations
Every tool includes annotations that help AI clients assess safety:
| Annotation | Meaning |
|---|---|
| Read | Read-only, safe to call freely. Will not modify any data. |
| Write | Creates or modifies data. AI clients should confirm before calling. |
| Destructive | Cancels, aborts, or supersedes an operation. Cannot be undone. AI clients should always confirm. |
AI clients like Claude use these annotations to decide whether to ask for confirmation before calling a tool. Read-only tools can be called freely, while write and destructive tools prompt for approval.
Two-phase confirm flow
Some destructive tools — currently flows_fix — use a server-enforced two-phase confirm. This protects against prompt-injection or tool-misuse paths where the AI is tricked into mutating data without operator review.
How it works
Plan: call the tool with dryRun: true (the default). The server returns:
- The diagnosis and the planned action (
regenerate/resend) - A short-lived
confirmToken(5-minute TTL) - The flow's current status, snapshotted at planning time
Operator review: the AI shows the planned action to the user (in the dashboard chat this is a flow-fix-result widget with a "Confirm fix" button).
Apply: call the tool again with dryRun: false and confirmToken: '<token>'. The server:
- Atomically consumes the token (it is single-use)
- Verifies the team, caller, and flow ID match the snapshot
- Verifies the flow's status hasn't changed since planning (status drift)
- Applies the snapshotted action with the snapshotted dataPatch (not what the apply call passes)
What gets refused
| Scenario | Server response |
|---|---|
Apply called without confirmToken | action: "skipped", asks for the token |
| Token unknown / expired / already consumed | action: "skipped", asks for a fresh dry-run |
| Token belongs to a different team / caller / flow | action: "skipped", refuses |
| Flow status drifted since planning (e.g. another operator fixed it) | action: "skipped", asks for a fresh plan against current state |
The dashboard chat widget threads the confirmToken through automatically — the operator just clicks a button. AI clients calling MCP directly need to plumb the token themselves.
Caller identity
flows_fix records the actor for audit:
- JWT / OAuth callers — the action is always attributed to the authenticated caller. The
userIdargument is ignored on this path (prevents actor spoofing). - API-key callers — must pass
userIdexplicitly (no auth user available on API-key calls). The user is resolved by name, email, or ID.
Resources
MCP resources provide static team data through the resources/read protocol method. Resources are cheaper than tool calls for data that rarely changes.
All resources require the team.read scope.
| Resource | URI | Description |
|---|---|---|
| Team Info | shocking-energy://team/info | Team profile, plan, timezone, and configuration |
| Team Members | shocking-energy://team/members | All members with name, email, role, and avatar |
| Job Types | shocking-energy://team/job-types | Available job types with current version info |
| Suppliers | shocking-energy://team/suppliers | Available suppliers with MPID codes |
Prompts
MCP prompts are pre-built analysis templates available via the prompts/get protocol method. They guide AI assistants through multi-step analysis workflows.
| Prompt | Description |
|---|---|
job_health_check | Analyse job completion, abort, and cancellation rates. Identifies SLA risks and trends. |
flow_analysis | Analyse data flow success and failure rates. Identifies stuck flows and recurring errors. |
engineer_performance | Analyse workload distribution across engineers: job counts, completion times, and balance. |
daily_operations_summary | End-of-day overview: jobs completed, flows processed, open issues, and next-day outlook. |
Using prompts
Ask your AI assistant to use a prompt by name:
"Run the job health check for the last 7 days"
"Give me a daily operations summary for today"
The AI assistant will fetch the prompt template from the MCP server and use it to structure its analysis.
Security best practices
Treat API keys like passwords. Never commit them to version control or share them in plain text.
- Start with read-only access — create API keys with
apis.readscope first, then add write scopes only when needed - Scope by domain — use
assets.*,projects.*, andinvoices.*scopes for least-privilege integrations - Use dedicated keys per integration — create a separate API key for each AI client so each can be revoked independently
- Review tool calls — destructive tools (cancel, abort) require write scope and AI clients will ask for confirmation
- Rotate keys regularly — revoke and recreate API keys periodically
- Use OAuth for third-party access — OAuth tokens are time-limited and can be revoked by the user at any time