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.1.tar.gz (303.9 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.1-py3-none-any.whl (43.8 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: datarails_finance_os_mcp-2.0.1.tar.gz
  • Upload date:
  • Size: 303.9 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.1.tar.gz
Algorithm Hash digest
SHA256 41ccb472ce97ad3771e7f83097c3587566969d09561605b475c8483ea515bcf2
MD5 6350a97924a9be2b86314bb360c6901a
BLAKE2b-256 7feb807087e9dcb7c33d0e6536d2590bbf5ea8be774edaa9e646c655faa055a4

See more details on using hashes here.

File details

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

File metadata

  • Download URL: datarails_finance_os_mcp-2.0.1-py3-none-any.whl
  • Upload date:
  • Size: 43.8 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.1-py3-none-any.whl
Algorithm Hash digest
SHA256 714102cdbd821da85d979a9a68bf7eadaf1609ccea028ec230c337124e709d53
MD5 23ef6c300e25a5fe4fc45e4edcad2b97
BLAKE2b-256 91320a5b35dc19089a1d2641b35802902f7b6f2477ba520ea86a6992a5b8d7d2

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