Setting up the AI analytics MCP server
The MCP server auto-starts with the app and writes configs for Claude, Cursor and VS Code automatically.
Step by Step
- Enable MCP in Settings → AI Analytics.
- Copy the auto-generated config into Claude Desktop / Cursor (or let the wizard do it).
- Restart your AI assistant — 16 read-only tools appear.
- Try: "What were my top 10 selling medicines last month?"
What You Need
- An AI assistant that supports MCP, such as Claude Desktop, Cursor or VS Code.
- PharmaBill running on the same computer (or reachable on your network).
- The Pro, Lifetime, Clinic or Hospital plan.
Why It Is Safe
The MCP server is read-only in five ways: the database opens read-only, only SELECT queries are allowed, write keywords are blocked, no write tools exist, and every query is logged. The AI can analyse your data but never change it, and your database never leaves your computer — only the question and answer pass through the AI provider.
Good First Questions
"How much did I sell today?", "Which medicines made the most profit last month?", "What expires in the next 60 days?"
FAQ
- Do I need to know SQL? No. Ask in plain English.
- Can the AI change prices or stock? No. Access is read-only.