Skip to content

Commit 5f1b09b

Browse files
committed
📝 Add MCP/function call to README.md
1 parent ae75823 commit 5f1b09b

11 files changed

+110
-20
lines changed

.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -61,3 +61,4 @@ fabric.properties
6161
.DS_Store
6262

6363
dist/
64+
.aider*

README.md

+21-14
Original file line numberDiff line numberDiff line change
@@ -10,30 +10,37 @@
1010
[![Dynamic JSON Badge](https://img.shields.io/badge/dynamic/json?url=https%3A%2F%2Fregistry.anyquery.dev%2Fv0%2Fquery%2F&query=%24.queries_count&style=flat&label=Queries%20from%20the%20hub&cacheSeconds=3600&link=https%3A%2F%2Fanyquery.dev%2Fqueries)](https://anyquery.dev/queries)
1111
[![Go Reference](https://pkg.go.dev/badge/github.com/julien040/[email protected]/namespace.svg)](https://pkg.go.dev/github.com/julien040/anyquery/namespace)
1212

13-
Anyquery is a SQL query engine that allows you to run SQL queries on pretty much anything. It supports querying [JSON](https://anyquery.dev/docs/usage/querying-files/#json), [CSV](https://anyquery.dev/docs/usage/querying-files/#csv), [Parquet](https://anyquery.dev/docs/usage/querying-files/#parquet), SQLite, [Airtable bases](https://anyquery.dev/integrations/airtable/), [Google Sheets](https://anyquery.dev/integrations/google_sheets/), [Notion databases](https://anyquery.dev/integrations/notion/), and [log files](https://anyquery.dev/docs/usage/querying-log/) using [Grok](https://www.elastic.co/guide/en/elasticsearch/reference/current/grok.html), among others. It also supports running SQL queries on [remote files](https://anyquery.dev/docs/usage/querying-files/#remote-files) (HTTP, S3, GCS), local apps ([Apple Notes](https://anyquery.dev/integrations/notes/), [Apple Reminders](https://anyquery.dev/integrations/reminders/), [Google Chrome Tabs](https://anyquery.dev/integrations/chrome/), etc.), and databases ([MySQL](https://anyquery.dev/docs/database/mysql/) and [PostgreSQL](https://anyquery.dev/docs/database/postgresql/)). It's built on top of [SQLite](https://www.sqlite.org) and uses [plugins](https://anyquery.dev/integrations/) to extend its functionality.
13+
Anyquery is a SQL query engine that allows you to run SQL queries on pretty much anything. It supports querying [files](https://anyquery.dev/docs/usage/querying-files/), [databases](https://anyquery.dev/docs/database), and [apps](https://anyquery.dev/integrations) (e.g. Apple Notes, Notion, Chrome, Todoist, etc.). It's built on top of [SQLite](https://www.sqlite.org) and uses [plugins](https://anyquery.dev/integrations) to extend its functionality.
1414

15-
Moreover, it can act as a [MySQL server](https://anyquery.dev/docs/usage/mysql-server/), allowing you to run SQL queries from your favorite MySQL-compatible client (e.g. [Looker Studio](https://anyquery.dev/connection-guide/looker-studio/), [DBeaver](https://anyquery.dev/connection-guide/dbeaver/), [TablePlus](https://anyquery.dev/connection-guide/tableplus/), [Metabase](https://anyquery.dev/connection-guide/metabase/), etc.).
15+
It can also connect to [LLMs](https://anyquery.dev/llm) (e.g. ChatGPT, Claude, Cursor, TypingMind, etc.) to allow them to access your data.
16+
17+
Finally, it can act as a [MySQL server](https://anyquery.dev/docs/usage/mysql-server/), allowing you to run SQL queries from your favorite MySQL-compatible client (e.g. [TablePlus](https://anyquery.dev/connection-guide/tableplus/), [Metabase](https://anyquery.dev/connection-guide/metabase/), etc.).
1618

1719
![Anyquery header](https://anyquery.dev/images/release-header.png)
1820

1921
## Usage
2022

21-
The [documentation](https://anyquery.dev/docs/usage/running-queries) provides detailed instructions on how to run queries with Anyquery.
22-
But let's see a quick example. Type `anyquery` in your terminal to open the shell mode. Then, run the following query:
23+
### Connecting LLM
2324

24-
```sql
25-
-- List all repositories of asg017 related to SQLite
26-
SELECT full_name, stargazers_count, pushed_at FROM github_repositories_from_user('asg017') WHERE name LIKE '%sqlite%';
25+
LLMs can connect to Anyquery using the [Model Context Protocol (MCP)](https://anyquery.dev/docs/reference/commands/anyquery_mcp). This protocol provides context for LLMs that support it. You can start the MCP server with the following command:
2726

28-
-- Count rows of a remote 75MB CSV file
29-
SELECT count(*) FROM read_csv('https://raw.githubusercontent.com/datadesk/california-coronavirus-data/master/latimes-place-totals.csv', header=true);
27+
```bash
28+
# To be started by the LLM client
29+
anyquery mcp
30+
# To connect using an HTTP and SSE tunnel
31+
anyquery mcp --tunnel
32+
```
3033

31-
-- Insert into a Notion database all repositories of nalgeon related to SQLite
32-
INSERT INTO notion_database(repo, stars, last_push) SELECT full_name, stargazers_count, pushed_at FROM github_repositories_from_user('nalgeon') WHERE description LIKE '%sqlite%';
34+
You can also connect to clients that supports function calling (e.g. ChatGPT, TypingMind). Refer to each [connection guide](https://anyquery.dev/integrations#llm) in the documentation for more information.
3335

34-
-- Close all tabs of the datasette documentation
35-
DELETE FROM chrome_tabs WHERE url LIKE '%datasette%';
36-
```
36+
![5ire example](https://anyquery.dev/images/docs/llm/5ire-final.png)
37+
38+
### Running SQL queries
39+
40+
The [documentation](https://anyquery.dev/docs/usage/running-queries) provides detailed instructions on how to run queries with Anyquery.
41+
But let's see a quick example. Type `anyquery` in your terminal to open the shell mode. Then, run the following query:
42+
43+
![Anyquery SQL examples](https://anyquery.dev/images/anyquery_examples.sql.png)
3744

3845
You can also launch the MySQL server with `anyquery server` and connect to it with your favorite MySQL-compatible client.
3946

Loading
-13 KB
Loading

website/src/content/docs/docs/reference/Commands/anyquery.md

+2
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,9 @@ anyquery -d ":memory:"
5959
* [anyquery alias](../anyquery_alias) - Manage the aliases
6060
* [anyquery completion](../anyquery_completion) - Generate the autocompletion script for the specified shell
6161
* [anyquery connection](../anyquery_connection) - Manage connections to other databases
62+
* [anyquery gpt](../anyquery_gpt) - Open an HTTP server so that ChatGPT can do function calls
6263
* [anyquery install](../anyquery_install) - Search and install a plugin
64+
* [anyquery mcp](../anyquery_mcp) - Start the Model Context Protocol (MCP) server
6365
* [anyquery plugins](../anyquery_plugins) - Print the plugins installed on the system
6466
* [anyquery profiles](../anyquery_profiles) - Print the profiles installed on the system
6567
* [anyquery query](../anyquery_query) - Run a SQL query
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
---
2+
title: anyquery gpt
3+
description: Learn how to use the anyquery gpt command in Anyquery.
4+
---
5+
6+
Open an HTTP server so that ChatGPT can do function calls
7+
8+
### Synopsis
9+
10+
Open an HTTP server so that ChatGPT can do function calls. By default, it will expose a tunnel to the internet.
11+
By setting the --host or --port flags, you can disable the tunnel and bind to a specific host and port. In this case, you will need to configure your LLM to connect to this host and port.
12+
13+
```bash
14+
anyquery gpt [flags]
15+
```
16+
17+
### Options
18+
19+
```bash
20+
-c, --config string Path to the configuration database
21+
-d, --database string Database to connect to (a path or :memory:)
22+
--extension strings Load one or more extensions by specifying their path. Separate multiple extensions with a comma.
23+
-h, --help help for gpt
24+
--host string Host to bind to. If not empty, the tunnel will be disabled
25+
--in-memory Use an in-memory database
26+
--log-file string Log file
27+
--log-format string Log format (text, json) (default "text")
28+
--log-level string Log level (trace, debug, info, warn, error, off) (default "info")
29+
--port int Port to bind to. If not empty, the tunnel will be disabled
30+
--read-only Open the SQLite database in read-only mode
31+
--readonly Open the SQLite database in read-only mode
32+
```
33+
34+
### SEE ALSO
35+
36+
* [anyquery](../anyquery) - A tool to query any data source
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
---
2+
title: anyquery mcp
3+
description: Learn how to use the anyquery mcp command in Anyquery.
4+
---
5+
6+
Start the Model Context Protocol (MCP) server
7+
8+
### Synopsis
9+
10+
Start the Model Context Protocol (MCP) server. It is used to provide context for LLM that supports it.
11+
Pass the --stdio flag to use standard input/output for communication. By default, it will bind locally to localhost:8070 (modify it with the --host, --port and --domain flags).
12+
You can also expose the tunnel to the internet by using the --tunnel flag (useful when the LLM is on a remote server).
13+
14+
15+
```bash
16+
anyquery mcp [flags]
17+
```
18+
19+
### Options
20+
21+
```bash
22+
-c, --config string Path to the configuration database
23+
-d, --database string Database to connect to (a path or :memory:)
24+
--domain string Domain to use for the HTTP tunnel (empty to use the host)
25+
--extension strings Load one or more extensions by specifying their path. Separate multiple extensions with a comma.
26+
-h, --help help for mcp
27+
--host string Host to bind to (default "127.0.0.1")
28+
--in-memory Use an in-memory database
29+
--log-file string Log file
30+
--log-format string Log format (text, json) (default "text")
31+
--log-level string Log level (trace, debug, info, warn, error, off) (default "info")
32+
--port int Port to bind to (default 8070)
33+
--read-only Open the SQLite database in read-only mode
34+
--readonly Open the SQLite database in read-only mode
35+
--stdio Use standard input/output for communication
36+
--tunnel Use an HTTP tunnel, and expose the server to the internet (when used, --host, --domain and --port are ignored)
37+
```
38+
39+
### SEE ALSO
40+
41+
* [anyquery](../anyquery) - A tool to query any data source

website/src/content/docs/docs/reference/Commands/anyquery_profiles_new.md

+2-1
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,12 @@ Create a new profile
1010
Create a new profile.
1111

1212
If only two arguments are provided, we consider that the registry is the default one.
13+
If only one argument is provided, the CLI will prompt you for the profile name, and will fallback to the default registry.
1314
If no argument is provided, the command will prompt you the registry, the plugin and the profile to create.
1415
Note: This command requires the tty to be interactive.
1516

1617
```bash
17-
anyquery profiles new [registry] [plugin] [profile] [flags]
18+
anyquery profiles new (registry plugin profile) | (plugin profile) | (plugin) [flags]
1819
```
1920

2021
### Examples

website/src/content/docs/docs/reference/export-commands.mjs

+4-3
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,13 @@ import { $ } from "bun";
44
import { readdir } from "node:fs/promises";
55

66
// Export the commands
7-
try {
7+
/* try {
88
await $`anyquery tool generate-doc Commands`;
99
} catch (error) {
1010
// In case it's a build machine, anyquery might not be installed
11-
await $`../../../../../../main.out tool generate-doc Commands`;
12-
}
11+
12+
} */
13+
await $`../../../../../../main.out tool generate-doc Commands`;
1314

1415
// For each file, take the lop level h2 header, and add the frontmatter
1516
// with the title equaling to the header text

website/src/content/docs/docs/usage/connecting-llms.mdx

+1-1
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ Before you begin, ensure that you have the following:
2222

2323
Anyquery supports function calling and the Model Context Protocol (MCP) to connect to your chat interface. Refer to each [connection guide](/integrations#llm) in the documentation for more information.
2424

25-
<LinkCard title="Connection guides" href="/docs/integrations#llm" description="Learn how to connect your chat interface to Anyquery." />
25+
<LinkCard title="Connection guides" href="/integrations#llm" description="Learn how to connect your chat interface to Anyquery." />
2626

2727
## Usage
2828

website/src/pages/llm.astro

+2-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,8 @@ import Main from "../layouts/main.astro";
77
footnote="Trademarks are the property of their respective owners. Anyquery is not affiliated with any of the companies or projects mentioned. Some LLM answers may be truncated for brevity."
88
>
99
<div class="max-w-2xl mx-auto text-center mb-12">
10-
<h1 class="text-3xl tracking-[-1.2px] font-bold mt-8">
10+
<p class="text-white/70 text-xs mt-8">✨ Anyquery AI ✨</p>
11+
<h1 class="text-3xl tracking-[-1.2px] font-bold">
1112
Connect LLM to your personal data
1213
</h1>
1314
<p class="text-white/70 mt-1 text-sm">

0 commit comments

Comments
 (0)