Skip to main content

MCP server for Datarails Finance OS integration with Claude

Project description

Datarails Finance OS MCP Server

A Model Context Protocol (MCP) server that connects Claude to Datarails Finance OS for financial data analysis, profiling, and reporting.

Prerequisites

Setup

Step 1: Install

pip install datarails-finance-os-mcp

With report generation (Excel, PowerPoint, PDF):

pip install datarails-finance-os-mcp[reports]

Step 2: Authenticate

datarails-mcp authenticate

This opens your browser where you log in, select your environment, and grant consent. Tokens are stored securely in your system keychain. JWT tokens auto-refresh when expired.

Step 3: Connect to Claude Code

datarails-mcp setup --claude-code

Or manually:

claude mcp add datarails-finance-os -- datarails-mcp serve

Step 4: Restart Claude Code

Close and reopen Claude Code for the MCP server to appear.

Verify

datarails-mcp status

Should show:

✓ Authenticated
• Organization: yourcompany.com
• Environment: https://app.datarails.com
• API URL: https://app.datarails.com/finance-os/api

Claude Desktop (add to claude_desktop_config.json):

{
  "mcpServers": {
    "datarails-finance-os": {
      "command": "datarails-mcp",
      "args": ["serve"]
    }
  }
}

Project-level (.mcp.json):

{
  "mcpServers": {
    "datarails-finance-os": {
      "command": "uvx",
      "args": ["datarails-finance-os-mcp", "serve"]
    }
  }
}

Available MCP Tools

Authentication

Tool Description
authenticate Connect to Datarails via OAuth (opens browser)
disable Disconnect — revoke tokens and clear credentials
auth_status Check current authentication status

Discovery & Profiling

Tool Description
list_finance_tables Discover available tables
get_table_schema Get column names, types, relationships
get_field_distinct_values Unique values for a field
profile_table_summary Row counts, data quality score
profile_numeric_fields Min/max/avg/outliers for numeric fields
profile_categorical_fields Cardinality, frequencies for categorical fields
detect_anomalies Auto-detect data quality issues

Querying & Aggregation

Tool Description
get_records_by_filter Fetch filtered records (max 500 rows)
get_sample_records Random sample for quick inspection
execute_query Custom SQL-like queries (max 1000 rows)
aggregate_table_data Grouped aggregations with no row limit

Reports & Workflows

Tool Description
get_workflow_guide Guided workflows for common analysis tasks
generate_intelligence_workbook FP&A intelligence workbook (Excel)
extract_financials Extract validated financial data to Excel

CLI Commands

datarails-mcp authenticate              # Connect via OAuth (opens browser)
datarails-mcp authenticate --env dev    # Use dev auth server
datarails-mcp authenticate --env test   # Use test auth server
datarails-mcp disable                   # Disconnect and clear tokens
datarails-mcp status                    # Check auth status
datarails-mcp status --json             # JSON output
datarails-mcp serve                     # Start the MCP server (used by Claude)
datarails-mcp setup                     # Auto-configure Claude clients

Configuration

Client Profiles

Client profiles store table IDs, field mappings, and aggregation hints:

config/client-profiles/production.json
config/client-profiles/development.json

These are generated by the plugin's /dr-learn skill and are not committed to git.

Report Scripts

The scripts/ directory contains Python scripts for generating financial reports. These require the reports extra:

pip install datarails-finance-os-mcp[reports]

Reports use the authenticated session — run datarails-mcp authenticate first.

Development

# Clone and install for development
git clone https://github.com/Datarails/dr-datarails-mcp-re.git
cd dr-datarails-mcp-re
pip install -e ".[dev,reports]"

# Run tests
pytest

# Run server locally
datarails-mcp serve

Architecture

datarails-mcp/
├── src/datarails_mcp/     # MCP server source
│   ├── server.py          # MCP tool definitions
│   ├── client.py          # Datarails API client (JWT auto-refresh)
│   ├── oauth.py           # OAuth 2.0 + PKCE authentication flow
│   ├── token_store.py     # Keyring-backed credential storage
│   ├── cli.py             # CLI commands (authenticate, disable, status, serve, setup)
│   ├── constants.py       # Auth server config, timeouts
│   ├── excel_builder.py   # Excel report generation
│   ├── pptx_builder.py    # PowerPoint generation
│   ├── pdf_builder.py     # PDF generation
│   ├── chart_builder.py   # Chart generation
│   └── report_utils.py    # Shared report utilities
├── scripts/               # Standalone report scripts
├── templates/             # Report templates
└── tests/                 # Test suite

Used By

License

MIT

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

datarails_finance_os_mcp-2.0.2.tar.gz (305.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

datarails_finance_os_mcp-2.0.2-py3-none-any.whl (44.7 kB view details)

Uploaded Python 3

File details

Details for the file datarails_finance_os_mcp-2.0.2.tar.gz.

File metadata

  • Download URL: datarails_finance_os_mcp-2.0.2.tar.gz
  • Upload date:
  • Size: 305.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.10.4 {"installer":{"name":"uv","version":"0.10.4","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for datarails_finance_os_mcp-2.0.2.tar.gz
Algorithm Hash digest
SHA256 ba4e96eb5516f3a10312f1d9e09d33036d9d817cc7e0d47cb349598453c691c2
MD5 851c717d80f0bdd220c6bbdfacfba7b5
BLAKE2b-256 576b630338290aa198c5b74416097625c3ba9cd4d0a7aab3c398afebb89873fb

See more details on using hashes here.

File details

Details for the file datarails_finance_os_mcp-2.0.2-py3-none-any.whl.

File metadata

  • Download URL: datarails_finance_os_mcp-2.0.2-py3-none-any.whl
  • Upload date:
  • Size: 44.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.10.4 {"installer":{"name":"uv","version":"0.10.4","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for datarails_finance_os_mcp-2.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 f9510ee7a0c9eccb4bf8dabc514bbbadd27cf76b8db46bed936e764165a36ff1
MD5 a4287b6a2ab7ef433f6addbaed5b7095
BLAKE2b-256 a547771e76e0a6e453c9c414637e1cb2445f9486bdf7c4148090c4c2049e65b8

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page