Fastbcp Mcp

io.github.arpe-io由 GitHub 账号 arpe-io 发布v0.1.5更新于 Oct 24, 2026

MCP server for FastBCP — high-performance parallel database export to files and cloud

概览

AI 生成的概览

封装 FastBCP 命令行的 MCP 服务器,让助手预览、校验并执行数据库并行导出到文件或云存储。

可以做什么
构建并预览导出命令,密码会被遮蔽,并在明确确认后执行;执行前可校验源数据库连接参数。查询支持的源数据库、输出格式和存储目标,并针对数据库类型和表特征推荐并行方式。报告检测到的 FastBCP 二进制版本及其支持的功能。
适用场景
适合需要经常把 PostgreSQL、SQL Server 等数据库中的表导出为 CSV、Parquet 等格式(本地或上传到 S3、Azure 存储),并希望由助手先组装和检查 FastBCP 命令再执行的场景。
运行要求
以 stdio 在本地运行,需要 Python 3.10 或更高版本,以及另行获取的 FastBCP v0.29 或更高版本二进制,通过 FASTBCP_PATH 指定;未配置时仅能预览。可选配置 FASTBCP_LOG_DIR、FASTBCP_TIMEOUT 和 LOG_LEVEL。数据库凭据和云存储配置作为导出参数传入。
安装前请注意
导出会读取数据库数据并写入文件或上传到云存储,执行前应逐条检查预览命令。数据库密码和连接字符串会经工具传递,输出和日志中虽已遮蔽,但仍会进入本地进程及其日志目录。建议使用最小权限的数据库账号,并确认导出数据的存放位置。

安装

在 SourceWeft 中

  1. 打开 控制台中的 Fastbcp Mcp,将其添加到工作区。
  2. 为需要使用其工具的对话启用该服务。

Desktop only,通过 STDIO。 STDIO 服务会启动本地进程,因此需要 SourceWeft 桌面宿主。

其他 MCP 客户端

参照 仓库 中的启动说明。

README

FastBCP MCP Server

[PyPI] [License: MIT] [MCP Registry]

A Model Context Protocol (MCP) server that exposes FastBCP functionality for exporting data from databases to files (CSV, TSV, JSON, BSON, Parquet, XLSX, Binary) with optional cloud storage targets.

Overview

FastBCP is a high-performance CLI tool for exporting data from databases to files. This MCP server wraps FastBCP functionality and provides:

  • Safety-first approach: Preview commands before execution with user confirmation required
  • Password masking: Credentials and connection strings are never displayed in logs or output
  • Intelligent validation: Parameter validation with database-specific compatibility checks
  • Smart suggestions: Automatic parallelism method recommendations
  • Version detection: Automatic binary version detection with capability registry
  • Comprehensive logging: Full execution logs with timestamps and results

MCP Tools

1. preview_export_command

Build and preview a FastBCP export command WITHOUT executing it. Shows the exact command with passwords masked. Always use this first.

2. execute_export

Execute a previously previewed command. Requires confirmation: true as a safety mechanism.

3. validate_connection

Validate source database connection parameters (parameter check only, does not test actual connectivity).

4. list_supported_formats

List all supported source databases, output formats, and storage targets.

5. suggest_parallelism_method

Recommend the optimal parallelism method based on source database type and table characteristics.

6. get_version

Report the detected FastBCP binary version, supported types, and feature flags.

Installation

Prerequisites

  • Python 3.10 or higher
  • FastBCP binary v0.29+ (obtain from Arpe.io)
  • Claude Code or another MCP client

Setup

  1. Clone or download this repository:

    bash
    cd /path/to/fastbcp-mcp
  2. Install Python dependencies:

    bash
    pip install -r requirements.txt
  3. Configure environment:

    bash
    cp .env.example .env# Edit .env with your FastBCP path
  4. Add to Claude Code configuration (~/.claude.json):

    json
    {  "mcpServers": {    "fastbcp": {      "type": "stdio",      "command": "python",      "args": ["/absolute/path/to/fastbcp-mcp/src/server.py"],      "env": {        "FASTBCP_PATH": "/absolute/path/to/FastBCP"      }    }  }}
  5. Restart Claude Code to load the MCP server.

  6. Verify installation:

    # In Claude Code, run:/mcp# You should see "fastbcp: connected"

Configuration

Environment Variables

Edit .env to configure:

bash
# Path to FastBCP binary (required)FASTBCP_PATH=./fastbcp/FastBCP
# Execution timeout in seconds (default: 1800 = 30 minutes)FASTBCP_TIMEOUT=1800
# Log directory (default: ./logs)FASTBCP_LOG_DIR=./logs
# Log level (default: INFO)LOG_LEVEL=INFO

Connection Options

The server supports multiple ways to authenticate and connect:

