@teckedd-code2save/datafy 0.17.0

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.
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2025 Bytebase
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.
package/README.md ADDED
@@ -0,0 +1,115 @@
1
+ # Datafy
2
+
3
+ > [!NOTE]
4
+ > Datafy is deeply rooted in and built upon [DBHub](https://github.com/bytebase/dbhub). Their documentation and implementation remain a highly relevant foundation.
5
+
6
+
7
+
8
+ ## Database MCP Gateway Architecture
9
+
10
+ ```text
11
+ ____ _ __
12
+ | _ \ __ _| |_ __ _ / _|_ _
13
+ | | | |/ _` | __/ _` | |_| | | |
14
+ | |_| | (_| | || (_| | _| |_| |
15
+ |____/ \__,_|\__\__,_|_| \__, |
16
+ |___/
17
+ ```
18
+
19
+ ```bash
20
+ +------------------+ +--------------+ +------------------+
21
+ | | | | | |
22
+ | | | | | |
23
+ | Claude Desktop +--->+ +--->+ PostgreSQL |
24
+ | | | | | |
25
+ | Claude Code +--->+ +--->+ SQL Server |
26
+ | | | | | |
27
+ | Cursor +--->+ Datafy +--->+ SQLite |
28
+ | | | | | |
29
+ | VS Code +--->+ +--->+ MySQL/MariaDB |
30
+ | | | | | |
31
+ | Copilot CLI +--->+ +--->+ Redis |
32
+ | | | | | |
33
+ | | | +--->+ Elasticsearch |
34
+ | | | | | |
35
+ +------------------+ +--------------+ +------------------+
36
+ MCP Clients MCP Server Databases
37
+ ```
38
+
39
+ Datafy is a zero-dependency, token efficient MCP server implementing the Model Context Protocol (MCP) server interface. This lightweight gateway allows MCP-compatible clients to connect to and explore different databases:
40
+
41
+ - **Local Development First**: Zero dependency, token efficient with just two MCP tools to maximize context window
42
+ - **Multi-Database**: PostgreSQL, MySQL, MariaDB, SQL Server, SQLite, Redis, and Elasticsearch through a single interface
43
+ - **Multi-Connection**: Connect to multiple databases simultaneously with TOML configuration
44
+ - **Guardrails**: Read-only mode, row limiting, and query timeout to prevent runaway operations
45
+ - **Secure Access**: SSH tunneling and SSL/TLS encryption
46
+
47
+ ## Supported Databases
48
+
49
+ PostgreSQL, MySQL, SQL Server, MariaDB, SQLite, Redis, and Elasticsearch.
50
+
51
+ ## MCP Tools
52
+
53
+ Datafy implements MCP tools for database operations:
54
+
55
+ - **[execute_sql](https://dbhub.ai/tools/execute-sql)**: Execute SQL queries with transaction support and safety controls
56
+ - **[search_objects](https://dbhub.ai/tools/search-objects)**: Search and explore database schemas, tables, columns, indexes, and procedures with progressive disclosure
57
+ - **[redis_command](https://redis.io/commands/)**: Execute Redis commands (e.g., GET, SET, HGETALL) directly
58
+ - **[elasticsearch_search](https://www.elastic.co/guide/en/elasticsearch/reference/current/search-your-data.html)**: Execute Elasticsearch queries using JSON DSL or simplified syntax
59
+ - **[Custom Tools](https://dbhub.ai/tools/custom-tools)**: Define reusable, parameterized SQL operations in your `dbhub.toml` configuration file
60
+
61
+
62
+
63
+ ## Installation
64
+
65
+ See the full [Installation Guide](https://dbhub.ai/installation) for detailed instructions.
66
+
67
+ ### Quick Start
68
+
69
+ **Docker:**
70
+
71
+ ```bash
72
+ docker run --rm --init \
73
+ --name datafy \
74
+ --publish 8080:8080 \
75
+ teckedd-code2save/datafy \
76
+ --transport http \
77
+ --port 8080 \
78
+ --dsn "postgres://user:password@localhost:5432/dbname?sslmode=disable"
79
+ ```
80
+
81
+ **NPM:**
82
+
83
+ ```bash
84
+ npx @teckedd-code2save/datafy@latest --transport http --port 8080 --dsn "postgres://user:password@localhost:5432/dbname?sslmode=disable"
85
+ ```
86
+
87
+ **Demo Mode:**
88
+
89
+ ```bash
90
+ npx @teckedd-code2save/datafy@latest --transport http --port 8080 --demo
91
+ ```
92
+
93
+ See [Command-Line Options](https://dbhub.ai/config/command-line) for all available parameters.
94
+
95
+ ### Multi-Database Setup
96
+
97
+ Connect to multiple databases simultaneously using TOML configuration files. Perfect for managing production, staging, and development databases from a single Datafy instance.
98
+
99
+ See [Multi-Database Configuration](https://dbhub.ai/config/toml) for complete setup instructions.
100
+
101
+ ## Development
102
+
103
+ ```bash
104
+ # Install dependencies
105
+ pnpm install
106
+
107
+ # Run in development mode
108
+ pnpm dev
109
+
110
+ # Build and run for production
111
+ pnpm build && pnpm start --transport stdio --dsn "postgres://user:password@localhost:5432/dbname"
112
+ ```
113
+
114
+ See [Testing](.claude/skills/testing/SKILL.md) and [Debug](https://dbhub.ai/config/debug).
115
+