Skip to content

Commit a85d6a3

Browse files
author
Daniele Briggi
committed
chore(prettier): add rules and format files
1 parent efbf645 commit a85d6a3

File tree

6 files changed

+188
-253
lines changed

6 files changed

+188
-253
lines changed

package.json

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,5 +28,12 @@
2828
"devDependencies": {
2929
"@types/node": "^22.14.0",
3030
"typescript": "^5.8.3"
31+
},
32+
"prettier": {
33+
"semi": false,
34+
"singleQuote": true,
35+
"trailingComma": "none",
36+
"arrowParens": "avoid",
37+
"printWidth": 240
3138
}
3239
}

readme.md

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# Model Context Protocol (MCP) Server for SQLite Cloud
22

33
## Overview
4-
The MCP Server for SQLite Cloud is designed to facilitate seamless interaction with SQLite Cloud databases. It leverages the Model Context Protocol (MCP) to provide an interface for executing queries, commands and analyzing query performance.
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.
55

66
## Features
77
- **Execute Queries**: Run `SELECT`, `INSERT`, `UPDATE`, and `DELETE` SQL queries on SQLite Cloud databases.
@@ -32,13 +32,15 @@ npx @sqlitecloud/mcp-server --connectionString <your_connection_string>
3232

3333
Replace `<your_connection_string>` with the appropriate connection string for your SQLite Cloud project.
3434

35-
## Configure in your AI Agent
35+
## Configure your AI Agent
3636

3737
### VSCode
3838

3939
[Official documentation](https://code.visualstudio.com/docs/copilot/chat/mcp-servers)
4040

41-
1. **Locate the settings.json file**: Open `VSCode Settings` and search for `mcp`. Edit the `User`'s `settings.json`. _MCP requires your connection string and it's not safe to keep it into the project's VSCode settings._
41+
1. **Locate the settings.json file**: Open `VSCode Settings` and search for `mcp`. Edit the `User`'s `settings.json`.
42+
43+
> _MCP requires your connection string and it's not safe to keep it into the project's VSCode settings._
4244
4345
2. **Add the MCP configuration**: Include the following configuration in the settings.json file:
4446

@@ -112,7 +114,7 @@ npx <PACKAGE_FILENAME>.tgz --connectionString <CONNECTION_STRING>
112114
Use the inspector to test both `stdio` and `sse` transports.
113115
First build the package then run:
114116
```bash
115-
npx npx @modelcontextprotocol/inspector@latest
117+
npx @modelcontextprotocol/inspector@latest
116118
```
117119
and open it at the page: http://127.0.0.1:6274/
118120

@@ -125,4 +127,4 @@ _Note: use the `PATH_TO_PACKAGE_FOLDER` from your home directory or you might ge
125127

126128
### SSE Transport
127129
To test `sse` transport to a remote or local server use
128-
**URL**: `http://localhost:8090/v1/mcp/sse`
130+
- **URL**: `http://localhost:8090/v1/mcp/sse`

src/index.ts

Lines changed: 19 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,39 +1,34 @@
11
#!/usr/bin/env node
22

3-
import { StdioServerTransport } from "@modelcontextprotocol/sdk/server/stdio.js";
4-
import { SQLiteCloudMcpServer } from "./server.js";
5-
import { SQLiteCloudMcpTransport } from "./sqlitecloudTransport.js";
6-
import { parseArgs } from "util";
3+
import { StdioServerTransport } from '@modelcontextprotocol/sdk/server/stdio.js'
4+
import { SQLiteCloudMcpServer } from './server.js'
5+
import { SQLiteCloudMcpTransport } from './sqlitecloudTransport.js'
6+
import { parseArgs } from 'util'
77

8-
const server = new SQLiteCloudMcpServer();
8+
const server = new SQLiteCloudMcpServer()
99

1010
async function main() {
11-
console.log("Starting SQLite Cloud MCP Server...");
11+
console.log('Starting SQLite Cloud MCP Server...')
1212
const {
13-
values: { connectionString },
13+
values: { connectionString }
1414
} = parseArgs({
1515
options: {
1616
connectionString: {
17-
type: "string",
18-
},
19-
},
20-
});
17+
type: 'string'
18+
}
19+
}
20+
})
2121

2222
if (!connectionString) {
23-
throw new Error(
24-
"Please provide a Connection String with the --connectionString flag"
25-
);
23+
throw new Error('Please provide a Connection String with the --connectionString flag')
2624
}
2725

28-
const transport = new SQLiteCloudMcpTransport(
29-
connectionString,
30-
new StdioServerTransport()
31-
);
32-
await server.connect(transport);
33-
console.info("SQLite Cloud MCP Server running on stdio");
26+
const transport = new SQLiteCloudMcpTransport(connectionString, new StdioServerTransport())
27+
await server.connect(transport)
28+
console.info('SQLite Cloud MCP Server running on stdio')
3429
}
3530

36-
main().catch((error) => {
37-
console.error("Fatal error in main():", error);
38-
process.exit(1);
39-
});
31+
main().catch(error => {
32+
console.error('Fatal error in main():', error)
33+
process.exit(1)
34+
})

src/portableSseTransport.ts

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ interface PortableWriter {
1010

1111
/**
1212
* Server transport for SSE to send messages over an SSE connection.
13-
*
13+
*
1414
* This is a reimplementation of the `SSEServerTransport` class from `@modelcontextprotocol/sdk/server/see`
1515
* without the dependency with ExpressJS.
1616
*/
@@ -25,10 +25,7 @@ export class PortableSSEServerTransport implements Transport {
2525
/**
2626
* Creates a new SSE server transport, which will direct the client to POST messages to the relative or absolute URL identified by `_endpoint`.
2727
*/
28-
constructor(
29-
private _endpoint: string,
30-
private writableStream: PortableWriter
31-
) {
28+
constructor(private _endpoint: string, private writableStream: PortableWriter) {
3229
this._sessionId = randomUUID()
3330
}
3431

0 commit comments

Comments
 (0)