Prime MCP Server
Provides tools for interacting with the Prime Ecosystem API for insurance and construction job management, including job, financial, contact, allocation, estimate, schedule, invoice, work order, attachment, notification, and reference data operations.
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@Prime MCP Server compare estimates, work orders, and invoices for job 12345"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
Prime MCP Server
MCP (Model Context Protocol) server for the Prime Ecosystem API, providing AI assistants with access to insurance and construction job management functionality.
Features
40+ tools covering all major Prime API functionality
Financial analysis tools for comparing estimates, work orders, and invoices
Smart search by customer name or address with automatic pagination
Rate limiting respects Prime's limits (60 req/min, 5000/day, 5 concurrent)
Full JSON:API support with proper request/response handling
Zod validation for all tool inputs
TypeScript with full type safety
Related MCP server: mcp-servicefusion
Available Tools
Job Management
prime_search_jobs- Search and filter jobs with paginationprime_search_jobs_by_address- Search jobs by street, suburb, state, or postcodeprime_search_jobs_by_customer- Search jobs by customer nameprime_get_job- Get detailed job information by IDprime_create_job- Create a new jobprime_update_job- Update job detailsprime_update_job_status- Change job status
Financial Analysis
prime_get_job_allocation_summary- Work order totals grouped by tradeprime_get_job_trade_comparison- Compare work orders vs authorized estimates by tradeprime_get_job_financial_summary- Full comparison: Estimates vs Work Orders vs AP Invoices with alerts
Contact Management
prime_search_contacts- Search contacts by name, email, phoneprime_get_contact- Get contact detailsprime_create_contact- Create new contact (individual or organization)prime_update_contact- Update contact information
Allocation Management
prime_list_allocations- List work allocationsprime_get_allocation- Get allocation detailsprime_create_allocation- Create work allocationprime_update_allocation- Update allocation
Estimate Management
prime_list_estimates- List estimates (locked or unlocked)prime_get_estimate- Get estimate with line itemsprime_create_estimate- Create new estimateprime_add_estimate_item- Add line item to estimateprime_update_estimate_item- Update estimate line itemprime_delete_estimate_item- Delete estimate line item
Schedule Management
prime_get_job_schedule- Get schedule for a jobprime_list_schedule_items- List schedule itemsprime_create_schedule_item- Create schedule itemprime_update_schedule_item- Update schedule itemprime_delete_schedule_item- Delete schedule item
Invoice Management
prime_list_ap_invoices- List accounts payable invoicesprime_get_ap_invoice- Get AP invoice detailsprime_create_ap_invoice- Create AP invoiceprime_update_ap_invoice- Update AP invoiceprime_update_ap_invoice_status- Update AP invoice statusprime_list_ar_invoices- List accounts receivable invoicesprime_get_ar_invoice- Get AR invoice detailsprime_update_ar_invoice_status- Update AR invoice status
Work Order Management
prime_list_work_orders- List work ordersprime_get_work_order- Get work order detailsprime_update_work_order- Update work order
Attachment Management
prime_list_attachments- List job attachmentsprime_get_attachment- Get attachment detailsprime_create_attachment- Create attachment recordprime_update_attachment- Update attachment metadata
Notification Management
prime_list_notifications- List sent notificationsprime_get_notification- Get notification detailsprime_create_notification- Send notificationprime_list_notification_templates- List available templatesprime_get_notification_template- Get template details
Reference Data
prime_list_job_statuses- List job statusesprime_get_job_status- Get status detailsprime_list_perils- List peril types (Fire, Flood, Storm, etc.)prime_list_trades- List trade types (Plumbing, Electrical, etc.)prime_list_divisions- List company divisionsprime_list_users- List system usersprime_get_user- Get user detailsprime_list_workflows- List workflowsprime_list_job_types- List job typesprime_list_allocation_statuses- List allocation statusesprime_list_filter_tags- List filter tagsprime_rate_limit_status- Check current rate limit status
Installation
# Clone the repository
git clone https://github.com/MikahDev/prime-mcp-server.git
cd prime-mcp-server
# Install dependencies
npm install
# Build
npm run buildConfiguration
Environment Variables
# Required: OAuth2 credentials
export PRIME_CLIENT_ID=your-client-id
export PRIME_CLIENT_SECRET=your-client-secret
export PRIME_USERNAME=your-username
export PRIME_PASSWORD=your-password
# Optional: Override API URLs (defaults to production)
export PRIME_API_URL=https://www.primeeco.tech/api.prime/v2
export PRIME_OAUTH_URL=https://www.primeeco.tech/api.prime/v2/oauth/token
# Optional: Log level (debug, info, warn, error)
export LOG_LEVEL=infoGetting OAuth2 Credentials
Contact your Prime administrator to obtain:
Client ID - Your application's client identifier
Client Secret - Your application's secret key
Username - Your Prime user account
Password - Your Prime password
The server uses OAuth2 password grant flow and automatically handles token refresh.
Usage
Quick Start with npx
# Run directly without installing
npx prime-mcp-serverWith Claude Desktop
Add to your Claude Desktop configuration (~/Library/Application Support/Claude/claude_desktop_config.json on macOS):
{
"mcpServers": {
"prime": {
"command": "npx",
"args": ["prime-mcp-server"],
"env": {
"PRIME_CLIENT_ID": "your-client-id",
"PRIME_CLIENT_SECRET": "your-client-secret",
"PRIME_USERNAME": "your-username",
"PRIME_PASSWORD": "your-password"
}
}
}
}Or with a local installation:
{
"mcpServers": {
"prime": {
"command": "node",
"args": ["/path/to/prime-mcp-server/dist/index.js"],
"env": {
"PRIME_CLIENT_ID": "your-client-id",
"PRIME_CLIENT_SECRET": "your-client-secret",
"PRIME_USERNAME": "your-username",
"PRIME_PASSWORD": "your-password"
}
}
}
}With ChatGPT (HTTP Mode)
The server supports Streamable HTTP transport for ChatGPT integration.
1. Start the HTTP server:
# Set credentials
export PRIME_CLIENT_ID=your-client-id
export PRIME_CLIENT_SECRET=your-client-secret
export PRIME_USERNAME=your-username
export PRIME_PASSWORD=your-password
# Start HTTP server (default port 3000)
npm run start:http
# Or with custom port
PORT=8080 npm run start:http2. Expose to the internet (for testing, use ngrok):
ngrok http 30003. Connect in ChatGPT:
Go to ChatGPT → Settings → Connectors → Create
Enter your public URL (e.g.,
https://abc123.ngrok.io/mcp)The connector will auto-discover available tools
Note: ChatGPT MCP support requires a Pro, Plus, or Business account with Developer Mode enabled (Settings → Connectors → Advanced → Developer mode).
Standalone
# Set credentials
export PRIME_CLIENT_ID=your-client-id
export PRIME_CLIENT_SECRET=your-client-secret
export PRIME_USERNAME=your-username
export PRIME_PASSWORD=your-password
# Run stdio transport (for Claude)
npm start
# Run HTTP transport (for ChatGPT)
npm run start:httpDevelopment
# Run with hot reload
npm run dev
# Run tests
npm test
# Type check
npm run typecheckRate Limits
The Prime API has the following rate limits:
Limit | Value |
Per Minute | 60 requests |
Per Day | 5,000 requests |
Concurrent | 5 requests |
The MCP server automatically handles rate limiting:
Tracks tokens and waits when approaching limits
Updates from response headers for accuracy
Queues concurrent requests exceeding the limit
Provides
prime_rate_limit_statustool to check current status
Error Handling
All tools return consistent error responses:
{
"error": true,
"code": "VALIDATION_ERROR",
"message": "Description of the error",
"details": {
"field": "specific field error"
}
}Error codes:
RATE_LIMITED- Rate limit exceeded (includesretryAfter)UNAUTHORIZED- Invalid or missing API tokenFORBIDDEN- Permission deniedNOT_FOUND- Resource not foundVALIDATION_ERROR- Invalid input parametersSERVER_ERROR- Prime API server errorNETWORK_ERROR- Connection failedINTERNAL_ERROR- Unexpected error
Project Structure
prime-mcp-server/
├── src/
│ ├── index.ts # Entry point
│ ├── server.ts # MCP server setup
│ ├── client/
│ │ ├── prime-client.ts # HTTP client
│ │ ├── rate-limiter.ts # Rate limiting
│ │ └── json-api.ts # JSON:API utilities
│ ├── config/
│ │ └── index.ts # Configuration
│ ├── schemas/ # Zod validation schemas
│ ├── tools/ # MCP tool implementations
│ └── utils/
│ ├── error-handler.ts # Error formatting
│ └── filter-builder.ts # Query filter builder
├── tests/
│ └── unit/ # Unit tests
├── package.json
├── tsconfig.json
└── vitest.config.tsContributing
Fork the repository
Create a feature branch
Make your changes
Run tests:
npm testSubmit a pull request
License
MIT
Available Tools
62 toolsprime_add_estimate_itemC
Add a line item to an estimate. Specify quantity, unit price, description, and optional category.
Inputs: unit_price (required), description (required), estimate_id (required), unit, +7 more.
prime_create_allocationC
Create a new work allocation for a job. Requires job_id, allocation_status_id, allocation_type, allocation_number, and label.
Inputs: label (required), job_id (required), allocation_type (required), allocation_number (required), +8 more.
prime_create_ap_invoiceC
Create an accounts payable invoice for a job from a supplier.
Inputs: total (required), job_id (required), subtotal (required), status_id (required), +8 more.
prime_create_attachmentB
Create a new attachment record for a job. Note: File upload may require separate handling.
Inputs: job_id (required), file_name (required), notes, title, +7 more.
prime_create_contactC
Create a new contact (individual or organization). Set is_individual=true for people.
Inputs: is_individual (required), abn, acn, name, +13 more.
prime_create_estimateC
Create a new estimate for a job.
Inputs: job_id (required), name, notes, description.
prime_create_jobB
Create a new job. Requires workflow_id, status_id, and client_id. Optionally creates new customer or links existing.
Inputs: client_id (required), status_id (required), workflow_id (required), notes, +17 more.
prime_create_notificationB
Send a notification for a job. Use a template or provide custom subject/body.
Inputs: job_id (required), body, subject, template_id, +5 more.
prime_create_schedule_itemC
Create a new schedule item (task) with start/end dates and optional assignment.
Inputs: name (required), end_date (required), start_date (required), schedule_id (required), +5 more.
prime_delete_estimate_itemC
Delete an estimate line item.
Inputs: item_id (required).
prime_delete_schedule_itemC
Delete a schedule item.
Inputs: schedule_item_id (required).
prime_get_allocationC
Get detailed allocation information by ID.
Inputs: allocation_id (required), includes.
prime_get_ap_invoiceB
Get accounts payable invoice details by ID.
Inputs: invoice_id (required), includes.
prime_get_ar_invoiceC
Get accounts receivable invoice details by ID.
Inputs: invoice_id (required), includes.
prime_get_attachmentC
Get attachment details by ID.
Inputs: attachment_id (required), includes.
prime_get_contactA
Get detailed contact information by ID. Includes addresses, licences, and relationships.
Inputs: contact_id (required), includes.
prime_get_estimateB
Get estimate details by ID. Set locked=true for snapshot estimates.
Inputs: estimate_id (required), locked, includes.
prime_get_jobB
Get detailed job information by ID. Includes status, division, customer, client, and other relationships.
Inputs: job_id (required), includes.
prime_get_job_allocation_summaryB
Get work order totals grouped by trade for a job. Returns breakdown of allocated amounts per trade category.
Inputs: job_id (required), status_filter, include_cancelled.
prime_get_job_financial_summaryB
Get full financial comparison by trade: Authorized Estimates vs Work Orders vs AP Invoices. Includes alerts for anomalies.
Inputs: job_id (required).
prime_get_job_scheduleC
Get the schedule for a specific job, including all schedule items.
Inputs: job_id (required), includes.
prime_get_job_statusC
Get job status details by ID.
Inputs: status_id (required).
prime_get_job_trade_comparisonC
Compare work order amounts vs authorized estimate amounts by trade. Shows variance between what was estimated and what was allocated.
Inputs: job_id (required), wo_statuses.
prime_get_notificationC
Get notification details by ID.
Inputs: notification_id (required), includes.
prime_get_notification_templateC
Get notification template details by ID.
Inputs: template_id (required).
prime_get_userC
Get user details by ID.
Inputs: user_id (required).
prime_get_work_orderC
Get work order details by ID.
Inputs: work_order_id (required), includes.
prime_list_allocationsB
List work allocations. Filter by job, assigned contact, status, or type. Types include Make Safe, Quote, Restoration, etc.
Inputs: page, job_id, includes, order_by, +8 more.
prime_list_allocation_statusesC
List available allocation statuses.
Inputs: page, per_page.
prime_list_ap_invoicesB
List accounts payable invoices (from suppliers/contractors). Filter by job, supplier, or status.
Inputs: page, job_id, includes, order_by, +6 more.
prime_list_ar_invoicesB
List accounts receivable invoices (to clients/insurers). Filter by job, client, or status.
Inputs: page, job_id, includes, order_by, +6 more.
prime_list_attachmentsC
List attachments for jobs. Filter by job, allocation, or attachment type.
Inputs: page, job_id, includes, order_by, +6 more.
prime_list_divisionsC
List company divisions/branches.
Inputs: page, per_page, is_active, region_id.
prime_list_estimatesB
List estimates for jobs. Set locked=true to get snapshot (read-only) estimates.
Inputs: page, job_id, locked, includes, +5 more.
prime_list_filter_tagsC
List filter tags for categorizing entities.
Inputs: page, per_page, filter_type_id.
prime_list_job_statusesB
List available job statuses. Filter by workflow to get relevant statuses.
Inputs: page, per_page, is_active, workflow_id.
prime_list_job_typesC
List available job types.
Inputs: page, per_page, is_active.
prime_list_notificationsB
List notifications sent for jobs. Filter by job or template.
Inputs: page, job_id, includes, order_by, +5 more.
prime_list_notification_templatesB
List available notification templates. Filter by active status or category.
Inputs: page, category, order_by, per_page, +2 more.
prime_list_perilsB
List peril types (causes of damage like Fire, Flood, Storm, etc.).
Inputs: page, per_page, is_active.
prime_list_schedule_itemsB
List schedule items for a job. Can filter by schedule or date range.
Inputs: job_id (required), page, per_page, schedule_id, +2 more.
prime_list_tradesB
List trade types (Plumbing, Electrical, Carpentry, etc.).
Inputs: page, per_page, is_active.
prime_list_usersB
List system users. Filter by division or active status.
Inputs: page, role, per_page, is_active, +1 more.
prime_list_workflowsC
List available workflows. Workflows define the status flow for jobs.
Inputs: page, per_page, is_active.
prime_list_work_ordersB
List work orders. Filter by job, allocation, assigned contact, or status.
Inputs: page, job_id, status, includes, +7 more.
prime_rate_limit_statusB
Get current rate limit status showing remaining requests per minute and per day.
Inputs: no named parameters.
prime_search_contactsB
Search and filter contacts by name, email, phone, or type. Returns paginated list.
Inputs: name, page, email, phone, +8 more.
prime_search_jobsB
Search and filter jobs with pagination. Returns job list with status, division, customer info.
Inputs: page, query, includes, order_by, +16 more.
prime_search_jobs_by_addressA
Search jobs by address (street, suburb, state, postcode). Paginates through all jobs to find matches since API does not support address filtering directly.
Inputs: state, street, suburb, includes, +2 more.
prime_search_jobs_by_customerA
Search jobs by customer name. First finds matching customers, then retrieves their associated jobs.
Inputs: customer_name (required), includes.
prime_update_allocationC
Update an allocation. Requires allocation_id and version for optimistic locking.
Inputs: version (required), allocation_id (required), label, limit, +7 more.
prime_update_ap_invoiceC
Update an accounts payable invoice. Requires version for optimistic locking.
Inputs: version (required), invoice_id (required), notes, total, +6 more.
prime_update_ap_invoice_statusC
Update the status of an accounts payable invoice.
Inputs: status_id (required), invoice_id (required).
prime_update_ar_invoice_statusC
Update the status of an accounts receivable invoice.
Inputs: status_id (required), invoice_id (required).
prime_update_attachmentC
Update attachment metadata. Requires version for optimistic locking.
Inputs: version (required), attachment_id (required), notes, title, +2 more.
prime_update_contactC
Update contact information. Requires contact_id and version for optimistic locking.
Inputs: version (required), contact_id (required), abn, acn, +14 more.
prime_update_estimateC
Update an estimate. Requires version for optimistic locking.
Inputs: version (required), estimate_id (required), name, notes, +1 more.
prime_update_estimate_itemC
Update an estimate line item. Requires version for optimistic locking.
Inputs: item_id (required), version (required), unit, notes, +8 more.
prime_update_jobC
Update job details. Requires job_id and version for optimistic locking.
Inputs: job_id (required), version (required), notes, address, +13 more.
prime_update_job_statusA
Change the status of a job. Use prime_list_job_statuses to get available status IDs.
Inputs: job_id (required), status_id (required).
prime_update_schedule_itemC
Update a schedule item. Requires version for optimistic locking.
Inputs: version (required), schedule_item_id (required), name, end_date, +5 more.
prime_update_work_orderC
Update a work order. Requires version for optimistic locking.
Inputs: version (required), work_order_id (required), notes, status, +2 more.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 62 tools
Each tool generally targets a distinct resource+action (jobs, contacts, allocations, estimates, AP/AR invoices, schedules, attachments, notifications, reference lists). The main soft spots are the three job financial analytics tools (allocation_summary vs trade_comparison vs financial_summary) and prime_get_job_schedule vs prime_list_schedule_items, which describe overlapping views. The three job search variants are clearly differentiated by description, so misselection risk is low.
Every tool uses the same prime_ prefix with a consistent verb_noun snake_case pattern (list_, get_, create_, update_, delete_, search_, add_). Plural/singular use on nouns is predictable and readable across all 62 tools.
62 tools is heavy even for a broad job-management/ERP domain, and the reference-data listers (trades, divisions, workflows, job types, allocation statuses, perils, filter tags, job statuses) plus multiple near-duplicate search/summary tools push it further. The surface likely could be consolidated into a handful of parameterized list/search tools rather than one per lookup.
Core entities have list+get+create+update coverage, but deletion is only exposed for schedule items and estimate items, and notable gaps exist: no create/delete for work orders, no create for AR invoices, no delete for jobs, contacts, allocations, estimates, attachments or notifications. Agents can work around some of this, but a few workflows (e.g. creating a work order, removing a stale job) dead-end.
Maintenance
Related MCP Connectors
Run a home-service business from your AI: jobs, customers, invoices, estimates, texts.
Job management for service companies: look up, book, tag, assign and note jobs from your AI.
Headless field service software. Your AI agent runs jobs, schedules, quotes, invoices and payments.
Run a service business from your AI agent: CRM, leads, scheduling, invoicing, jobs and more.
Related MCP Servers
- AlicenseNot gradedqualityDmaintenanceConnects AI assistants to JoeAPI construction management system, enabling management of clients, contacts, proposals, estimates, action items, project schedules, and financial data through natural language.2ISC
- FlicenseAqualityDmaintenanceEnables AI-assisted field service management through the Service Fusion API, including job lookup, customer management, dispatch, invoicing, and equipment tracking.161-
- AlicenseAqualityBmaintenanceEnables AI agents to read and create customers, jobs, estimates, invoices, calendar tasks, equipment, technicians, and reference data through the documented Service Fusion REST API, handling OAuth 2.0 and pagination automatically.243 npmMIT
- AlicenseAqualityBmaintenanceEnables AI agents to create estimates, schedule jobs, send invoices, and query open estimates and unpaid invoices from a user's signed-in contractor account using natural language.7Elastic 2.0