fasttransfer-mcp 0.1.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- fasttransfer_mcp-0.1.0/.claude/settings.local.json +16 -0
- fasttransfer_mcp-0.1.0/.env.example +17 -0
- fasttransfer_mcp-0.1.0/.gitignore +51 -0
- fasttransfer_mcp-0.1.0/CHANGELOG.md +28 -0
- fasttransfer_mcp-0.1.0/LICENSE +21 -0
- fasttransfer_mcp-0.1.0/PKG-INFO +278 -0
- fasttransfer_mcp-0.1.0/README.md +249 -0
- fasttransfer_mcp-0.1.0/notes.txt +327 -0
- fasttransfer_mcp-0.1.0/pyproject.toml +48 -0
- fasttransfer_mcp-0.1.0/requirements.txt +16 -0
- fasttransfer_mcp-0.1.0/src/__init__.py +3 -0
- fasttransfer_mcp-0.1.0/src/fasttransfer.py +603 -0
- fasttransfer_mcp-0.1.0/src/server.py +857 -0
- fasttransfer_mcp-0.1.0/src/validators.py +381 -0
- fasttransfer_mcp-0.1.0/src/version.py +238 -0
- fasttransfer_mcp-0.1.0/tests/__init__.py +1 -0
- fasttransfer_mcp-0.1.0/tests/test_command_builder.py +798 -0
- fasttransfer_mcp-0.1.0/tests/test_validators.py +758 -0
- fasttransfer_mcp-0.1.0/tests/test_version.py +258 -0
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
{
|
|
2
|
+
"permissions": {
|
|
3
|
+
"allow": [
|
|
4
|
+
"WebFetch(domain:fasttransfer.arpe.io)",
|
|
5
|
+
"Bash(/home/francois/Workspace/fasttransfer-mcp/fasttransfer/FastTransfer:*)",
|
|
6
|
+
"Bash(find:*)",
|
|
7
|
+
"Bash(/home/francois/Workspace/FastTransfer/latest/FastTransfer:*)",
|
|
8
|
+
"Bash(python -m pytest tests/ -v)",
|
|
9
|
+
"Bash(pip show:*)",
|
|
10
|
+
"Bash(pip install build)",
|
|
11
|
+
"Bash(python -m build:*)",
|
|
12
|
+
"Bash(python:*)",
|
|
13
|
+
"Bash(pip install:*)"
|
|
14
|
+
]
|
|
15
|
+
}
|
|
16
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
# FastTransfer MCP Server Configuration
|
|
2
|
+
|
|
3
|
+
# Path to FastTransfer binary
|
|
4
|
+
# Default: ./fasttransfer/FastTransfer
|
|
5
|
+
FASTTRANSFER_PATH=./fasttransfer/FastTransfer
|
|
6
|
+
|
|
7
|
+
# Maximum execution timeout in seconds
|
|
8
|
+
# Default: 1800 (30 minutes)
|
|
9
|
+
FASTTRANSFER_TIMEOUT=1800
|
|
10
|
+
|
|
11
|
+
# Directory for execution logs
|
|
12
|
+
# Default: ./logs
|
|
13
|
+
FASTTRANSFER_LOG_DIR=./logs
|
|
14
|
+
|
|
15
|
+
# Log level (DEBUG, INFO, WARNING, ERROR, CRITICAL)
|
|
16
|
+
# Default: INFO
|
|
17
|
+
LOG_LEVEL=INFO
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
# Python
|
|
2
|
+
__pycache__/
|
|
3
|
+
*.py[cod]
|
|
4
|
+
*$py.class
|
|
5
|
+
*.so
|
|
6
|
+
.Python
|
|
7
|
+
build/
|
|
8
|
+
develop-eggs/
|
|
9
|
+
dist/
|
|
10
|
+
downloads/
|
|
11
|
+
eggs/
|
|
12
|
+
.eggs/
|
|
13
|
+
lib/
|
|
14
|
+
lib64/
|
|
15
|
+
parts/
|
|
16
|
+
sdist/
|
|
17
|
+
var/
|
|
18
|
+
wheels/
|
|
19
|
+
*.egg-info/
|
|
20
|
+
.installed.cfg
|
|
21
|
+
*.egg
|
|
22
|
+
MANIFEST
|
|
23
|
+
|
|
24
|
+
# Virtual environments
|
|
25
|
+
venv/
|
|
26
|
+
ENV/
|
|
27
|
+
env/
|
|
28
|
+
|
|
29
|
+
# Environment variables
|
|
30
|
+
.env
|
|
31
|
+
|
|
32
|
+
# IDE
|
|
33
|
+
.vscode/
|
|
34
|
+
.idea/
|
|
35
|
+
*.swp
|
|
36
|
+
*.swo
|
|
37
|
+
*~
|
|
38
|
+
|
|
39
|
+
# Testing
|
|
40
|
+
.pytest_cache/
|
|
41
|
+
.coverage
|
|
42
|
+
htmlcov/
|
|
43
|
+
.tox/
|
|
44
|
+
|
|
45
|
+
# Logs
|
|
46
|
+
logs/
|
|
47
|
+
*.log
|
|
48
|
+
|
|
49
|
+
# OS
|
|
50
|
+
.DS_Store
|
|
51
|
+
Thumbs.db
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
# Changelog
|
|
2
|
+
|
|
3
|
+
All notable changes to the FastTransfer MCP Server will be documented in this file.
|
|
4
|
+
|
|
5
|
+
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
|
|
6
|
+
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
|
7
|
+
|
|
8
|
+
## [0.1.0] - 2026-02-20
|
|
9
|
+
|
|
10
|
+
### Added
|
|
11
|
+
|
|
12
|
+
- MCP server with six tools: `preview_transfer_command`, `execute_transfer`, `validate_connection`, `list_supported_combinations`, `suggest_parallelism_method`, `get_version`
|
|
13
|
+
- Version detection module (`src/version.py`) with static capability registry for FastTransfer v0.16.0.0
|
|
14
|
+
- `FastTransferVersion` dataclass with comparison operators
|
|
15
|
+
- `VersionDetector` with subprocess-based detection, caching, and graceful fallback
|
|
16
|
+
- `VersionCapabilities` registry mapping versions to supported types and feature flags
|
|
17
|
+
- 16 source connection types: `clickhouse`, `duckdb`, `duckdbstream`, `hana`, `mssql`, `msoledbsql`, `mysql`, `nzoledb`, `nzsql`, `nzbulk`, `odbc`, `oledb`, `oraodp`, `pgcopy`, `pgsql`, `teradata`
|
|
18
|
+
- 11 target connection types: `clickhousebulk`, `duckdb`, `hanabulk`, `msbulk`, `mysqlbulk`, `nzbulk`, `orabulk`, `oradirect`, `pgcopy`, `pgsql`, `teradata`
|
|
19
|
+
- 9 parallelism methods: `Ctid`, `DataDriven`, `Ntile`, `NZDataSlice`, `None`, `Physloc`, `Random`, `RangeId`, `Rowid`
|
|
20
|
+
- Flexible connection configuration: `server` (optional), `connect_string`, `dsn`, `provider`, `file_input`, `trusted_auth`
|
|
21
|
+
- Mutual exclusivity validation for connection parameters
|
|
22
|
+
- Transfer options: `data_driven_query`, `use_work_tables`, `settings_file`, `log_level`, `no_banner`, `license_path`
|
|
23
|
+
- `LogLevel` enum: `error`, `warning`, `information`, `debug`, `fatal`
|
|
24
|
+
- Physloc method validation (SQL Server sources only)
|
|
25
|
+
- Password and connection string masking in command output
|
|
26
|
+
- DuckDB Stream file import as a source category
|
|
27
|
+
- Parallelism suggestion engine with Physloc recommendation for SQL Server without numeric key
|
|
28
|
+
- 122 tests across three test modules
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Arpe.io
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
|
@@ -0,0 +1,278 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: fasttransfer-mcp
|
|
3
|
+
Version: 0.1.0
|
|
4
|
+
Summary: A Model Context Protocol (MCP) server for FastTransfer, enabling efficient data transfer between database systems.
|
|
5
|
+
Project-URL: Homepage, https://aetperf.github.io/FastTransfer-Documentation/
|
|
6
|
+
Project-URL: Repository, https://github.com/aetperf/fasttransfer-mcp
|
|
7
|
+
Project-URL: Issues, https://github.com/aetperf/fasttransfer-mcp/issues
|
|
8
|
+
Author: Arpe.io
|
|
9
|
+
License-Expression: MIT
|
|
10
|
+
License-File: LICENSE
|
|
11
|
+
Keywords: data-transfer,database,etl,fasttransfer,mcp,model-context-protocol
|
|
12
|
+
Classifier: Development Status :: 4 - Beta
|
|
13
|
+
Classifier: Intended Audience :: Developers
|
|
14
|
+
Classifier: Programming Language :: Python :: 3
|
|
15
|
+
Classifier: Programming Language :: Python :: 3.10
|
|
16
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
17
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
18
|
+
Classifier: Programming Language :: Python :: 3.13
|
|
19
|
+
Requires-Python: >=3.10
|
|
20
|
+
Requires-Dist: mcp>=1.0.0
|
|
21
|
+
Requires-Dist: pydantic>=2.0.0
|
|
22
|
+
Requires-Dist: python-dotenv>=1.0.0
|
|
23
|
+
Provides-Extra: dev
|
|
24
|
+
Requires-Dist: pytest-asyncio>=0.21.0; extra == 'dev'
|
|
25
|
+
Requires-Dist: pytest-cov>=4.1.0; extra == 'dev'
|
|
26
|
+
Requires-Dist: pytest-mock>=3.11.0; extra == 'dev'
|
|
27
|
+
Requires-Dist: pytest>=8.0.0; extra == 'dev'
|
|
28
|
+
Description-Content-Type: text/markdown
|
|
29
|
+
|
|
30
|
+
# FastTransfer MCP Server
|
|
31
|
+
|
|
32
|
+
<!-- mcp-name: io.github.aetperf/fasttransfer-mcp -->
|
|
33
|
+
|
|
34
|
+
A [Model Context Protocol (MCP)](https://modelcontextprotocol.io/) server that exposes [FastTransfer](https://aetperf.github.io/FastTransfer-Documentation/) functionality for efficient data transfer between various database systems.
|
|
35
|
+
|
|
36
|
+
## Overview
|
|
37
|
+
|
|
38
|
+
FastTransfer is a high-performance CLI tool for transferring data between databases. This MCP server wraps FastTransfer functionality and provides:
|
|
39
|
+
|
|
40
|
+
- **Safety-first approach**: Preview commands before execution with user confirmation required
|
|
41
|
+
- **Password masking**: Credentials and connection strings are never displayed in logs or output
|
|
42
|
+
- **Intelligent validation**: Parameter validation with database-specific compatibility checks
|
|
43
|
+
- **Smart suggestions**: Automatic parallelism method recommendations
|
|
44
|
+
- **Version detection**: Automatic binary version detection with capability registry
|
|
45
|
+
- **Comprehensive logging**: Full execution logs with timestamps and results
|
|
46
|
+
|
|
47
|
+
## MCP Tools
|
|
48
|
+
|
|
49
|
+
### 1. `preview_transfer_command`
|
|
50
|
+
Build and preview a FastTransfer command WITHOUT executing it. Shows the exact command with passwords masked. Always use this first.
|
|
51
|
+
|
|
52
|
+
### 2. `execute_transfer`
|
|
53
|
+
Execute a previously previewed command. Requires `confirmation: true` as a safety mechanism.
|
|
54
|
+
|
|
55
|
+
### 3. `validate_connection`
|
|
56
|
+
Validate database connection parameters (parameter check only, does not test actual connectivity).
|
|
57
|
+
|
|
58
|
+
### 4. `list_supported_combinations`
|
|
59
|
+
List all supported source-to-target database combinations.
|
|
60
|
+
|
|
61
|
+
### 5. `suggest_parallelism_method`
|
|
62
|
+
Recommend the optimal parallelism method based on source database type and table characteristics.
|
|
63
|
+
|
|
64
|
+
### 6. `get_version`
|
|
65
|
+
Report the detected FastTransfer binary version, supported types, and feature flags.
|
|
66
|
+
|
|
67
|
+
## Parallelism Methods
|
|
68
|
+
|
|
69
|
+
| Method | Best For | Requires Key |
|
|
70
|
+
|--------|----------|:------------:|
|
|
71
|
+
| `Ctid` | PostgreSQL sources | No |
|
|
72
|
+
| `Rowid` | Oracle sources | No |
|
|
73
|
+
| `Physloc` | SQL Server sources without numeric key | No |
|
|
74
|
+
| `NZDataSlice` | Netezza sources | No |
|
|
75
|
+
| `RangeId` | Large tables with numeric key | Yes |
|
|
76
|
+
| `Random` | Tables with evenly distributed numeric key | Yes |
|
|
77
|
+
| `DataDriven` | Any column type, distinct values | Yes |
|
|
78
|
+
| `Ntile` | Even distribution across workers | Yes |
|
|
79
|
+
| `None` | Small tables or troubleshooting | No |
|
|
80
|
+
|
|
81
|
+
## Installation
|
|
82
|
+
|
|
83
|
+
### Prerequisites
|
|
84
|
+
|
|
85
|
+
- Python 3.10 or higher
|
|
86
|
+
- FastTransfer binary v0.16+ (obtain from [Arpe.io](https://arpe.io))
|
|
87
|
+
- Claude Code or another MCP client
|
|
88
|
+
|
|
89
|
+
### Setup
|
|
90
|
+
|
|
91
|
+
1. **Clone or download this repository**:
|
|
92
|
+
```bash
|
|
93
|
+
cd /path/to/fasttransfer-mcp
|
|
94
|
+
```
|
|
95
|
+
|
|
96
|
+
2. **Install Python dependencies**:
|
|
97
|
+
```bash
|
|
98
|
+
pip install -r requirements.txt
|
|
99
|
+
```
|
|
100
|
+
|
|
101
|
+
3. **Configure environment**:
|
|
102
|
+
```bash
|
|
103
|
+
cp .env.example .env
|
|
104
|
+
# Edit .env with your FastTransfer path
|
|
105
|
+
```
|
|
106
|
+
|
|
107
|
+
4. **Add to Claude Code configuration** (`~/.claude.json`):
|
|
108
|
+
```json
|
|
109
|
+
{
|
|
110
|
+
"mcpServers": {
|
|
111
|
+
"fasttransfer": {
|
|
112
|
+
"type": "stdio",
|
|
113
|
+
"command": "python",
|
|
114
|
+
"args": ["/absolute/path/to/fasttransfer-mcp/src/server.py"],
|
|
115
|
+
"env": {
|
|
116
|
+
"FASTTRANSFER_PATH": "/absolute/path/to/fasttransfer/FastTransfer"
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
```
|
|
122
|
+
|
|
123
|
+
5. **Restart Claude Code** to load the MCP server.
|
|
124
|
+
|
|
125
|
+
6. **Verify installation**:
|
|
126
|
+
```
|
|
127
|
+
# In Claude Code, run:
|
|
128
|
+
/mcp
|
|
129
|
+
# You should see "fasttransfer: connected"
|
|
130
|
+
```
|
|
131
|
+
|
|
132
|
+
## Configuration
|
|
133
|
+
|
|
134
|
+
### Environment Variables
|
|
135
|
+
|
|
136
|
+
Edit `.env` to configure:
|
|
137
|
+
|
|
138
|
+
```bash
|
|
139
|
+
# Path to FastTransfer binary (required)
|
|
140
|
+
FASTTRANSFER_PATH=./fasttransfer/FastTransfer
|
|
141
|
+
|
|
142
|
+
# Execution timeout in seconds (default: 1800 = 30 minutes)
|
|
143
|
+
FASTTRANSFER_TIMEOUT=1800
|
|
144
|
+
|
|
145
|
+
# Log directory (default: ./logs)
|
|
146
|
+
FASTTRANSFER_LOG_DIR=./logs
|
|
147
|
+
|
|
148
|
+
# Log level (default: INFO)
|
|
149
|
+
LOG_LEVEL=INFO
|
|
150
|
+
```
|
|
151
|
+
|
|
152
|
+
## Connection Options
|
|
153
|
+
|
|
154
|
+
The server supports multiple ways to authenticate and connect:
|
|
155
|
+
|
|
156
|
+
| Parameter | Description |
|
|
157
|
+
|-----------|-------------|
|
|
158
|
+
| `server` | Host:port or host\instance (optional with `connect_string` or `dsn`) |
|
|
159
|
+
| `user` / `password` | Standard credentials |
|
|
160
|
+
| `trusted_auth` | Windows trusted authentication |
|
|
161
|
+
| `connect_string` | Full connection string (excludes server/user/password/dsn) |
|
|
162
|
+
| `dsn` | ODBC DSN name (excludes server/provider) |
|
|
163
|
+
| `provider` | OleDB provider name |
|
|
164
|
+
| `file_input` | File path for data input (source only, excludes query) |
|
|
165
|
+
|
|
166
|
+
## Transfer Options
|
|
167
|
+
|
|
168
|
+
| Option | CLI Flag | Description |
|
|
169
|
+
|--------|----------|-------------|
|
|
170
|
+
| `method` | `--method` | Parallelism method |
|
|
171
|
+
| `distribute_key_column` | `--distributeKeyColumn` | Column for data distribution |
|
|
172
|
+
| `degree` | `--degree` | Parallelism degree (0=auto, >0=fixed, <0=CPU adaptive) |
|
|
173
|
+
| `load_mode` | `--loadmode` | Append or Truncate |
|
|
174
|
+
| `batch_size` | `--batchsize` | Batch size for bulk operations |
|
|
175
|
+
| `map_method` | `--mapmethod` | Column mapping: Position or Name |
|
|
176
|
+
| `run_id` | `--runid` | Run ID for logging |
|
|
177
|
+
| `data_driven_query` | `--datadrivenquery` | Custom SQL for DataDriven method |
|
|
178
|
+
| `use_work_tables` | `--useworktables` | Intermediate work tables for CCI |
|
|
179
|
+
| `settings_file` | `--settingsfile` | Custom settings JSON file |
|
|
180
|
+
| `log_level` | `--loglevel` | Override log level (error/warning/information/debug/fatal) |
|
|
181
|
+
| `no_banner` | `--nobanner` | Suppress banner output |
|
|
182
|
+
| `license_path` | `--license` | License file path or URL |
|
|
183
|
+
|
|
184
|
+
## Usage Examples
|
|
185
|
+
|
|
186
|
+
### PostgreSQL to SQL Server Transfer
|
|
187
|
+
|
|
188
|
+
```
|
|
189
|
+
User: "Copy the 'orders' table from PostgreSQL (localhost:5432, database: sales_db,
|
|
190
|
+
schema: public) to SQL Server (localhost:1433, database: warehouse, schema: dbo).
|
|
191
|
+
Use parallel transfer and truncate the target first."
|
|
192
|
+
|
|
193
|
+
Claude Code will:
|
|
194
|
+
1. Call suggest_parallelism_method to recommend Ctid for PostgreSQL
|
|
195
|
+
2. Call preview_transfer_command with your parameters
|
|
196
|
+
3. Show the command with masked passwords
|
|
197
|
+
4. Explain what will happen
|
|
198
|
+
5. Ask for confirmation
|
|
199
|
+
6. Execute with execute_transfer when you approve
|
|
200
|
+
```
|
|
201
|
+
|
|
202
|
+
### File Import via DuckDB Stream
|
|
203
|
+
|
|
204
|
+
```
|
|
205
|
+
User: "Import /data/export.parquet into the SQL Server 'staging' table
|
|
206
|
+
using DuckDB stream."
|
|
207
|
+
|
|
208
|
+
Claude Code will use duckdbstream source type with file_input parameter.
|
|
209
|
+
```
|
|
210
|
+
|
|
211
|
+
### Check Version and Capabilities
|
|
212
|
+
|
|
213
|
+
```
|
|
214
|
+
User: "What version of FastTransfer is installed?"
|
|
215
|
+
|
|
216
|
+
Claude Code will call get_version and display the detected version,
|
|
217
|
+
supported source/target types, and available features.
|
|
218
|
+
```
|
|
219
|
+
|
|
220
|
+
## Two-Step Safety Process
|
|
221
|
+
|
|
222
|
+
This server implements a mandatory two-step process:
|
|
223
|
+
|
|
224
|
+
1. **Preview** - Always use `preview_transfer_command` first
|
|
225
|
+
2. **Execute** - Use `execute_transfer` with `confirmation: true`
|
|
226
|
+
|
|
227
|
+
You cannot execute without previewing first and confirming.
|
|
228
|
+
|
|
229
|
+
## Security
|
|
230
|
+
|
|
231
|
+
- Passwords and connection strings are masked in all output and logs
|
|
232
|
+
- Sensitive flags masked: `--sourcepassword`, `--targetpassword`, `--sourceconnectstring`, `--targetconnectstring`, `-x`, `-X`, `-g`, `-G`
|
|
233
|
+
- Use environment variables for sensitive configuration
|
|
234
|
+
- Review commands carefully before executing
|
|
235
|
+
- Use minimum required database permissions
|
|
236
|
+
|
|
237
|
+
## Testing
|
|
238
|
+
|
|
239
|
+
Run the test suite:
|
|
240
|
+
|
|
241
|
+
```bash
|
|
242
|
+
# Run all tests
|
|
243
|
+
python -m pytest tests/ -v
|
|
244
|
+
|
|
245
|
+
# Run with coverage
|
|
246
|
+
python -m pytest tests/ --cov=src --cov-report=html
|
|
247
|
+
```
|
|
248
|
+
|
|
249
|
+
## Project Structure
|
|
250
|
+
|
|
251
|
+
```
|
|
252
|
+
fasttransfer-mcp/
|
|
253
|
+
src/
|
|
254
|
+
__init__.py
|
|
255
|
+
server.py # MCP server (tool definitions, handlers)
|
|
256
|
+
fasttransfer.py # Command builder, executor, suggestions
|
|
257
|
+
validators.py # Pydantic models, enums, validation
|
|
258
|
+
version.py # Version detection and capabilities registry
|
|
259
|
+
tests/
|
|
260
|
+
__init__.py
|
|
261
|
+
test_command_builder.py
|
|
262
|
+
test_validators.py
|
|
263
|
+
test_version.py
|
|
264
|
+
.env.example
|
|
265
|
+
requirements.txt
|
|
266
|
+
CHANGELOG.md
|
|
267
|
+
README.md
|
|
268
|
+
```
|
|
269
|
+
|
|
270
|
+
## License
|
|
271
|
+
|
|
272
|
+
This MCP server wrapper is provided as-is. FastTransfer itself is a separate product from Arpe.io.
|
|
273
|
+
|
|
274
|
+
## Related Links
|
|
275
|
+
|
|
276
|
+
- [FastTransfer Documentation](https://aetperf.github.io/FastTransfer-Documentation/)
|
|
277
|
+
- [Model Context Protocol](https://modelcontextprotocol.io/)
|
|
278
|
+
- [Claude Code](https://claude.com/claude-code)
|
|
@@ -0,0 +1,249 @@
|
|
|
1
|
+
# FastTransfer MCP Server
|
|
2
|
+
|
|
3
|
+
<!-- mcp-name: io.github.aetperf/fasttransfer-mcp -->
|
|
4
|
+
|
|
5
|
+
A [Model Context Protocol (MCP)](https://modelcontextprotocol.io/) server that exposes [FastTransfer](https://aetperf.github.io/FastTransfer-Documentation/) functionality for efficient data transfer between various database systems.
|
|
6
|
+
|
|
7
|
+
## Overview
|
|
8
|
+
|
|
9
|
+
FastTransfer is a high-performance CLI tool for transferring data between databases. This MCP server wraps FastTransfer functionality and provides:
|
|
10
|
+
|
|
11
|
+
- **Safety-first approach**: Preview commands before execution with user confirmation required
|
|
12
|
+
- **Password masking**: Credentials and connection strings are never displayed in logs or output
|
|
13
|
+
- **Intelligent validation**: Parameter validation with database-specific compatibility checks
|
|
14
|
+
- **Smart suggestions**: Automatic parallelism method recommendations
|
|
15
|
+
- **Version detection**: Automatic binary version detection with capability registry
|
|
16
|
+
- **Comprehensive logging**: Full execution logs with timestamps and results
|
|
17
|
+
|
|
18
|
+
## MCP Tools
|
|
19
|
+
|
|
20
|
+
### 1. `preview_transfer_command`
|
|
21
|
+
Build and preview a FastTransfer command WITHOUT executing it. Shows the exact command with passwords masked. Always use this first.
|
|
22
|
+
|
|
23
|
+
### 2. `execute_transfer`
|
|
24
|
+
Execute a previously previewed command. Requires `confirmation: true` as a safety mechanism.
|
|
25
|
+
|
|
26
|
+
### 3. `validate_connection`
|
|
27
|
+
Validate database connection parameters (parameter check only, does not test actual connectivity).
|
|
28
|
+
|
|
29
|
+
### 4. `list_supported_combinations`
|
|
30
|
+
List all supported source-to-target database combinations.
|
|
31
|
+
|
|
32
|
+
### 5. `suggest_parallelism_method`
|
|
33
|
+
Recommend the optimal parallelism method based on source database type and table characteristics.
|
|
34
|
+
|
|
35
|
+
### 6. `get_version`
|
|
36
|
+
Report the detected FastTransfer binary version, supported types, and feature flags.
|
|
37
|
+
|
|
38
|
+
## Parallelism Methods
|
|
39
|
+
|
|
40
|
+
| Method | Best For | Requires Key |
|
|
41
|
+
|--------|----------|:------------:|
|
|
42
|
+
| `Ctid` | PostgreSQL sources | No |
|
|
43
|
+
| `Rowid` | Oracle sources | No |
|
|
44
|
+
| `Physloc` | SQL Server sources without numeric key | No |
|
|
45
|
+
| `NZDataSlice` | Netezza sources | No |
|
|
46
|
+
| `RangeId` | Large tables with numeric key | Yes |
|
|
47
|
+
| `Random` | Tables with evenly distributed numeric key | Yes |
|
|
48
|
+
| `DataDriven` | Any column type, distinct values | Yes |
|
|
49
|
+
| `Ntile` | Even distribution across workers | Yes |
|
|
50
|
+
| `None` | Small tables or troubleshooting | No |
|
|
51
|
+
|
|
52
|
+
## Installation
|
|
53
|
+
|
|
54
|
+
### Prerequisites
|
|
55
|
+
|
|
56
|
+
- Python 3.10 or higher
|
|
57
|
+
- FastTransfer binary v0.16+ (obtain from [Arpe.io](https://arpe.io))
|
|
58
|
+
- Claude Code or another MCP client
|
|
59
|
+
|
|
60
|
+
### Setup
|
|
61
|
+
|
|
62
|
+
1. **Clone or download this repository**:
|
|
63
|
+
```bash
|
|
64
|
+
cd /path/to/fasttransfer-mcp
|
|
65
|
+
```
|
|
66
|
+
|
|
67
|
+
2. **Install Python dependencies**:
|
|
68
|
+
```bash
|
|
69
|
+
pip install -r requirements.txt
|
|
70
|
+
```
|
|
71
|
+
|
|
72
|
+
3. **Configure environment**:
|
|
73
|
+
```bash
|
|
74
|
+
cp .env.example .env
|
|
75
|
+
# Edit .env with your FastTransfer path
|
|
76
|
+
```
|
|
77
|
+
|
|
78
|
+
4. **Add to Claude Code configuration** (`~/.claude.json`):
|
|
79
|
+
```json
|
|
80
|
+
{
|
|
81
|
+
"mcpServers": {
|
|
82
|
+
"fasttransfer": {
|
|
83
|
+
"type": "stdio",
|
|
84
|
+
"command": "python",
|
|
85
|
+
"args": ["/absolute/path/to/fasttransfer-mcp/src/server.py"],
|
|
86
|
+
"env": {
|
|
87
|
+
"FASTTRANSFER_PATH": "/absolute/path/to/fasttransfer/FastTransfer"
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
```
|
|
93
|
+
|
|
94
|
+
5. **Restart Claude Code** to load the MCP server.
|
|
95
|
+
|
|
96
|
+
6. **Verify installation**:
|
|
97
|
+
```
|
|
98
|
+
# In Claude Code, run:
|
|
99
|
+
/mcp
|
|
100
|
+
# You should see "fasttransfer: connected"
|
|
101
|
+
```
|
|
102
|
+
|
|
103
|
+
## Configuration
|
|
104
|
+
|
|
105
|
+
### Environment Variables
|
|
106
|
+
|
|
107
|
+
Edit `.env` to configure:
|
|
108
|
+
|
|
109
|
+
```bash
|
|
110
|
+
# Path to FastTransfer binary (required)
|
|
111
|
+
FASTTRANSFER_PATH=./fasttransfer/FastTransfer
|
|
112
|
+
|
|
113
|
+
# Execution timeout in seconds (default: 1800 = 30 minutes)
|
|
114
|
+
FASTTRANSFER_TIMEOUT=1800
|
|
115
|
+
|
|
116
|
+
# Log directory (default: ./logs)
|
|
117
|
+
FASTTRANSFER_LOG_DIR=./logs
|
|
118
|
+
|
|
119
|
+
# Log level (default: INFO)
|
|
120
|
+
LOG_LEVEL=INFO
|
|
121
|
+
```
|
|
122
|
+
|
|
123
|
+
## Connection Options
|
|
124
|
+
|
|
125
|
+
The server supports multiple ways to authenticate and connect:
|
|
126
|
+
|
|
127
|
+
| Parameter | Description |
|
|
128
|
+
|-----------|-------------|
|
|
129
|
+
| `server` | Host:port or host\instance (optional with `connect_string` or `dsn`) |
|
|
130
|
+
| `user` / `password` | Standard credentials |
|
|
131
|
+
| `trusted_auth` | Windows trusted authentication |
|
|
132
|
+
| `connect_string` | Full connection string (excludes server/user/password/dsn) |
|
|
133
|
+
| `dsn` | ODBC DSN name (excludes server/provider) |
|
|
134
|
+
| `provider` | OleDB provider name |
|
|
135
|
+
| `file_input` | File path for data input (source only, excludes query) |
|
|
136
|
+
|
|
137
|
+
## Transfer Options
|
|
138
|
+
|
|
139
|
+
| Option | CLI Flag | Description |
|
|
140
|
+
|--------|----------|-------------|
|
|
141
|
+
| `method` | `--method` | Parallelism method |
|
|
142
|
+
| `distribute_key_column` | `--distributeKeyColumn` | Column for data distribution |
|
|
143
|
+
| `degree` | `--degree` | Parallelism degree (0=auto, >0=fixed, <0=CPU adaptive) |
|
|
144
|
+
| `load_mode` | `--loadmode` | Append or Truncate |
|
|
145
|
+
| `batch_size` | `--batchsize` | Batch size for bulk operations |
|
|
146
|
+
| `map_method` | `--mapmethod` | Column mapping: Position or Name |
|
|
147
|
+
| `run_id` | `--runid` | Run ID for logging |
|
|
148
|
+
| `data_driven_query` | `--datadrivenquery` | Custom SQL for DataDriven method |
|
|
149
|
+
| `use_work_tables` | `--useworktables` | Intermediate work tables for CCI |
|
|
150
|
+
| `settings_file` | `--settingsfile` | Custom settings JSON file |
|
|
151
|
+
| `log_level` | `--loglevel` | Override log level (error/warning/information/debug/fatal) |
|
|
152
|
+
| `no_banner` | `--nobanner` | Suppress banner output |
|
|
153
|
+
| `license_path` | `--license` | License file path or URL |
|
|
154
|
+
|
|
155
|
+
## Usage Examples
|
|
156
|
+
|
|
157
|
+
### PostgreSQL to SQL Server Transfer
|
|
158
|
+
|
|
159
|
+
```
|
|
160
|
+
User: "Copy the 'orders' table from PostgreSQL (localhost:5432, database: sales_db,
|
|
161
|
+
schema: public) to SQL Server (localhost:1433, database: warehouse, schema: dbo).
|
|
162
|
+
Use parallel transfer and truncate the target first."
|
|
163
|
+
|
|
164
|
+
Claude Code will:
|
|
165
|
+
1. Call suggest_parallelism_method to recommend Ctid for PostgreSQL
|
|
166
|
+
2. Call preview_transfer_command with your parameters
|
|
167
|
+
3. Show the command with masked passwords
|
|
168
|
+
4. Explain what will happen
|
|
169
|
+
5. Ask for confirmation
|
|
170
|
+
6. Execute with execute_transfer when you approve
|
|
171
|
+
```
|
|
172
|
+
|
|
173
|
+
### File Import via DuckDB Stream
|
|
174
|
+
|
|
175
|
+
```
|
|
176
|
+
User: "Import /data/export.parquet into the SQL Server 'staging' table
|
|
177
|
+
using DuckDB stream."
|
|
178
|
+
|
|
179
|
+
Claude Code will use duckdbstream source type with file_input parameter.
|
|
180
|
+
```
|
|
181
|
+
|
|
182
|
+
### Check Version and Capabilities
|
|
183
|
+
|
|
184
|
+
```
|
|
185
|
+
User: "What version of FastTransfer is installed?"
|
|
186
|
+
|
|
187
|
+
Claude Code will call get_version and display the detected version,
|
|
188
|
+
supported source/target types, and available features.
|
|
189
|
+
```
|
|
190
|
+
|
|
191
|
+
## Two-Step Safety Process
|
|
192
|
+
|
|
193
|
+
This server implements a mandatory two-step process:
|
|
194
|
+
|
|
195
|
+
1. **Preview** - Always use `preview_transfer_command` first
|
|
196
|
+
2. **Execute** - Use `execute_transfer` with `confirmation: true`
|
|
197
|
+
|
|
198
|
+
You cannot execute without previewing first and confirming.
|
|
199
|
+
|
|
200
|
+
## Security
|
|
201
|
+
|
|
202
|
+
- Passwords and connection strings are masked in all output and logs
|
|
203
|
+
- Sensitive flags masked: `--sourcepassword`, `--targetpassword`, `--sourceconnectstring`, `--targetconnectstring`, `-x`, `-X`, `-g`, `-G`
|
|
204
|
+
- Use environment variables for sensitive configuration
|
|
205
|
+
- Review commands carefully before executing
|
|
206
|
+
- Use minimum required database permissions
|
|
207
|
+
|
|
208
|
+
## Testing
|
|
209
|
+
|
|
210
|
+
Run the test suite:
|
|
211
|
+
|
|
212
|
+
```bash
|
|
213
|
+
# Run all tests
|
|
214
|
+
python -m pytest tests/ -v
|
|
215
|
+
|
|
216
|
+
# Run with coverage
|
|
217
|
+
python -m pytest tests/ --cov=src --cov-report=html
|
|
218
|
+
```
|
|
219
|
+
|
|
220
|
+
## Project Structure
|
|
221
|
+
|
|
222
|
+
```
|
|
223
|
+
fasttransfer-mcp/
|
|
224
|
+
src/
|
|
225
|
+
__init__.py
|
|
226
|
+
server.py # MCP server (tool definitions, handlers)
|
|
227
|
+
fasttransfer.py # Command builder, executor, suggestions
|
|
228
|
+
validators.py # Pydantic models, enums, validation
|
|
229
|
+
version.py # Version detection and capabilities registry
|
|
230
|
+
tests/
|
|
231
|
+
__init__.py
|
|
232
|
+
test_command_builder.py
|
|
233
|
+
test_validators.py
|
|
234
|
+
test_version.py
|
|
235
|
+
.env.example
|
|
236
|
+
requirements.txt
|
|
237
|
+
CHANGELOG.md
|
|
238
|
+
README.md
|
|
239
|
+
```
|
|
240
|
+
|
|
241
|
+
## License
|
|
242
|
+
|
|
243
|
+
This MCP server wrapper is provided as-is. FastTransfer itself is a separate product from Arpe.io.
|
|
244
|
+
|
|
245
|
+
## Related Links
|
|
246
|
+
|
|
247
|
+
- [FastTransfer Documentation](https://aetperf.github.io/FastTransfer-Documentation/)
|
|
248
|
+
- [Model Context Protocol](https://modelcontextprotocol.io/)
|
|
249
|
+
- [Claude Code](https://claude.com/claude-code)
|