MCP 服务器

MainBook Bank Statement Converter

ai.mainbook/bank-statement-converter
数据与分析 金融与投资 公开且可连接 MCP 2025-11-25

此 MCP 可以做什么

Converts PDF bank statements into validated Excel, CSV, or JSON data with balance checks.

convert_bank_statement
Convert bank statement
Convert one PDF bank statement through the complete MainBook workflow: create a job, upload, start, poll, and return structured data. This creates a job and spends page credits; it is not read-only.
可访问外部资源
输入模式
{'type': 'object', 'title': 'convert_bank_statementArguments', 'properties': {'file_url': {'anyOf': [{'type': 'string', 'minLength': 1}, {'type': 'null'}], 'title': 'File Url', 'default': None, 'description': 'Public HTTPS URL of a PDF for remote mode. Redirects and non-public network addresses are rejected. Exactly one source is required.'}, 'file_path': {'anyOf': [{'type': 'string', 'minLength': 1}, {'type': 'null'}], 'title': 'File Path', 'default': None, 'description': 'Path to a PDF on the MCP server machine. This field is only available over stdio and is rejected in HTTP mode; remote clients must use file_url. The path must be inside the allowed folders, which default to Downloads, Desktop, and Documents. Exactly one of file_path and file_url is required.'}, 'output_path': {'anyOf': [{'type': 'string', 'minLength': 1}, {'type': 'null'}], 'title': 'Output Path', 'default': None, 'description': 'Optional absolute result file or existing folder on the MCP server machine. Only available over stdio and only inside the allowed folders. The file extension is corrected to match result_type.'}, 'result_type': {'enum': ['json', 'xlsx', 'csv'], 'type': 'string', 'title': 'Result Type', 'default': 'json', 'description': 'JSON is returned inline. Over stdio, XLSX or CSV is written to an allowed local folder and the full path is returned. HTTP mode returns safe download instructions. Binary bytes never enter model context.'}, 'idempotency_key': {'anyOf': [{'type': 'string', 'maxLength': 255, 'minLength': 1}, {'type': 'null'}], 'title': 'Idempotency Key', 'default': None, 'description': 'Optional value forwarded verbatim in the Idempotency-Key REST header.'}, 'timeout_seconds': {'type': 'integer', 'title': 'Timeout Seconds', 'default': 50, 'maximum': 900, 'minimum': 30, 'description': 'Internal polling budget from 30 to 900 seconds. Timeout leaves the job running and returns its job_id for get_conversion. The default stays under the 60-second request timeout most MCP clients enforce; a client that gives up first discards the job_id and the conversion looks lost.'}}}
输出模式
{'type': 'object', '$defs': {'SavedFile': {'type': 'object', 'title': 'SavedFile', 'required': ['path', 'reason'], 'properties': {'path': {'type': 'string', 'title': 'Path'}, 'reason': {'type': 'string', 'title': 'Reason'}}, 'additionalProperties': False}, 'JobValidation': {'type': 'object', 'title': 'JobValidation', 'required': ['reconcilable', 'passed', 'mismatched_rows'], 'properties': {'passed': {'type': 'boolean', 'title': 'Passed', 'description': "Whether MainBook's applicable statement-math checks passed."}, 'reconcilable': {'anyOf': [{'type': 'boolean'}, {'type': 'null'}], 'title': 'Reconcilable', 'description': 'Whether statement math can be reconciled; null means the document kind has no running-balance reconciliation, such as many credit-card statements.'}, 'mismatched_rows': {'type': 'integer', 'title': 'Mismatched Rows', 'minimum': 0, 'description': 'Number of transaction rows that remain mathematically mismatched.'}}}, 'ConversionData': {'type': 'object', 'title': 'ConversionData', 'required': ['document', 'transactions', 'has_warnings'], 'properties': {'document': {'$ref': '#/$defs/ConversionDocument'}, 'has_warnings': {'type': 'boolean', 'title': 'Has Warnings'}, 'transactions': {'type': 'array', 'items': {'$ref': '#/$defs/ConversionTransaction'}, 'title': 'Transactions'}}, 'description': 'Exact top-level JSON shape produced by the MainBook exporter.'}, 'ConversionDocument': {'type': 'object', 'title': 'ConversionDocument', 'required': ['id', 'display_name', 'bank_name', 'account_holder', 'account_address', 'account_number_masked', 'account_type', 'kind', 'currency', 'period_start', 'period_end', 'billing_cycle_length_days', 'starting_balance_cents', 'ending_balance_cents', 'transactions_count', 'net_credits_cents', 'net_debits_cents', 'credit_limit_cents', 'available_credit_cents', 'previous_balance_cents', 'new_balance_cents', 'payment_due_amount_cents', 'payment_due_date'], 'properties': {'id': {'type': 'string', 'title': 'Id'}, 'kind': {'type': 'string', 'title': 'Kind'}, 'pages': {'anyOf': [{'type': 'integer', 'minimum': 1}, {'type': 'null'}], 'title': 'Pages', 'default': None}, 'currency': {'type': 'string', 'title': 'Currency'}, 'bank_name': {'type': 'string', 'title': 'Bank Name'}, 'period_end': {'type': 'string', 'title': 'Period End'}, 'account_type': {'type': 'string', 'title': 'Account Type'}, 'display_name': {'type': 'string', 'title': 'Display Name'}, 'period_start': {'type': 'string', 'title': 'Period Start'}, 'account_holder': {'type': 'string', 'title': 'Account Holder'}, 'account_address': {'type': 'string', 'title': 'Account Address'}, 'net_debits_cents': {'type': 'integer', 'title': 'Net Debits Cents'}, 'payment_due_date': {'anyOf': [{'type': 'string'}, {'type': 'null'}], 'title': 'Payment Due Date'}, 'net_credits_cents': {'type': 'integer', 'title': 'Net Credits Cents'}, 'new_balance_cents': {'anyOf': [{'type': 'integer'}, {'type': 'null'}], 'title': 'New Balance Cents'}, 'credit_limit_cents': {'anyOf': [{'type': 'integer'}, {'type': 'null'}], 'title': 'Credit Limit Cents'}, 'transactions_count': {'type': 'integer', 'title': 'Transactions Count', 'minimum': 0}, 'ending_balance_cents': {'type': 'integer', 'title': 'Ending Balance Cents'}, 'account_number_masked': {'type': 'string', 'title': 'Account Number Masked'}, 'available_credit_cents': {'anyOf': [{'type': 'integer'}, {'type': 'null'}], 'title': 'Available Credit Cents'}, 'previous_balance_cents': {'anyOf': [{'type': 'integer'}, {'type': 'null'}], 'title': 'Previous Balance Cents'}, 'starting_balance_cents': {'type': 'integer', 'title': 'Starting Balance Cents'}, 'payment_due_amount_cents': {'anyOf': [{'type': 'integer'}, {'type': 'null'}], 'title': 'Payment Due Amount Cents'}, 'billing_cycle_length_days': {'anyOf': [{'type': 'integer'}, {'type': 'null'}], 'title': 'Billing Cycle Length Days'}}, 'description': "Document summary emitted by MainBook's JSON exporter."}, 'DownloadInstruction': {'type': 'object', 'title': 'DownloadInstruction', 'required': ['job_id', 'result_type', 'instruction'], 'properties': {'url': {'anyOf': [{'type': 'string'}, {'type': 'null'}], 'title': 'Url', 'default': None}, 'job_id': {'type': 'string', 'title': 'Job Id'}, 'expires_at': {'anyOf': [{'type': 'string'}, {'type': 'null'}], 'title': 'Expires At', 'default': None}, 'instruction': {'type': 'string', 'title': 'Instruction'}, 'result_type': {'enum': ['xlsx', 'csv'], 'type': 'string', 'title': 'Result Type'}, 'rest_endpoint': {'anyOf': [{'type': 'string'}, {'type': 'null'}], 'title': 'Rest Endpoint', 'default': None}}, 'additionalProperties': False}, 'ConversionTransaction': {'type': 'object', 'title': 'ConversionTransaction', 'required': ['row', 'source_file', 'page', 'line_index', 'date', 'description', 'amount_cents', 'transaction_type', 'balance_after_cents', 'currency', 'validation_status', 'warning_flags'], 'properties': {'row': {'type': 'integer', 'title': 'Row', 'minimum': 1}, 'date': {'type': 'string', 'title': 'Date'}, 'page': {'type': 'integer', 'title': 'Page', 'minimum': 1}, 'currency': {'anyOf': [{'type': 'string'}, {'type': 'null'}], 'title': 'Currency'}, 'cardholder': {'type': 'string', 'title': 'Cardholder', 'default': ''}, 'line_index': {'type': 'integer', 'title': 'Line Index', 'minimum': 0}, 'description': {'type': 'string', 'title': 'Description'}, 'source_file': {'type': 'string', 'title': 'Source File'}, 'amount_cents': {'type': 'integer', 'title': 'Amount Cents'}, 'warning_flags': {'type': 'array', 'items': {'type': 'string'}, 'title': 'Warning Flags'}, 'transaction_type': {'enum': ['credit', 'debit'], 'type': 'string', 'title': 'Transaction Type'}, 'validation_status': {'enum': ['valid', 'system_mismatch', 'user_edited_mismatch', 'user_reviewed', 'user_accepted'], 'type': 'string', 'title': 'Validation Status'}, 'balance_after_cents': {'anyOf': [{'type': 'integer'}, {'type': 'null'}], 'title': 'Balance After Cents'}, 'cardholder_card_masked': {'type': 'string', 'title': 'Cardholder Card Masked', 'default': ''}}, 'description': 'One exported transaction row, with integer-cent monetary fields.'}}, 'title': 'ConversionOutput', 'required': ['job_id', 'state', 'pages', 'validation', 'result_type', 'message'], 'properties': {'data': {'anyOf': [{'$ref': '#/$defs/ConversionData'}, {'type': 'null'}], 'default': None}, 'pages': {'anyOf': [{'type': 'integer'}, {'type': 'null'}], 'title': 'Pages'}, 'state': {'anyOf': [{'enum': ['awaiting_upload', 'queued', 'processing', 'succeeded', 'succeeded_with_warnings', 'insufficient_credits', 'failed', 'expired'], 'type': 'string'}, {'type': 'null'}], 'title': 'State'}, 'job_id': {'type': 'string', 'title': 'Job Id'}, 'message': {'type': 'string', 'title': 'Message'}, 'download': {'anyOf': [{'$ref': '#/$defs/DownloadInstruction'}, {'type': 'null'}], 'default': None}, 'timed_out': {'type': 'boolean', 'title': 'Timed Out', 'default': False}, 'saved_file': {'anyOf': [{'$ref': '#/$defs/SavedFile'}, {'type': 'null'}], 'default': None}, 'validation': {'anyOf': [{'$ref': '#/$defs/JobValidation'}, {'type': 'null'}]}, 'result_type': {'enum': ['json', 'xlsx', 'csv'], 'type': 'string', 'title': 'Result Type'}}, 'description': 'Structured result shared by convert_bank_statement and get_conversion.', 'additionalProperties': False}
get_balance
Get page-credit balance
Return total, reserved, and available MainBook credits. Every value is measured in PDF pages.
只读 可访问外部资源
输入模式
{'type': 'object', 'title': 'get_balanceArguments', 'properties': {}}
输出模式
{'type': 'object', 'title': 'BalanceOutput', 'required': ['balance', 'reserved', 'available', 'explanation'], 'properties': {'units': {'type': 'string', 'const': 'pages', 'title': 'Units', 'default': 'pages'}, 'balance': {'type': 'integer', 'title': 'Balance'}, 'reserved': {'type': 'integer', 'title': 'Reserved', 'minimum': 0}, 'available': {'type': 'integer', 'title': 'Available'}, 'explanation': {'type': 'string', 'title': 'Explanation'}}, 'additionalProperties': False}
get_conversion
Get conversion
Get the current state of one MainBook conversion. When successful, return JSON inline or save XLSX/CSV locally over stdio. HTTP mode returns safe download instructions. Use this after convert_bank_statement times out.
只读 可访问外部资源 幂等
输入模式
{'type': 'object', 'title': 'get_conversionArguments', 'required': ['job_id'], 'properties': {'job_id': {'type': 'string', 'title': 'Job Id', 'minLength': 1, 'description': 'Conversion job UUID returned by MainBook.'}, 'output_path': {'anyOf': [{'type': 'string', 'minLength': 1}, {'type': 'null'}], 'title': 'Output Path', 'default': None, 'description': 'Optional absolute result file or existing folder on the MCP server machine. Only available over stdio and only inside the allowed folders.'}, 'result_type': {'enum': ['json', 'xlsx', 'csv'], 'type': 'string', 'title': 'Result Type', 'default': 'json', 'description': 'Result representation to retrieve after the job succeeds.'}}}
输出模式
{'type': 'object', '$defs': {'SavedFile': {'type': 'object', 'title': 'SavedFile', 'required': ['path', 'reason'], 'properties': {'path': {'type': 'string', 'title': 'Path'}, 'reason': {'type': 'string', 'title': 'Reason'}}, 'additionalProperties': False}, 'JobValidation': {'type': 'object', 'title': 'JobValidation', 'required': ['reconcilable', 'passed', 'mismatched_rows'], 'properties': {'passed': {'type': 'boolean', 'title': 'Passed', 'description': "Whether MainBook's applicable statement-math checks passed."}, 'reconcilable': {'anyOf': [{'type': 'boolean'}, {'type': 'null'}], 'title': 'Reconcilable', 'description': 'Whether statement math can be reconciled; null means the document kind has no running-balance reconciliation, such as many credit-card statements.'}, 'mismatched_rows': {'type': 'integer', 'title': 'Mismatched Rows', 'minimum': 0, 'description': 'Number of transaction rows that remain mathematically mismatched.'}}}, 'ConversionData': {'type': 'object', 'title': 'ConversionData', 'required': ['document', 'transactions', 'has_warnings'], 'properties': {'document': {'$ref': '#/$defs/ConversionDocument'}, 'has_warnings': {'type': 'boolean', 'title': 'Has Warnings'}, 'transactions': {'type': 'array', 'items': {'$ref': '#/$defs/ConversionTransaction'}, 'title': 'Transactions'}}, 'description': 'Exact top-level JSON shape produced by the MainBook exporter.'}, 'ConversionDocument': {'type': 'object', 'title': 'ConversionDocument', 'required': ['id', 'display_name', 'bank_name', 'account_holder', 'account_address', 'account_number_masked', 'account_type', 'kind', 'currency', 'period_start', 'period_end', 'billing_cycle_length_days', 'starting_balance_cents', 'ending_balance_cents', 'transactions_count', 'net_credits_cents', 'net_debits_cents', 'credit_limit_cents', 'available_credit_cents', 'previous_balance_cents', 'new_balance_cents', 'payment_due_amount_cents', 'payment_due_date'], 'properties': {'id': {'type': 'string', 'title': 'Id'}, 'kind': {'type': 'string', 'title': 'Kind'}, 'pages': {'anyOf': [{'type': 'integer', 'minimum': 1}, {'type': 'null'}], 'title': 'Pages', 'default': None}, 'currency': {'type': 'string', 'title': 'Currency'}, 'bank_name': {'type': 'string', 'title': 'Bank Name'}, 'period_end': {'type': 'string', 'title': 'Period End'}, 'account_type': {'type': 'string', 'title': 'Account Type'}, 'display_name': {'type': 'string', 'title': 'Display Name'}, 'period_start': {'type': 'string', 'title': 'Period Start'}, 'account_holder': {'type': 'string', 'title': 'Account Holder'}, 'account_address': {'type': 'string', 'title': 'Account Address'}, 'net_debits_cents': {'type': 'integer', 'title': 'Net Debits Cents'}, 'payment_due_date': {'anyOf': [{'type': 'string'}, {'type': 'null'}], 'title': 'Payment Due Date'}, 'net_credits_cents': {'type': 'integer', 'title': 'Net Credits Cents'}, 'new_balance_cents': {'anyOf': [{'type': 'integer'}, {'type': 'null'}], 'title': 'New Balance Cents'}, 'credit_limit_cents': {'anyOf': [{'type': 'integer'}, {'type': 'null'}], 'title': 'Credit Limit Cents'}, 'transactions_count': {'type': 'integer', 'title': 'Transactions Count', 'minimum': 0}, 'ending_balance_cents': {'type': 'integer', 'title': 'Ending Balance Cents'}, 'account_number_masked': {'type': 'string', 'title': 'Account Number Masked'}, 'available_credit_cents': {'anyOf': [{'type': 'integer'}, {'type': 'null'}], 'title': 'Available Credit Cents'}, 'previous_balance_cents': {'anyOf': [{'type': 'integer'}, {'type': 'null'}], 'title': 'Previous Balance Cents'}, 'starting_balance_cents': {'type': 'integer', 'title': 'Starting Balance Cents'}, 'payment_due_amount_cents': {'anyOf': [{'type': 'integer'}, {'type': 'null'}], 'title': 'Payment Due Amount Cents'}, 'billing_cycle_length_days': {'anyOf': [{'type': 'integer'}, {'type': 'null'}], 'title': 'Billing Cycle Length Days'}}, 'description': "Document summary emitted by MainBook's JSON exporter."}, 'DownloadInstruction': {'type': 'object', 'title': 'DownloadInstruction', 'required': ['job_id', 'result_type', 'instruction'], 'properties': {'url': {'anyOf': [{'type': 'string'}, {'type': 'null'}], 'title': 'Url', 'default': None}, 'job_id': {'type': 'string', 'title': 'Job Id'}, 'expires_at': {'anyOf': [{'type': 'string'}, {'type': 'null'}], 'title': 'Expires At', 'default': None}, 'instruction': {'type': 'string', 'title': 'Instruction'}, 'result_type': {'enum': ['xlsx', 'csv'], 'type': 'string', 'title': 'Result Type'}, 'rest_endpoint': {'anyOf': [{'type': 'string'}, {'type': 'null'}], 'title': 'Rest Endpoint', 'default': None}}, 'additionalProperties': False}, 'ConversionTransaction': {'type': 'object', 'title': 'ConversionTransaction', 'required': ['row', 'source_file', 'page', 'line_index', 'date', 'description', 'amount_cents', 'transaction_type', 'balance_after_cents', 'currency', 'validation_status', 'warning_flags'], 'properties': {'row': {'type': 'integer', 'title': 'Row', 'minimum': 1}, 'date': {'type': 'string', 'title': 'Date'}, 'page': {'type': 'integer', 'title': 'Page', 'minimum': 1}, 'currency': {'anyOf': [{'type': 'string'}, {'type': 'null'}], 'title': 'Currency'}, 'cardholder': {'type': 'string', 'title': 'Cardholder', 'default': ''}, 'line_index': {'type': 'integer', 'title': 'Line Index', 'minimum': 0}, 'description': {'type': 'string', 'title': 'Description'}, 'source_file': {'type': 'string', 'title': 'Source File'}, 'amount_cents': {'type': 'integer', 'title': 'Amount Cents'}, 'warning_flags': {'type': 'array', 'items': {'type': 'string'}, 'title': 'Warning Flags'}, 'transaction_type': {'enum': ['credit', 'debit'], 'type': 'string', 'title': 'Transaction Type'}, 'validation_status': {'enum': ['valid', 'system_mismatch', 'user_edited_mismatch', 'user_reviewed', 'user_accepted'], 'type': 'string', 'title': 'Validation Status'}, 'balance_after_cents': {'anyOf': [{'type': 'integer'}, {'type': 'null'}], 'title': 'Balance After Cents'}, 'cardholder_card_masked': {'type': 'string', 'title': 'Cardholder Card Masked', 'default': ''}}, 'description': 'One exported transaction row, with integer-cent monetary fields.'}}, 'title': 'ConversionOutput', 'required': ['job_id', 'state', 'pages', 'validation', 'result_type', 'message'], 'properties': {'data': {'anyOf': [{'$ref': '#/$defs/ConversionData'}, {'type': 'null'}], 'default': None}, 'pages': {'anyOf': [{'type': 'integer'}, {'type': 'null'}], 'title': 'Pages'}, 'state': {'anyOf': [{'enum': ['awaiting_upload', 'queued', 'processing', 'succeeded', 'succeeded_with_warnings', 'insufficient_credits', 'failed', 'expired'], 'type': 'string'}, {'type': 'null'}], 'title': 'State'}, 'job_id': {'type': 'string', 'title': 'Job Id'}, 'message': {'type': 'string', 'title': 'Message'}, 'download': {'anyOf': [{'$ref': '#/$defs/DownloadInstruction'}, {'type': 'null'}], 'default': None}, 'timed_out': {'type': 'boolean', 'title': 'Timed Out', 'default': False}, 'saved_file': {'anyOf': [{'$ref': '#/$defs/SavedFile'}, {'type': 'null'}], 'default': None}, 'validation': {'anyOf': [{'$ref': '#/$defs/JobValidation'}, {'type': 'null'}]}, 'result_type': {'enum': ['json', 'xlsx', 'csv'], 'type': 'string', 'title': 'Result Type'}}, 'description': 'Structured result shared by convert_bank_statement and get_conversion.', 'additionalProperties': False}
list_conversions
List conversions
List one cursor page of conversion jobs visible to the MainBook account. Pass the returned next_cursor to continue.
只读 可访问外部资源
输入模式
{'type': 'object', 'title': 'list_conversionsArguments', 'properties': {'limit': {'type': 'integer', 'title': 'Limit', 'default': 25, 'maximum': 100, 'minimum': 1, 'description': 'Jobs on this page, from 1 to 100.'}, 'cursor': {'anyOf': [{'type': 'string', 'minLength': 1}, {'type': 'null'}], 'title': 'Cursor', 'default': None, 'description': 'Opaque next_cursor from the previous page.'}}}
输出模式
{'type': 'object', '$defs': {'Job': {'type': 'object', 'title': 'Job', 'required': ['job_id', 'state', 'filename', 'file_format', 'pages', 'source', 'created_at', 'updated_at', 'validation', 'error'], 'properties': {'error': {'anyOf': [{'$ref': '#/$defs/JobError'}, {'type': 'null'}]}, 'pages': {'type': 'integer', 'title': 'Pages', 'minimum': 1}, 'state': {'enum': ['awaiting_upload', 'queued', 'processing', 'succeeded', 'succeeded_with_warnings', 'insufficient_credits', 'failed', 'expired'], 'type': 'string', 'title': 'State'}, 'job_id': {'type': 'string', 'title': 'Job Id'}, 'source': {'enum': ['web', 'api'], 'type': 'string', 'title': 'Source'}, 'filename': {'type': 'string', 'title': 'Filename'}, 'created_at': {'type': 'string', 'title': 'Created At'}, 'updated_at': {'type': 'string', 'title': 'Updated At'}, 'validation': {'anyOf': [{'$ref': '#/$defs/JobValidation'}, {'type': 'null'}]}, 'file_format': {'type': 'string', 'const': 'pdf', 'title': 'File Format'}, 'credits_reserved': {'anyOf': [{'type': 'integer', 'minimum': 1}, {'type': 'null'}], 'title': 'Credits Reserved', 'default': None}}}, 'JobError': {'type': 'object', 'title': 'JobError', 'required': ['category', 'reason'], 'properties': {'reason': {'anyOf': [{'type': 'string'}, {'type': 'null'}], 'title': 'Reason'}, 'category': {'anyOf': [{'type': 'string'}, {'type': 'null'}], 'title': 'Category'}}}, 'JobValidation': {'type': 'object', 'title': 'JobValidation', 'required': ['reconcilable', 'passed', 'mismatched_rows'], 'properties': {'passed': {'type': 'boolean', 'title': 'Passed', 'description': "Whether MainBook's applicable statement-math checks passed."}, 'reconcilable': {'anyOf': [{'type': 'boolean'}, {'type': 'null'}], 'title': 'Reconcilable', 'description': 'Whether statement math can be reconciled; null means the document kind has no running-balance reconciliation, such as many credit-card statements.'}, 'mismatched_rows': {'type': 'integer', 'title': 'Mismatched Rows', 'minimum': 0, 'description': 'Number of transaction rows that remain mathematically mismatched.'}}}}, 'title': 'ListConversionsOutput', 'required': ['conversions', 'next_cursor', 'count'], 'properties': {'count': {'type': 'integer', 'title': 'Count', 'minimum': 0}, 'units': {'type': 'string', 'const': 'pages', 'title': 'Units', 'default': 'pages'}, 'conversions': {'type': 'array', 'items': {'$ref': '#/$defs/Job'}, 'title': 'Conversions'}, 'next_cursor': {'anyOf': [{'type': 'string'}, {'type': 'null'}], 'title': 'Next Cursor'}}, 'additionalProperties': False}
已添加
get_conversion
2026年9月17日 07:57
已添加
list_conversions
2026年9月17日 07:57
已添加
get_balance
2026年9月17日 07:57
已添加
convert_bank_statement
2026年9月17日 07:57