Queryweaver

by FalkorDB

325 downloads
Not rated
GitHub

About

An open-source Text2SQL tool that transforms natural language into SQL using graph-powered schema understanding. Ask your database questions in plain English, QueryWeaver handles the weaving.

Details

Author
FalkorDB
Downloads
325
Categories
Database

- Graph-powered schema understanding for Text2SQL
- Plain-English to SQL conversion
- REST API with Swagger UI documentation
- Optional MCP server endpoints
- Docker deployment (single command)
- Supports Azure OpenAI and OpenAI
- OAuth authentication (Google, GitHub)
- Streaming responses with reasoning steps

Setting up with Highlight

This MCP is not yet compatible with Highlight’s one-click setup. However, you can still use it with Highlight by following these steps:

  1. Download and install Highlight from highlightai.com/download
  2. Navigate to the plugins tab and select "Add Custom Plugin"
  3. Configure the plugin with the settings below
    Plugin Name Queryweaver
    Command (node, npx, python, etc.)

    Please refer to the README for specific instructions on how to obtain API keys or other required environment variables.

  4. Enable "Start Automatically" if you want the plugin to start when Highlight launches

From the repository

You can run QueryWeaver via Docker with a single command (docker run -p 5000:5000 -it falkordb/queryweaver) or from source using Python 3.12+ and pipenv. Configuration is provided through environment variables (e.g., Azure OpenAI or OpenAI API keys). QueryWeaver exposes a REST API with endpoints for managing graphs and running Text2SQL queries, and optionally provides MCP endpoints for integration with AI assistants.

list_databases

List all available graphs/databases for the authenticated user. Requires authentication.

database_schema

Return all nodes and edges for the specified database schema. Requires authentication. args: graph_id (str): The ID of the graph to query (the database name).

query_database

Query the Database with the given graph_id and chat_data. Requires authentication. Args: graph_id (str): The ID of the graph to query. chat_data (ChatRequest): The chat data containing user queries and context.

connect_database

Accepts a JSON payload with a database URL and attempts to connect. Supports both PostgreSQL and MySQL databases. Streams progress steps as a sequence of JSON messages separated by a delimiter. Requires authentication.

Claude Desktop / Cursor

Paste into your MCP client config file to install this server.

{
    "mcpServers": {
        "queryweaver": {
            "queryweaver": {
                "type": "http",
                "url": "https://app.queryweaver.ai/mcp",
                "headers": {
                    "Authorization": "Bearer your_token_here"
                }
            }
        }
    }
}

McpServers

{
    "queryweaver": {
        "type": "http",
        "url": "https://app.queryweaver.ai/mcp",
        "headers": {
            "Authorization": "Bearer your_token_here"
        }
    }
}

Inputs

[]

<div align="center">
<h1>QueryWeaver</h1>

REST API · MCP · Graph-powered

QueryWeaver is an open-source Text2SQL tool that converts plain-English questions into SQL using graph-powered schema understanding. It helps you ask databases natural-language questions and returns SQL and results.

Connect and ask questions: Discord

Try Free
Dockerhub
Tests
Swagger UI
</div>

queryweaver-demo-video-ui

Get Started

Docker

> 💡 Recommended for evaluation purposes (Local Python or Node are not required)
docker run -p 5000:5000 -it falkordb/queryweaver

Launch: http://localhost:5000

---

Use an .env file (Recommended)

Create a local .env by copying .env.example and passing it to Docker. This is the simplest way to provide all required configuration:

cp .env.example .env

edit .env to set your values, then:

docker run -p 5000:5000 --env-file .env falkordb/queryweaver

Alternative: Pass individual environment variables

If you prefer to pass variables on the command line, use -e flags (less convenient for many variables):

docker run -p 5000:5000 -it \
  -e APP_ENV=production \
  -e FASTAPI_SECRET_KEY=your_super_secret_key_here \
  -e GOOGLE_CLIENT_ID=your_google_client_id \
  -e GOOGLE_CLIENT_SECRET=your_google_client_secret \
  -e GITHUB_CLIENT_ID=your_github_client_id \
  -e GITHUB_CLIENT_SECRET=your_github_client_secret \
  -e AZURE_API_KEY=your_azure_api_key \
  falkordb/queryweaver

> Note: To use OpenAI directly instead of Azure OpenAI, replace AZURE_API_KEY with OPENAI_API_KEY in the above command.

> For a full list of configuration options, consult .env.example.

MCP server: host or connect (optional)

QueryWeaver includes optional support for the Model Context Protocol (MCP). You can either have QueryWeaver expose an MCP-compatible HTTP surface (so other services can call QueryWeaver as an MCP server), or configure QueryWeaver to call an external MCP server for model/context services.

