ajan-sql 0.1.0 → 0.1.1
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/README.md +76 -6
- package/package.json +10 -2
package/README.md
CHANGED
|
@@ -1,6 +1,36 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
<p align="center">
|
|
2
|
+
<img src="./assets/cover.svg" alt="ajan-sql cover" width="860" />
|
|
3
|
+
</p>
|
|
4
|
+
|
|
5
|
+
<p align="center">
|
|
6
|
+
<a href="https://www.npmjs.com/package/ajan-sql">
|
|
7
|
+
<img src="https://img.shields.io/npm/v/ajan-sql" alt="npm version" />
|
|
8
|
+
</a>
|
|
9
|
+
<a href="https://www.npmjs.com/package/ajan-sql">
|
|
10
|
+
<img src="https://img.shields.io/npm/dm/ajan-sql" alt="npm downloads" />
|
|
11
|
+
</a>
|
|
12
|
+
<a href="https://github.com/borakilicoglu/ajan-sql/releases">
|
|
13
|
+
<img src="https://img.shields.io/github/v/release/borakilicoglu/ajan-sql" alt="github release" />
|
|
14
|
+
</a>
|
|
15
|
+
<a href="https://borakilicoglu.github.io/ajan-sql/">
|
|
16
|
+
<img src="https://img.shields.io/badge/docs-vitepress-5d98ea" alt="docs" />
|
|
17
|
+
</a>
|
|
18
|
+
<a href="./LICENSE">
|
|
19
|
+
<img src="https://img.shields.io/badge/license-MIT-lightgrey" alt="license" />
|
|
20
|
+
</a>
|
|
21
|
+
</p>
|
|
22
|
+
|
|
23
|
+
<p align="center">
|
|
24
|
+
<a href="https://github.com/borakilicoglu/ajan-sql">GitHub Repository</a>
|
|
25
|
+
</p>
|
|
26
|
+
|
|
27
|
+
<p align="center">
|
|
28
|
+
<a href="https://www.npmjs.com/package/ajan-sql">npm Package</a>
|
|
29
|
+
</p>
|
|
30
|
+
|
|
31
|
+
<p align="center">
|
|
32
|
+
AI-safe MCP server for schema-aware, read-only SQL access.
|
|
33
|
+
</p>
|
|
4
34
|
|
|
5
35
|
## Overview
|
|
6
36
|
|
|
@@ -52,12 +82,37 @@ These rules should never be bypassed.
|
|
|
52
82
|
- `explain_query`
|
|
53
83
|
- `sample_rows`
|
|
54
84
|
|
|
85
|
+
## Tool Matrix
|
|
86
|
+
|
|
87
|
+
| Tool | Purpose | Inputs | Guarded |
|
|
88
|
+
| --- | --- | --- | --- |
|
|
89
|
+
| `list_tables` | List visible database tables | None | N/A |
|
|
90
|
+
| `describe_table` | Describe columns and types for one table | `name`, optional `schema` | N/A |
|
|
91
|
+
| `list_relationships` | List foreign key relationships | None | N/A |
|
|
92
|
+
| `run_readonly_query` | Execute a readonly `SELECT` query | `sql` | Yes |
|
|
93
|
+
| `explain_query` | Return JSON execution plan for a readonly query | `sql` | Yes |
|
|
94
|
+
| `sample_rows` | Return a limited sample from a table | `name`, optional `schema`, optional `limit` | Yes |
|
|
95
|
+
|
|
55
96
|
## Available MCP Resources
|
|
56
97
|
|
|
57
98
|
- `schema://snapshot`
|
|
58
99
|
- `schema://table/{name}`
|
|
59
100
|
|
|
60
|
-
##
|
|
101
|
+
## Install
|
|
102
|
+
|
|
103
|
+
Install the CLI globally from npm:
|
|
104
|
+
|
|
105
|
+
```bash
|
|
106
|
+
npm install -g ajan-sql
|
|
107
|
+
```
|
|
108
|
+
|
|
109
|
+
Run it with a PostgreSQL connection string:
|
|
110
|
+
|
|
111
|
+
```bash
|
|
112
|
+
DATABASE_URL=postgres://USER:PASSWORD@HOST:PORT/DB ajan-sql
|
|
113
|
+
```
|
|
114
|
+
|
|
115
|
+
## Local Development
|
|
61
116
|
|
|
62
117
|
Start the server with a PostgreSQL connection string:
|
|
63
118
|
|
|
@@ -74,7 +129,22 @@ DATABASE_URL=postgres://USER:PASSWORD@HOST:PORT/DB npm start
|
|
|
74
129
|
|
|
75
130
|
## Client Configuration
|
|
76
131
|
|
|
77
|
-
For MCP clients that launch
|
|
132
|
+
For MCP clients that launch globally installed stdio servers:
|
|
133
|
+
|
|
134
|
+
```json
|
|
135
|
+
{
|
|
136
|
+
"mcpServers": {
|
|
137
|
+
"ajan-sql": {
|
|
138
|
+
"command": "ajan-sql",
|
|
139
|
+
"env": {
|
|
140
|
+
"DATABASE_URL": "postgres://USER:PASSWORD@HOST:PORT/DB"
|
|
141
|
+
}
|
|
142
|
+
}
|
|
143
|
+
}
|
|
144
|
+
}
|
|
145
|
+
```
|
|
146
|
+
|
|
147
|
+
For repository-local development builds, point the command to the built CLI and provide `DATABASE_URL`:
|
|
78
148
|
|
|
79
149
|
```json
|
|
80
150
|
{
|
|
@@ -114,7 +184,7 @@ The CLI will:
|
|
|
114
184
|
|
|
115
185
|
## Status
|
|
116
186
|
|
|
117
|
-
Early development. Schema inspection, readonly query execution, query explain, and sample row tools are implemented. The CLI is
|
|
187
|
+
Early development. Schema inspection, readonly query execution, query explain, and sample row tools are implemented. The CLI is published on npm, and current package version is `0.1.1`.
|
|
118
188
|
|
|
119
189
|
## License
|
|
120
190
|
|
package/package.json
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "ajan-sql",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.1",
|
|
4
4
|
"description": "AI-safe MCP server for schema-aware, read-only SQL access.",
|
|
5
5
|
"bin": {
|
|
6
|
-
"ajan-sql": "
|
|
6
|
+
"ajan-sql": "dist/index.js"
|
|
7
7
|
},
|
|
8
8
|
"files": [
|
|
9
9
|
"dist",
|
|
@@ -34,6 +34,14 @@
|
|
|
34
34
|
],
|
|
35
35
|
"author": "Bora Kilicoglu",
|
|
36
36
|
"license": "MIT",
|
|
37
|
+
"repository": {
|
|
38
|
+
"type": "git",
|
|
39
|
+
"url": "https://github.com/borakilicoglu/ajan-sql"
|
|
40
|
+
},
|
|
41
|
+
"homepage": "https://github.com/borakilicoglu/ajan-sql#readme",
|
|
42
|
+
"bugs": {
|
|
43
|
+
"url": "https://github.com/borakilicoglu/ajan-sql/issues"
|
|
44
|
+
},
|
|
37
45
|
"type": "commonjs",
|
|
38
46
|
"dependencies": {
|
|
39
47
|
"@modelcontextprotocol/sdk": "^1.18.0",
|