Lukynnnn commited on
Commit
34abc80
·
verified ·
1 Parent(s): 8022fba

Upload README.md with huggingface_hub

Browse files
Files changed (1) hide show
  1. README.md +56 -29
README.md CHANGED
@@ -1,49 +1,76 @@
1
- # MCP Database Server
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2
 
3
- Reasoning interface for databases — not a thin wrapper.
4
 
5
- ## Features
6
 
7
- - **7 reasoning tools** for AI agents to work with databases
8
- - **Multi-engine**: SQLite (built-in), PostgreSQL, MySQL, MSSQL (optional)
9
- - **Safety first**: read-only default, parameterized queries, injection prevention
10
- - **LLM-friendly output**: types translated, NULLs handled, results contextualized
11
- - **Schema introspection**: auto-discover tables, columns, relationships, indexes
12
- - **Natural language queries**: ask questions in plain text, get SQL + results
13
 
14
- ## Install
 
 
 
 
 
 
 
 
15
 
16
  ```bash
17
  pip install mcp-database-universal
18
-
19
- # With optional engines:
20
- pip install "mcp-database-server[postgres]"
21
- pip install "mcp-database-server[mysql]"
22
- pip install "mcp-database-server[mssql]"
23
  ```
24
 
25
- ## Usage
26
 
 
27
  ```bash
28
- DATABASE_URL=sqlite:///mydb.db python -m mcp_database_universal
29
  ```
30
 
31
- ## Docker
32
-
33
  ```bash
34
- docker build -t mcp-db .
35
- docker run --rm -i -e DATABASE_URL=sqlite:///:memory: mcp-db
36
  ```
37
 
38
- ## Configuration
 
 
 
 
 
 
 
 
 
39
 
40
- | Variable | Default | Description |
41
- |----------|---------|-------------|
42
- | `DATABASE_URL` | (required) | Connection URL |
43
- | `DATABASE_READ_ONLY` | `true` | Read-only mode |
44
- | `DATABASE_MAX_ROWS` | `1000` | Max rows per query |
45
- | `DATABASE_MAX_QUERY_TIME` | `30` | Query timeout (seconds) |
 
 
 
46
 
47
  ## License
48
 
49
- MIT
 
1
+ ---
2
+ language:
3
+ - en
4
+ tags:
5
+ - mcp
6
+ - model-context-protocol
7
+ - ai-tools
8
+ - database
9
+ - sqlite
10
+ - postgresql
11
+ - mysql
12
+ - mssql
13
+ library_name: mcp-database-universal
14
+ license: mit
15
+ ---
16
 
17
+ # MCP Database Universal
18
 
19
+ A reasoning interface for databases — not a thin execution wrapper. Designed so LLM agents understand *what* the data means, not just how to fetch it.
20
 
21
+ ## What it does
 
 
 
 
 
22
 
23
+ - **7 tools** designed for agent thinking: `test_connection`, `list_tables`, `inspect_table`, `query`, `natural_query`, `profile_database`, `schema_graph`
24
+ - **4 database engines**: SQLite (built-in), PostgreSQL, MySQL, MSSQL (optional extras)
25
+ - **Read-only by default** — write operations only with `DATABASE_WRITE_ENABLED=true`
26
+ - **Safety layer** — SQL injection detection, read-only classification, LIMIT enforcement, 30s timeout, 1000-row limit
27
+ - **LLM formatter** — type translation (e.g. `VARCHAR(255)` → "text, max 255 chars"), NULL → `(empty)`, truncation to 50KB
28
+ - **Schema inspector** — relationship discovery + Mermaid ER diagram generation
29
+ - **Zero-config SQLite** via `DATABASE_URL=sqlite:///path/to.db`
30
+
31
+ ## Installation
32
 
33
  ```bash
34
  pip install mcp-database-universal
35
+ pip install "mcp-database-universal[postgres]" # PostgreSQL support
36
+ pip install "mcp-database-universal[mysql]" # MySQL support
37
+ pip install "mcp-database-universal[mssql]" # MSSQL support
 
 
38
  ```
39
 
40
+ ## Quick Start
41
 
42
+ ### Run locally
43
  ```bash
44
+ python -m mcp_database_universal
45
  ```
46
 
47
+ ### Run with Docker
 
48
  ```bash
49
+ docker run -i -e DATABASE_URL=sqlite:////data/app.db \
50
+ -v ./data:/data mcp-database-universal:latest
51
  ```
52
 
53
+ ## Configuration (env vars)
54
+
55
+ | Variable | Description | Default |
56
+ |----------|-------------|---------|
57
+ | `DATABASE_URL` | `sqlite:///path.db`, `postgresql://...`, `mysql://...`, `mssql://...` | required |
58
+ | `DATABASE_WRITE_ENABLED` | Allow write operations (INSERT/UPDATE/DELETE) | `false` |
59
+ | `DATABASE_QUERY_LIMIT` | Max rows returned per query | `1000` |
60
+ | `DATABASE_TIMEOUT` | Query timeout in seconds | `30` |
61
+
62
+ ## Tools
63
 
64
+ | Tool | Description |
65
+ |------|-------------|
66
+ | `test_connection` | Verify connection, get engine type, version, size |
67
+ | `list_tables` | Overview of tables with row counts and relationships |
68
+ | `inspect_table` | Full table structure: columns, types, keys, sample data |
69
+ | `query` | Execute parametrized, safety-checked SQL |
70
+ | `natural_query` | Ask in plain language, get SQL + results + explanation |
71
+ | `profile_database` | Value distributions, NULL rates, relationships, sizes |
72
+ | `schema_graph` | Mermaid ER diagram of relationships |
73
 
74
  ## License
75
 
76
+ MIT