ParameterDescription
serverHost:port or host\instance (optional with connect_string or dsn)
user / passwordStandard credentials
trusted_authWindows trusted authentication
connect_stringFull connection string (excludes server/user/password/dsn)
dsnODBC DSN name (excludes server/provider)
providerOleDB provider name
application_intentSQL Server application intent (ReadOnly/ReadWrite)

Output Options

OptionCLI FlagDescription
format--formatOutput format: csv, tsv, json, bson, parquet, xlsx, binary
file_output--fileoutputOutput file path
directory--directoryOutput directory path
storage_target--storagetargetStorage: local, s3, s3compatible, azure_blob, azure_datalake, fabric_onelake
delimiter--delimiterField delimiter (CSV/TSV)
quotes--quotesQuote character
encoding--encodingOutput encoding
no_header--noheaderOmit header row (CSV/TSV)
decimal_separator--decimalseparatorDecimal separator (. or ,)
date_format--dateformatDate format string
bool_format--boolformatBoolean format: TrueFalse, OneZero, YesNo
parquet_compression--parquetcompressionParquet compression: None, Snappy, Gzip, Lz4, Lzo, Zstd
timestamped--timestampedAdd timestamp to output filename
merge--mergeMerge parallel output files

Export Options

OptionCLI FlagDescription
method--methodParallelism method
distribute_key_column--distributeKeyColumnColumn for data distribution
degree--degreeParallelism degree (default: 1)
load_mode--loadmodeAppend or Truncate
batch_size--batchsizeBatch size for export operations
map_method--mapmethodColumn mapping: Position or Name
run_id--runidRun ID for logging
data_driven_query--datadrivenqueryCustom SQL for DataDriven method
settings_file--settingsfileCustom settings JSON file
log_level--loglevelOverride log level (Information/Debug)
no_banner--nobannerSuppress banner output
license_path--licenseLicense file path or URL
cloud_profile--cloudprofileCloud storage profile name

Usage Examples

PostgreSQL to CSV Export

User: "Export the 'orders' table from PostgreSQL (localhost:5432, database: sales_db,       schema: public) to CSV file at /tmp/orders.csv. Use parallel export."
Claude Code will:1. Call suggest_parallelism_method to recommend Ctid for PostgreSQL2. Call preview_export_command with your parameters3. Show the command with masked passwords4. Explain what will happen5. Ask for confirmation6. Execute with execute_export when you approve

Export to Parquet with Compression

User: "Export the 'transactions' table from SQL Server to Parquet format       with Snappy compression, saved to /data/exports/."
Claude Code will use parquet format with parquet_compression set to Snappy.

Export to S3

User: "Export the 'users' table from PostgreSQL to CSV on S3 bucket       s3://my-bucket/exports/ using my AWS profile."
Claude Code will use storage_target=s3 with cloud_profile.

Check Version and Capabilities

User: "What version of FastBCP is installed?"
Claude Code will call get_version and display the detected version,supported source types, output formats, and available features.

Two-Step Safety Process

This server implements a mandatory two-step process:

  1. Preview - Always use preview_export_command first
  2. Execute - Use execute_export with confirmation: true

You cannot execute without previewing first and confirming.

Security

  • Passwords and connection strings are masked in all output and logs
  • Sensitive flags masked: --sourcepassword, --sourceconnectstring, -x, -g
  • Use environment variables for sensitive configuration
  • Review commands carefully before executing
  • Use minimum required database permissions

Testing

Run the test suite:

bash
# Run all testspython -m pytest tests/ -v
# Run with coveragepython -m pytest tests/ --cov=src --cov-report=html

Project Structure

fastbcp-mcp/  src/    __init__.py    server.py          # MCP server (tool definitions, handlers)    fastbcp.py         # Command builder, executor, suggestions    validators.py      # Pydantic models, enums, validation    version.py         # Version detection and capabilities registry  tests/    __init__.py    test_command_builder.py    test_validators.py    test_version.py  .env.example  requirements.txt  CHANGELOG.md  README.md

License

This MCP server wrapper is provided as-is. FastBCP itself is a separate product from Arpe.io.

Related Links

来源:README.md,提交 0b63a99

工具

0
SourceWeft 尚未在沙箱中启动过该软件包,因此其工具未知。

版本历史

1
  1. v0.1.5最新Sep 16, 2026

评分

已满足适用检查项的 50%

该评分衡量此收录条目的完整程度,依据注册中心条目、端点与公开来源计算得出。它不是对服务器本身的评价,也不表示服务器安全或当前可用:可连通性是带日期的检查结果,评分也不包含安装量或用户评价。

  • 近 30 天内可连通25 分

    请保持端点能够响应 MCP 握手;SourceWeft 每 30 天探测一次。

  • 已声明认证方式10 分

    请在注册中心条目中声明凭据请求头,或保持端点能够响应探测,以便判定其认证方式。

  • 已列出工具15 分

    请让服务器在无凭据时响应 tools/list,或发布可在沙箱中无凭据启动的软件包。

  • 描述必需15 分
  • 图标10 分
  • 文档15 分
  • 许可证10 分