Skip to content

Commit 92ca52e

Browse files
author
Daniele Briggi
committed
chore: remove logs
1 parent 365d929 commit 92ca52e

File tree

5 files changed

+66
-52
lines changed

5 files changed

+66
-52
lines changed

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
{
22
"name": "@sqlitecloud/mcp-server",
3-
"version": "0.0.1",
3+
"version": "0.1.0",
44
"description": "Model Context Protocol server for SQLite Cloud database",
55
"author": "SQLite Cloud",
6-
"homepage": "https://sqlitecloud.ai",
6+
"homepage": "https://sqlitecloud.io/ai",
77
"repository": {
88
"url": "https://github.com/sqlitecloud/sqlitecloud-mcp-server",
99
"type": "git"

readme.md

Lines changed: 62 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -1,48 +1,61 @@
11
# Model Context Protocol (MCP) Server for SQLite Cloud
2+
> _This project is currently in the experimental phase. Feel free to explore, report issues, and share your feedback._
3+
4+
![mcp-demonstration](https://private-user-images.githubusercontent.com/6153996/436944588-e374f8f0-1bc6-4079-ae3e-21bfe842c412.gif)
25

36
## Overview
4-
The MCP Server for SQLite Cloud is designed to allow interaction with your SQLite Cloud databases using the AI Agent. It leverages the Model Context Protocol (MCP) to provide an interface for executing queries, commands and analyzing query performance.
7+
The MCP Server for SQLite Cloud enables seamless interaction with SQLite Cloud databases using the AI Agent. It utilizes the Model Context Protocol (MCP) to provide tools for executing queries, managing schemas, and analyzing query performance.
58

69
## Features
7-
- **Execute Queries**: Run `SELECT`, `INSERT`, `UPDATE`, and `DELETE` SQL queries on SQLite Cloud databases.
8-
- **Schema Management**: Create new tables, list existing tables, and retrieve schema information for specific tables.
9-
- **Command Execution**: Execute predefined commands supported by SQLite Cloud.
10-
- **Performance Analysis**: Analyze the slowest queries, gather information about query plans, and reset query statistics.
10+
- **Query Execution**: Perform `SELECT`, `INSERT`, `UPDATE`, and `DELETE` SQL operations on SQLite Cloud databases.
11+
- **Schema Management**: Create tables, list existing ones, and retrieve schema details.
12+
- **Command Execution**: Run predefined commands supported by SQLite Cloud.
13+
- **Performance Analysis**: Identify slow queries, analyze query plans, and reset query statistics.
1114

1215
## Tools
13-
The MCP Server provides the following tools:
14-
15-
1. **read-query**: Execute `SELECT` queries and retrieve results.
16-
2. **write-query**: Execute `INSERT`, `UPDATE`, or `DELETE` queries.
17-
3. **create-table**: Create new tables in the database.
18-
4. **list-tables**: List all tables in the database.
19-
5. **describe-table**: Retrieve schema information for a specific table.
20-
6. **list-commands**: List all available commands and fetch external documentation.
21-
7. **execute-command**: Execute commands listed in the `list-commands` tool.
22-
8. **list-analyzer**: Analyze the slowest queries with optional filters.
23-
9. **analyzer-plan-id**: Gather information about query plans and indexes.
16+
The MCP Server offers the following tools:
17+
18+
1. **read-query**: Perform `SELECT` queries and fetch results.
19+
2. **write-query**: Perform `INSERT`, `UPDATE`, or `DELETE` operations.
20+
3. **create-table**: Create new database tables.
21+
4. **list-tables**: Display all tables in the database.
22+
5. **describe-table**: Retrieve schema details for a specific table.
23+
6. **list-commands**: List available commands and access external documentation.
24+
7. **execute-command**: Run commands from the `list-commands` tool.
25+
8. **list-analyzer**: Analyze slow queries with optional filters.
26+
9. **analyzer-plan-id**: Gather details about query plans and indexes.
2427
10. **analyzer-reset**: Reset query statistics for specific queries, groups, or databases.
2528

2629
## Getting Started
27-
To use the MCP Server, ensure you have a valid connection string for your SQLite Cloud database. The server can be started using the following command:
30+
To use the MCP Server, create a [free account on SQLite Cloud](https://sqlitecloud.io) and get your _Connection String_.
31+
Start the server with the following command:
2832

2933
```bash
3034
npx @sqlitecloud/mcp-server --connectionString <your_connection_string>
3135
```
3236

33-
Replace `<your_connection_string>` with the appropriate connection string for your SQLite Cloud project.
37+
Replace `<your_connection_string>` with your SQLite Cloud connection string.
38+
39+
## Configure Your AI Agent
3440

35-
## Configure your AI Agent
41+
### Requirements
3642

37-
### VSCode
43+
Ensure Node.js is installed on your machine with:
44+
```bash
45+
node -v
46+
```
3847

39-
[Official documentation](https://code.visualstudio.com/docs/copilot/chat/mcp-servers)
48+
If Node.js is not installed, you can download it from [nodejs.org](https://nodejs.org/).
4049

41-
1. **Locate the settings.json file**: Open `VSCode Settings` and search for `mcp`. Edit the `User`'s `settings.json`.
50+
### VSCode Integration
4251

43-
> _MCP requires your connection string and it's not safe to keep it into the project's VSCode settings._
52+
Refer to the [official documentation](https://code.visualstudio.com/docs/copilot/chat/mcp-servers) for detailed instructions.
4453

45-
2. **Add the MCP configuration**: Include the following configuration in the settings.json file:
54+
1. **Edit `settings.json`**: Open VSCode settings and search for `mcp`. Modify the `User`'s `settings.json` file.
55+
56+
> _Note: Avoid storing your connection string in the project's VSCode settings for security reasons._
57+
58+
2. **Add MCP Configuration**: Include the following in `settings.json`:
4659

4760
```json
4861
{
@@ -54,7 +67,7 @@ Replace `<your_connection_string>` with the appropriate connection string for yo
5467
"type": "stdio",
5568
"command": "node",
5669
"args": [
57-
"./build/index.ts",
70+
"./build/index.js",
5871
"--connectionString",
5972
"<CONNECTION_STRING>"
6073
]
@@ -64,7 +77,7 @@ Replace `<your_connection_string>` with the appropriate connection string for yo
6477
"type": "stdio",
6578
"command": "npx",
6679
"args": [
67-
"y"
80+
"-y"
6881
"@sqlitecloud/mcp-server",
6982
"--connectionString",
7083
"<CONNECTION_STRING>"
@@ -77,54 +90,59 @@ Replace `<your_connection_string>` with the appropriate connection string for yo
7790
"headers": {
7891
"Authorization": "Bearer <CONNECTION_STRING>"
7992
}
80-
},
93+
}
8194
}
8295
}
8396
}
8497
```
8598

86-
# Development
87-
88-
## Build
99+
## Development
89100

101+
### Build
90102

91103
```bash
92104
npm run build
93105
```
94106

95-
## Run
96-
Build the package and then run it:
107+
### Run
108+
After building the package, run it with:
97109

98110
```bash
99111
node build/index.js --connectionString <CONNECTION_STRING>
100112
```
101113

102-
## Locally test the package
114+
### Local Testing
115+
116+
To locally test the package:
117+
118+
1. Pack the package:
103119

104120
```bash
105121
npm pack
106122
```
107123

108-
Then:
124+
2. Run the packed file:
125+
109126
```bash
110127
npx <PACKAGE_FILENAME>.tgz --connectionString <CONNECTION_STRING>
111128
```
112129

113-
## Inspection
114-
Use the inspector to test both `stdio` and `sse` transports.
115-
First build the package then run:
130+
### Inspection
131+
Use the inspector to test `stdio` and `sse` transports. First, build the package, then run:
132+
116133
```bash
117134
npx @modelcontextprotocol/inspector@latest
118135
```
119-
and open it at the page: http://127.0.0.1:6274/
120136

121-
### Stdio Transport
122-
- **Transport type**: `stdio`
137+
Access the inspector at: [http://127.0.0.1:6274/](http://127.0.0.1:6274/)
138+
139+
#### Stdio Transport
140+
- **Transport Type**: `stdio`
123141
- **Command**: `npx`
124-
- **Arguments**: `<PATH_TO_PACKAGE_FOLDER> --connectionString <CONNECTION_STRING>`
142+
- **Arguments**: `<PATH_TO_PACKAGE_FOLDER> --connectionString <CONNECTION_STRING>`
125143

126-
_Note: use the `PATH_TO_PACKAGE_FOLDER` from your home directory or you might get permission errors_
144+
_Note: Use the `PATH_TO_PACKAGE_FOLDER` from your home directory to avoid permission issues._
127145

128-
### SSE Transport
129-
To test `sse` transport to a remote or local server use
146+
#### SSE Transport
147+
To test `sse` transport with a remote or local server:
130148
- **URL**: `http://localhost:8090/v1/mcp/sse`

src/index.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ import { parseArgs } from 'util'
88
const server = new SQLiteCloudMcpServer()
99

1010
async function main() {
11-
console.log('Starting SQLite Cloud MCP Server...')
11+
// console.debug('Starting SQLite Cloud MCP Server...')
1212
const {
1313
values: { connectionString }
1414
} = parseArgs({
@@ -25,7 +25,7 @@ async function main() {
2525

2626
const transport = new SQLiteCloudMcpTransport(connectionString, new StdioServerTransport())
2727
await server.connect(transport)
28-
console.info('SQLite Cloud MCP Server running on stdio')
28+
// console.debug('SQLite Cloud MCP Server running on stdio')
2929
}
3030

3131
main().catch(error => {

src/server.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,6 @@ export class SQLiteCloudMcpServer {
8686
query: z.string().describe('SELECT SQL query to execute')
8787
},
8888
async ({ query }, extra) => {
89-
// console.log("Executing read-query with query:", query, "and parameters:", parameters);
9089
if (!query.trim().toUpperCase().startsWith('SELECT')) {
9190
throw new Error('Only SELECT queries are allowed for read-query')
9291
}
@@ -107,7 +106,6 @@ export class SQLiteCloudMcpServer {
107106
query: z.string().describe('SELECT SQL query to execute')
108107
},
109108
async ({ query }, extra) => {
110-
// console.log("Executing write-query with query:", query, "and parameters:", parameters);
111109
if (query.trim().toUpperCase().startsWith('SELECT')) {
112110
throw new Error('SELECT queries are not allowed for write_query')
113111
}

src/sqlitecloudTransport.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,6 @@ export class SQLiteCloudMcpTransport {
99
if (err) {
1010
console.error('Error opening database:', err)
1111
throw err
12-
} else {
13-
console.info('Database connected')
1412
}
1513
})
1614
}

0 commit comments

Comments
 (0)