ajan-sql 0.1.0 → 0.1.2
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 +84 -9
- package/package.json +10 -2
package/README.md
CHANGED
|
@@ -1,14 +1,42 @@
|
|
|
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
|
|
|
7
37
|
`ajan-sql` is an npm package for running an MCP server over stdio with a PostgreSQL backend.
|
|
8
38
|
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
> psql + schema awareness + AI-safe guard layer
|
|
39
|
+
`ajan-sql` provides schema-aware, read-only PostgreSQL access for MCP and AI workflows.
|
|
12
40
|
|
|
13
41
|
## Goals
|
|
14
42
|
|
|
@@ -52,12 +80,37 @@ These rules should never be bypassed.
|
|
|
52
80
|
- `explain_query`
|
|
53
81
|
- `sample_rows`
|
|
54
82
|
|
|
83
|
+
## Tool Matrix
|
|
84
|
+
|
|
85
|
+
| Tool | Purpose | Inputs | Guarded |
|
|
86
|
+
| --- | --- | --- | --- |
|
|
87
|
+
| `list_tables` | List visible database tables | None | N/A |
|
|
88
|
+
| `describe_table` | Describe columns and types for one table | `name`, optional `schema` | N/A |
|
|
89
|
+
| `list_relationships` | List foreign key relationships | None | N/A |
|
|
90
|
+
| `run_readonly_query` | Execute a readonly `SELECT` query | `sql` | Yes |
|
|
91
|
+
| `explain_query` | Return JSON execution plan for a readonly query | `sql` | Yes |
|
|
92
|
+
| `sample_rows` | Return a limited sample from a table | `name`, optional `schema`, optional `limit` | Yes |
|
|
93
|
+
|
|
55
94
|
## Available MCP Resources
|
|
56
95
|
|
|
57
96
|
- `schema://snapshot`
|
|
58
97
|
- `schema://table/{name}`
|
|
59
98
|
|
|
60
|
-
##
|
|
99
|
+
## Install
|
|
100
|
+
|
|
101
|
+
Install the CLI globally from npm:
|
|
102
|
+
|
|
103
|
+
```bash
|
|
104
|
+
npm install -g ajan-sql
|
|
105
|
+
```
|
|
106
|
+
|
|
107
|
+
Run it with a PostgreSQL connection string:
|
|
108
|
+
|
|
109
|
+
```bash
|
|
110
|
+
DATABASE_URL=postgres://USER:PASSWORD@HOST:PORT/DB ajan-sql
|
|
111
|
+
```
|
|
112
|
+
|
|
113
|
+
## Local Development
|
|
61
114
|
|
|
62
115
|
Start the server with a PostgreSQL connection string:
|
|
63
116
|
|
|
@@ -74,7 +127,22 @@ DATABASE_URL=postgres://USER:PASSWORD@HOST:PORT/DB npm start
|
|
|
74
127
|
|
|
75
128
|
## Client Configuration
|
|
76
129
|
|
|
77
|
-
For MCP clients that launch
|
|
130
|
+
For MCP clients that launch globally installed stdio servers:
|
|
131
|
+
|
|
132
|
+
```json
|
|
133
|
+
{
|
|
134
|
+
"mcpServers": {
|
|
135
|
+
"ajan-sql": {
|
|
136
|
+
"command": "ajan-sql",
|
|
137
|
+
"env": {
|
|
138
|
+
"DATABASE_URL": "postgres://USER:PASSWORD@HOST:PORT/DB"
|
|
139
|
+
}
|
|
140
|
+
}
|
|
141
|
+
}
|
|
142
|
+
}
|
|
143
|
+
```
|
|
144
|
+
|
|
145
|
+
For repository-local development builds, point the command to the built CLI and provide `DATABASE_URL`:
|
|
78
146
|
|
|
79
147
|
```json
|
|
80
148
|
{
|
|
@@ -94,6 +162,13 @@ For MCP clients that launch local stdio servers, point the command to the built
|
|
|
94
162
|
|
|
95
163
|
The repository supports local PostgreSQL integration testing during development, but any Docker compose files or seeded local test databases can remain untracked and machine-local.
|
|
96
164
|
|
|
165
|
+
## Project Docs
|
|
166
|
+
|
|
167
|
+
- [Changelog](./CHANGELOG.md)
|
|
168
|
+
- [Roadmap](./ROADMAP.md)
|
|
169
|
+
- [Contributing](./CONTRIBUTING.md)
|
|
170
|
+
- [Security Policy](./SECURITY.md)
|
|
171
|
+
|
|
97
172
|
## Development Principles
|
|
98
173
|
|
|
99
174
|
- Keep functions small and composable
|
|
@@ -114,7 +189,7 @@ The CLI will:
|
|
|
114
189
|
|
|
115
190
|
## Status
|
|
116
191
|
|
|
117
|
-
Early development. Schema inspection, readonly query execution, query explain, and sample row tools are implemented. The CLI is
|
|
192
|
+
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
193
|
|
|
119
194
|
## License
|
|
120
195
|
|
package/package.json
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "ajan-sql",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.2",
|
|
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",
|