What QueryWeaver provides
- The app registers MCP operations focused on Text2SQL flows:
- list_databases
- connect_database
- database_schema
- query_database

- To disable the built-in MCP endpoints set DISABLE_MCP=true in your .env or environment (default: MCP enabled).
- Configuration

- DISABLE_MCP — disable QueryWeaver's built-in MCP HTTP surface. Set to true to disable. Default: false (MCP enabled).

Examples

Disable the built-in MCP when running with Docker:

docker run -p 5000:5000 -it --env DISABLE_MCP=true falkordb/queryweaver
Calling the built-in MCP endpoints (example) - The MCP surface is exposed as HTTP endpoints.

Server Configuration

Below is a minimal example mcp.json client configuration that targets a local QueryWeaver instance exposing the MCP HTTP surface at /mcp.

{
   "servers": {
      "queryweaver": {
         "type": "http",
         "url": "http://127.0.0.1:5000/mcp",
         "headers": {
            "Authorization": "Bearer your_token_here"
         }
      }
   },
   "inputs": []
}

REST API

API Documentation

Swagger UI: https://app.queryweaver.ai/docs

OpenAPI JSON: https://app.queryweaver.ai/openapi.json

Overview

QueryWeaver exposes a small REST API for managing graphs (database schemas) and running Text2SQL queries. All endpoints that modify or access user-scoped data require authentication via a bearer token. In the browser the app uses session cookies and OAuth flows; for CLI and scripts you can use an API token (see tokens routes or the web UI to create one).

Core endpoints
- GET /graphs — list available graphs for the authenticated user
- GET /graphs/{graph_id}/data — return nodes/links (tables, columns, foreign keys) for the graph
- POST /graphs — upload or create a graph (JSON payload or file upload)
- POST /graphs/{graph_id} — run a Text2SQL chat query against the named graph (streaming response)

Authentication
- Add an Authorization header: Authorization: Bearer <API_TOKEN>

Examples

1) List graphs (GET)

curl example:

curl -s -H "Authorization: Bearer $TOKEN" \
   https://app.queryweaver.ai/graphs

Python example:

import requests
resp = requests.get('https://app.queryweaver.ai/graphs', headers={'Authorization': f'Bearer {TOKEN}'})
print(resp.json())

2) Get graph schema (GET)

curl example:

curl -s -H "Authorization: Bearer $TOKEN" \
   https://app.queryweaver.ai/graphs/my_database/data

Python example:

resp = requests.get('https://app.queryweaver.ai/graphs/my_database/data', headers={'Authorization': f'Bearer {TOKEN}'})
print(resp.json())

3) Load a graph (POST) — JSON payload

curl -H "Authorization: Bearer $TOKEN" -H "Content-Type: application/json" \
   -d '{"database": "my_database", "tables": [...]}' \
   https://app.queryweaver.ai/graphs

Or upload a file (multipart/form-data):

curl -H "Authorization: Bearer $TOKEN" -F "file=@schema.json" \
   https://app.queryweaver.ai/graphs

4) Query a graph (POST) — run a chat-based Text2SQL request

The POST /graphs/{graph_id} endpoint accepts a JSON body with at least a chat field (an array of messages). The endpoint streams processing steps and the final SQL back as server-sent-message chunks delimited by a special boundary used by the frontend. For simple scripting you can call it and read the final JSON object from the streamed messages.

Example payload:

{
   "chat": ["How many users signed up last month?"],
   "result": [],
   "instructions": "Prefer PostgreSQL compatible SQL"
}

curl example (simple, collects whole response):

curl -s -H "Authorization: Bearer $TOKEN" -H "Content-Type: application/json" \
   -d '{"chat": ["Count orders last week"]}' \
   https://app.queryweaver.ai/graphs/my_database

Python example (stream-aware):

```python
import requests
import json

url = 'https://app.queryweaver.ai/graphs/my_database'
headers = {'Authorization': f'Bearer {TOKEN}', 'Content-Type': 'application/json'}
with requests.post(url, headers=headers, json={"chat": ["Count orders last week"]}, stream=True) as r:
# The server yields JSON objects delimited by a message boundary string
boundary = '|||FALKORDB_MESSAGE_BOUNDARY|||'
buffer = ''
for chunk in r.iter_content(decode_unicode=True, chunk_size=1024):
buffer += chunk
while boundary in buffer:
part, buffer = buffer.split(boundary, 1)
if not part.strip():
continue
obj = json.loads(part)
print('STREAM:', obj)

No reviews yet — be the first

Sign in to leave a review

Use Google, GitHub, or an email account so ratings stay tied to real people.

Email sign in

No reviews posted yet.