Skip to main content

Digits

Give agents tools to query transactions, financial statements, and ledger data, and update accounting records in Digits through Mastra Connect. Digits serves these tools from a hosted Model Context Protocol (MCP) server. Your application never stores Digits credentials.

Connect
Direct link to Connect

Before you start, complete the Connect setup to install @mastra/connect and configure your platform project.

warning

Digits tools can create, update, and delete records in your general ledger. The example below requires approval for every Digits tool so a person confirms each call before it runs. To let reads run without approval, list only the write tools by key in requireApproval. See MCP providers.

Connect an account
Direct link to Connect an account

Run this command from the directory that contains your .env file:

mastra connect add digits-mcp

The CLI guides you through Digits' authorization and waits until the connection is active.

Add tools to an agent
Direct link to Add tools to an agent

Pass tools() to the agent and select the digits-mcp provider:

src/mastra/agents/digits-mcp-agent.ts
import { Agent } from '@mastra/core/agent'
import { tools } from '@mastra/connect'

export const digitsMcpAgent = new Agent({
id: 'digits-mcp-agent',
name: 'Digits agent',
instructions:
'You help people query transactions, financial statements, and ledger data, and update accounting records in Digits.',
model: 'openai/gpt-6-luna',
tools: tools({ providers: ['digits-mcp'], requireApproval: true }),
})

Mastra discovers Digits' tools from its MCP server when the agent runs. The available tools depend on the server and the connected account, not on your @mastra/connect version. Tool keys start with digits-mcp_.

To see which tools Digits provides, read the Digits MCP documentation. To require approval before a call runs, see MCP providers in the tools() reference.

On this page