Skip to main content
Glama
CourtimusPrime

Invoice-MCP

InvoiceMCP

MCP server giving AI agents read access to subscription/SaaS invoice history, ingested from Gmail and normalized into Postgres (structured data) + MongoDB (PDFs). See SPEC.md for the full design.

Prerequisites

  • Node 22+, pnpm

  • Docker (local Postgres/Mongo/Redis) — or Railway database URLs

  • Google OAuth client (Gmail API enabled, redirect URI http://localhost:8787/oauth/callback)

  • OpenRouter API key

Related MCP server: ntriq-agentshop

Setup

  1. cp .env.example .env and fill in values (scripts/ has key generators noted inline)

  2. docker compose up -d

  3. pnpm install

  4. pnpm migrate up — applies migrations/ to Postgres

  5. pnpm cli seed-org --name "Your Org"

  6. pnpm cli auth — browser OAuth consent, stores encrypted refresh token

  7. pnpm cli check-connections — sanity check all three databases

Running

Command

What

pnpm worker

ingestion worker (BullMQ; registers the monthly sync cron)

pnpm mcp

MCP server on :3000 (Streamable HTTP at POST /mcp, API key auth)

pnpm cli discover

whole-mailbox billing-sender discovery → auto-backfill

pnpm cli backfill --service <id>

full history for one sender

pnpm cli sync

incremental sync now (otherwise monthly via SYNC_CRON)

MCP tools

list_services, list_invoices, get_invoice, get_invoice_pdf, spend_summary — all scoped to DEFAULT_ORG_ID; money in minor units, per-currency aggregation, no FX conversion.

Claude Desktop's connector UI expects OAuth, which this MVP doesn't implement — bridge with mcp-remote in claude_desktop_config.json instead:

{
  "mcpServers": {
    "invoice-mcp": {
      "command": "npx",
      "args": [
        "-y", "mcp-remote", "https://<host>/mcp",
        "--header", "Authorization: Bearer <MCP_API_KEY>"
      ]
    }
  }
}

Development

  • pnpm test / pnpm typecheck / pnpm lint

  • pnpm codegen — regenerate src/db/types.ts after schema changes

  • tsx scripts/smoke-extract.ts [pdf] — live LLM extraction smoke test

  • tsx scripts/make-fixture-pdf.ts — regenerate the multi-page fixture PDF

Deploy (Railway)

One repo, two services:

  • worker — start pnpm start:worker

  • mcp — start pnpm start:mcp (health check /healthz)

Both build with pnpm install && pnpm build. Run pnpm migrate up as the worker's pre-deploy command. Set env vars per .env.example (Railway injects database URLs for linked Postgres/Mongo/Redis services).

F
license - not found
-
quality - not tested
B
maintenance

Maintenance

Maintainers
Response time
Release cycle
Releases (12mo)
Commit activity

Resources

Unclaimed servers have limited discoverability.

Looking for Admin?

If you are the server author, to access and configure the admin panel.

Related MCP Servers

  • A
    license
    -
    quality
    -
    maintenance
    An MCP server that enables AI agents to interact with QuickBooks Online accounts to manage invoices, customers, payments, and financial reports. It provides 20 tools to automate accounting workflows and retrieve financial data through natural language interfaces.
    Last updated
  • A
    license
    A
    quality
    C
    maintenance
    MCP server for creating and fiscalizing invoices via solo.com.hr API. Enables AI agents to generate invoices, retrieve invoice details, list invoices, and check next invoice number.
    Last updated
    4
    MIT

View all related MCP servers

Related MCP Connectors

View all MCP Connectors

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/CourtimusPrime/Invoice-MCP'

If you have feedback or need assistance with the MCP directory API, please join our Discord server