Skip to content

Commit a457dd9

Browse files
authored
Merge pull request #114 from sqlitecloud/introduce-mcp-server
feat(mcp): introduce mcp server
2 parents 2c1628d + 24ce19c commit a457dd9

File tree

2 files changed

+148
-2
lines changed

2 files changed

+148
-2
lines changed

sqlite-cloud/_nav.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -81,8 +81,7 @@ const sidebarNav: SidebarNavStruct = [
8181
{ title: "Query Analyzer", filePath: "analyzer", type: "inner", level: 0 },
8282
{ title: "Extensions", filePath: "extensions", type: "inner", level: 0 },
8383
{ title: "Weblite", filePath: "weblite", type: "inner", level: 0 },
84-
// { title: "Storage", type: "inner", level: 0 },
85-
// { title: "Partitioning", type: "inner", level: 0 },
84+
{ title: "AI - Model Context Protocol (MCP)", filePath: "mcp-server", type: "inner", level: 0 },
8685

8786
{ title: "SDKs", type: "secondary", icon: "docs-sdk" },
8887
{ title: "C/C++", type: "inner", level: 0 },

sqlite-cloud/platform/mcp-server.mdx

Lines changed: 147 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,147 @@
1+
---
2+
title: AI - Model Context Protocol (MCP)
3+
description: MCP Server for SQLite Cloud to interact with SQLite Cloud databases using the AI models
4+
category: platform
5+
status: publish
6+
slug: mcp-server
7+
---
8+
9+
The [Model Context Protocol (MCP)](https://modelcontextprotocol.io/introduction) is a standard for connecting various data sources (like your SQLite Cloud database) to Large Language Models (LLMs). The MCP Server for SQLite Cloud provides tools for executing queries, managing schemas, and analyzing query performance.
10+
11+
## Features
12+
13+
- **Query Execution**: Perform `SELECT`, `INSERT`, `UPDATE`, and `DELETE` SQL operations on SQLite Cloud databases.
14+
- **Schema Management**: Create tables, list existing ones, and retrieve schema details.
15+
- **Command Execution**: Run predefined commands supported by SQLite Cloud.
16+
- **Performance Analysis**: Identify slow queries, analyze query plans, and reset query statistics.
17+
18+
[Explore the available tools here](https://github.com/sqlitecloud/sqlitecloud-mcp-server).
19+
20+
## Getting Started
21+
22+
To use the MCP Server, create a [free account on SQLite Cloud](https://sqlitecloud.io) and obtain your **Connection String**.
23+
24+
### Requirements
25+
26+
You need [Node.js](https://nodejs.org) installed on your computer to run the MCP Server. To check if Node.js is installed, open a terminal:
27+
28+
- **Linux**: Open the terminal from the Applications menu.
29+
- **macOS**: Open the Terminal app from the Applications folder or use Spotlight Search (`Cmd+Space`) and type "Terminal."
30+
- **Windows**: Press `Win + R`, type `cmd`, and press Enter to open the Command Prompt. Alternatively, search for "Command Prompt" in the Start menu.
31+
32+
Then type the following command and press Enter:
33+
34+
```bash
35+
node --version
36+
```
37+
38+
If the command returns a version number, Node.js is installed. If you see an error like "command not found" or "node is not recognized," download and install Node.js from [nodejs.org](https://nodejs.org).
39+
40+
## Configure the AI Agent
41+
42+
This guide explains how to connect the MCP Server for SQLite Cloud to common AI agents that support MCP.
43+
[Find a list of supported tools and IDEs here](https://modelcontextprotocol.io/clients).
44+
45+
After configuring your AI agent, try asking it questions about your SQLite Cloud database, such as:
46+
47+
> What’s in my database on SQLite Cloud?"
48+
"What are the three most popular tracks by revenue in my SQLite Cloud database?
49+
50+
Explore or manipulate your database using natural language queries.
51+
52+
### Claude Desktop
53+
54+
Refer to the [official documentation](https://modelcontextprotocol.io/quickstart/user) for detailed instructions.
55+
56+
1. Open Claude Desktop and navigate to **Settings**.
57+
2. Go to the **Developer** section and click on **Edit Config** to open the configuration file.
58+
3. Add the following configuration:
59+
60+
```json
61+
{
62+
"mcpServers": {
63+
"sqlitecloud-mcp-server": {
64+
"type": "stdio",
65+
"command": "npx",
66+
"args": [
67+
"-y",
68+
"@sqlitecloud/mcp-server",
69+
"--connectionString",
70+
"<CONNECTION_STRING>"
71+
]
72+
}
73+
}
74+
}
75+
```
76+
77+
Replace `<CONNECTION_STRING>` with your Connection String.
78+
79+
4. Save the configuration file and restart Claude Desktop.
80+
5. You should see a _Hammer_ icon in the bottom-right corner of the input box. Click the icon to view the list of discovered tools.
81+
82+
### Cursor
83+
84+
Refer to the [official documentation](https://docs.cursor.com/context/model-context-protocol#configuring-mcp-servers) for detailed instructions.
85+
86+
1. In the root of your project, create the file `.cursor/mcp.json`.
87+
2. Add the following configuration:
88+
89+
```json
90+
{
91+
"mcpServers": {
92+
"sqlitecloud-mcp-server": {
93+
"type": "stdio",
94+
"command": "npx",
95+
"args": [
96+
"-y",
97+
"@sqlitecloud/mcp-server",
98+
"--connectionString",
99+
"<CONNECTION_STRING>"
100+
]
101+
}
102+
}
103+
}
104+
```
105+
106+
Replace `<CONNECTION_STRING>` with your Connection String.
107+
108+
3. Save the `mcp.json` file.
109+
4. Open the **Settings** page and navigate to the **MCP** section. You should see the MCP server with a green status indicator.
110+
5. In the Chat panel, select the "Agent" mode to interact with the AI model using the MCP Server.
111+
112+
### VSCode Copilot
113+
114+
Refer to the [official documentation](https://code.visualstudio.com/docs/copilot/chat/mcp-servers) for detailed instructions.
115+
116+
1. In the root of your project, create the file `.vscode/mcp.json`.
117+
2. Add the following configuration:
118+
119+
```json
120+
{
121+
"mcp": {
122+
"inputs": [
123+
{
124+
"type": "promptString",
125+
"id": "sqlitecloud-connection-string",
126+
"description": "Set the SQLite Cloud Connection String",
127+
"password": true
128+
}
129+
],
130+
"servers": {
131+
"sqlitecloud-mcp-server": {
132+
"type": "stdio",
133+
"command": "npx",
134+
"args": [
135+
"-y",
136+
"@sqlitecloud/mcp-server",
137+
"--connectionString",
138+
"${input:sqlitecloud-connection-string}"
139+
]
140+
}
141+
}
142+
}
143+
}
144+
```
145+
146+
3. Save the `mcp.json` file.
147+
4. Open Copilot Chat and select the **Agent** mode from the menu near the **Send** button. A tool icon will appear, showing the discovered tools. Before starting the server, VSCode will prompt you to enter your Connection String.

0 commit comments

Comments
 (0)