- How to securely connect Priority ERP to Claude for BI-grade financial analysis and dashboards: REST API vs. SQL vs. MCP, the right architecture, and best practices.
You can build an interactive financial dashboard on top of Priority without an expensive BI tool: a small middleware layer that exposes aggregated data, and Claude builds the interface and analysis on top of it.
The right way to connect Priority to Claude is not to connect them directly, but through a small intermediary layer: a server that talks to Priority (via the API or read-only SQL) and exposes tools to Claude that return aggregated data. This lets Claude generate dynamic profit and loss reports, budget vs. actual comparisons, cash flow statements, and financial KPIs, and even build interactive BI-grade dashboards, without exposing the raw database and without putting sensitive data at risk. Here is how to do it properly.
Update, November 2026: Claude now has a built-in dashboard tool, Claude Data, which connects to data warehouses and connected applications and builds dashboards and data stories inside the conversation. Full details in the guide to Claude Whiteboards, Sheets, and Data.
Three Ways to Connect (and the Difference Between Them)
Priority has several "doors." It is important to understand that they are not competing options but complementary ones:
| Method | Best for | Limitation |
|---|---|---|
| Priority REST API (official) | Respects permissions and business logic, safe for reads and writes | Less efficient for heavy BI aggregations |
| Read-only SQL (Views) | Very fast for BI calculations over large historical data | Bypasses business logic, requires care and strict permissions |
| MCP (Model Context Protocol) | Gives Claude clean "tools" to query | Not a data source on its own, it wraps the two options above |
MCP is not an alternative to the API or SQL, it is the wrapper layer that sits on top of them. You build an MCP server that exposes tools like get_pnl(period) or get_cashflow(from,to), and behind each tool is a REST API call or a SQL query. Claude calls the tool, not the database.
The Right Architecture
Claude / Claude Code
│ calls tools (MCP), never sees credentials
▼
Middleware layer (MCP server)
│ read-only permissions · returns aggregated data · logs · caches
├──► Priority REST API (transactions, "live" data)
└──► SQL Views (read-only) (heavy BI aggregations)
▼
Priority ERP
Why a middleware layer instead of a direct connection? Three reasons: (1) Security, the model never receives the connection credentials; (2) Data boundary, aggregates are returned rather than raw rows, so there is no PII leakage and no flooding the context window; (3) Control, every query passes through a single place that can be logged, rate-limited, and cached.
Which Connection to Use for Each Purpose
- Profit and loss reports, budget vs. actual, KPIs → aggregations over historical data. Prefer read-only SQL Views (fast), wrapped in MCP.
- "Live" data (balances, open documents, statuses) → Priority's REST API, which respects permissions and business logic.
- Interactive drill-down → an MCP tool that accepts a parameter (such as department or month) and returns the next level of detail, all over the same middleware layer.
Security: Best Practices You Cannot Skip
- Minimal permissions and read-only access. A dedicated DB user or API token that can see only what is needed. Never an admin user.
- The model never receives credentials. Connection details live in the middleware layer only (environment variables), not in the prompt and not in any code the model sees.
- Return aggregates, not raw rows. A tool returns "total revenue by month," not 40,000 transaction lines. This protects sensitive data and also saves tokens.
- PII filtering. If vendor or customer names are not needed for the analysis, do not send them.
- Audit logging of every query plus rate limiting. You know exactly what was queried and when.
- Caching for heavy reports, both for performance and to reduce load on Priority.
How to Build the Dashboards in Practice
This is where Claude Code does the heavy lifting. The process:
- Build the middleware layer: a small server (Node or Python) with a few MCP endpoints or tools:
get_pnl,get_budget_vs_actual,get_cashflow,get_kpis,drill_down. - Claude Code builds a dashboard application: for example, a Next.js app with a charting library, pulling from this layer, with filters, drill-down, and KPI cards. A genuine BI experience, without an expensive BI tool license.
- Add scheduling: automatic report refresh, and alerts (email, WhatsApp, Telegram) when a metric goes out of range, exactly as shown in the guide to connecting Claude Code to Telegram.
This approach is essentially the same as what was shown in the appointment scheduling system: a clean middleware layer facing an external system, with Claude building on top of it.
How to Get Started: Step by Step
- A focused pilot: choose one painful report (for example, profit and loss by department), not ten.
- Open read-only access in Priority: a dedicated API token, or a SQL user with access to a single View.
- Build one MCP tool that returns the report as aggregates.
- Claude Code builds a dashboard on top of that tool.
- Measure, secure, expand: add another report, another metric, scheduling.
The Bottom Line
Connecting Priority to Claude is absolutely possible and very worthwhile, but not through a direct connection. A small middleware layer plus MCP over a REST API and read-only SQL Views delivers security, control, and a full BI experience: dynamic reports, budget vs. actual, cash flow, KPIs, and drill-down. Start with one pilot and expand from there.
Want to implement this in your organization? This is exactly the kind of project covered in AI implementation for organizations and AI consulting, and you can also start with a 1-on-1 private lesson where we plan the architecture for your specific system. Get in touch.

