Skip to content

Introduce mcp #115

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 5 commits into from
Apr 29, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/search.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:

steps:
- uses: actions/checkout@v4
- uses: sqlitecloud/docsearch-action@v4
- uses: sqlitecloud/docsearch-action@v5
with:
project-string: ${{ secrets.PROJECT_STRING }}
base-url: ${{ vars.BASE_URL }}
Expand Down
5 changes: 2 additions & 3 deletions sqlite-cloud/_nav.ts
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ const sidebarNav: SidebarNavStruct = [
{ title: "Webhooks", filePath: "webhooks", type: "inner", level: 0 },
{ title: "Pub/Sub", filePath: "pub-sub", type: "inner", level: 0 },
{ title: "Vector", filePath: "vector", type: "inner", level: 0 },
{ title: "Scaling", type: "inner", filePath: "scaling", level: 0 },
{ title: "Scaling", type: "inner", filePath: "architecture", level: 0 },
{
title: "Security and Access Control",
filePath: "security",
Expand All @@ -81,8 +81,7 @@ const sidebarNav: SidebarNavStruct = [
{ title: "Query Analyzer", filePath: "analyzer", type: "inner", level: 0 },
{ title: "Extensions", filePath: "extensions", type: "inner", level: 0 },
{ title: "Weblite", filePath: "weblite", type: "inner", level: 0 },
// { title: "Storage", type: "inner", level: 0 },
// { title: "Partitioning", type: "inner", level: 0 },
{ title: "AI - Model Context Protocol (MCP)", filePath: "mcp-server", type: "inner", level: 0 },

{ title: "SDKs", type: "secondary", icon: "docs-sdk" },
{ title: "C/C++", type: "inner", level: 0 },
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
title: Architecture
description: SQLite Cloud Architecture
category: getting-started
status: draft
status: publish
slug: architecture
---

Expand Down
147 changes: 147 additions & 0 deletions sqlite-cloud/platform/mcp-server.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,147 @@
---
title: AI - Model Context Protocol (MCP)
description: MCP Server for SQLite Cloud to interact with SQLite Cloud databases using the AI models
category: platform
status: publish
slug: mcp-server
---

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.

## Features

- **Query Execution**: Perform `SELECT`, `INSERT`, `UPDATE`, and `DELETE` SQL operations on SQLite Cloud databases.
- **Schema Management**: Create tables, list existing ones, and retrieve schema details.
- **Command Execution**: Run predefined commands supported by SQLite Cloud.
- **Performance Analysis**: Identify slow queries, analyze query plans, and reset query statistics.

[Explore the available tools here](https://github.com/sqlitecloud/sqlitecloud-mcp-server).

## Getting Started

To use the MCP Server, create a [free account on SQLite Cloud](https://sqlitecloud.io) and obtain your **Connection String**.

### Requirements

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:

- **Linux**: Open the terminal from the Applications menu.
- **macOS**: Open the Terminal app from the Applications folder or use Spotlight Search (`Cmd+Space`) and type "Terminal."
- **Windows**: Press `Win + R`, type `cmd`, and press Enter to open the Command Prompt. Alternatively, search for "Command Prompt" in the Start menu.

Then type the following command and press Enter:

```bash
node --version
```

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).

## Configure the AI Agent

This guide explains how to connect the MCP Server for SQLite Cloud to common AI agents that support MCP.
[Find a list of supported tools and IDEs here](https://modelcontextprotocol.io/clients).

After configuring your AI agent, try asking it questions about your SQLite Cloud database, such as:

> What’s in my database on SQLite Cloud?"
"What are the three most popular tracks by revenue in my SQLite Cloud database?

Explore or manipulate your database using natural language queries.

### Claude Desktop

Refer to the [official documentation](https://modelcontextprotocol.io/quickstart/user) for detailed instructions.

1. Open Claude Desktop and navigate to **Settings**.
2. Go to the **Developer** section and click on **Edit Config** to open the configuration file.
3. Add the following configuration:

```json
{
"mcpServers": {
"sqlitecloud-mcp-server": {
"type": "stdio",
"command": "npx",
"args": [
"-y",
"@sqlitecloud/mcp-server",
"--connectionString",
"<CONNECTION_STRING>"
]
}
}
}
```

Replace `<CONNECTION_STRING>` with your Connection String.

4. Save the configuration file and restart Claude Desktop.
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.

### Cursor

Refer to the [official documentation](https://docs.cursor.com/context/model-context-protocol#configuring-mcp-servers) for detailed instructions.

1. In the root of your project, create the file `.cursor/mcp.json`.
2. Add the following configuration:

```json
{
"mcpServers": {
"sqlitecloud-mcp-server": {
"type": "stdio",
"command": "npx",
"args": [
"-y",
"@sqlitecloud/mcp-server",
"--connectionString",
"<CONNECTION_STRING>"
]
}
}
}
```

Replace `<CONNECTION_STRING>` with your Connection String.

3. Save the `mcp.json` file.
4. Open the **Settings** page and navigate to the **MCP** section. You should see the MCP server with a green status indicator.
5. In the Chat panel, select the "Agent" mode to interact with the AI model using the MCP Server.

### VSCode Copilot

Refer to the [official documentation](https://code.visualstudio.com/docs/copilot/chat/mcp-servers) for detailed instructions.

1. In the root of your project, create the file `.vscode/mcp.json`.
2. Add the following configuration:

```json
{
"mcp": {
"inputs": [
{
"type": "promptString",
"id": "sqlitecloud-connection-string",
"description": "Set the SQLite Cloud Connection String",
"password": true
}
],
"servers": {
"sqlitecloud-mcp-server": {
"type": "stdio",
"command": "npx",
"args": [
"-y",
"@sqlitecloud/mcp-server",
"--connectionString",
"${input:sqlitecloud-connection-string}"
]
}
}
}
}
```

3. Save the `mcp.json` file.
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.