QueryBridge
Click on "Install Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@QueryBridgeWhat is the average salary in Engineering?"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
QueryBridge
QueryBridge is a local AI application that connects a MySQL database to an Ollama-powered language model through an MCP (Model Context Protocol) tool server. It lets you ask natural-language questions about your data while keeping database access structured, safe, and local.
What this project does
Exposes MySQL read operations through an MCP server
Uses a local Ollama LLM to generate a safe SQL query
Validates the SQL against the real table schema
Executes the query through the MCP tool layer
Passes the result back to the LLM for a human-readable answer
This app is intended for local development and experimentation with:
MySQL running in XAMPP
Ollama models running on the same machine
Python 3.12 + uv for project management
Related MCP server: MySQL MCP Server
Architecture
main.py– client entry point, asks a question and orchestrates the flowmcp_server.py– MCP server that exposes safe database toolsdb/connection.py– MySQL connection and SQL execution helpersagent.py– Ollama LLM and prompt logic.env– local environment variables for DB and model configuration
Prerequisites
Before running the application, make sure you have:
Python 3.12+
uv installed
Ollama installed and running locally
XAMPP or another local MySQL service running
A MySQL database named
mcp_dbA table named
employee_salaryin that database
Install uv
If you do not have uv installed yet:
pip install uvOr follow the official uv installation instructions for your OS.
Ollama setup
Make sure Ollama is installed and the service is running.
Pull the required models:
ollama pull llama3.1
ollama pull nomic-embed-textStart Ollama:
ollama serveIf Ollama is already running in the background, you can skip this step.
The app uses these default values:
OLLAMA_BASE_URL=http://localhost:11434
LLM_MODEL=llama3.1
EMBEDDING_MODEL=nomic-embed-textMySQL / XAMPP setup
This project is configured to work with a local MySQL instance, typically running under XAMPP.
Recommended DB values
Use the following values in your .env file:
DB_HOST=127.0.0.1
DB_NAME=mcp_db
DB_USER=root
DB_PASSWORD=root
DB_PORT=3306Important notes:
Use
127.0.0.1instead oflocalhostwhen running MySQL via XAMPP for better reliability on WindowsEnsure XAMPP MySQL is running before starting the app
The app expects the database
mcp_dbto exist
Example table
The application is designed around a table like:
CREATE TABLE employee_salary (
emp_id INT PRIMARY KEY,
emp_name VARCHAR(100),
department VARCHAR(50),
designation VARCHAR(50),
base_salary DECIMAL(10,2),
bonus DECIMAL(10,2),
total_salary DECIMAL(10,2),
joining_date DATE
);Sample rows may look like:
INSERT INTO employee_salary (emp_id, emp_name, department, designation, base_salary, bonus, total_salary, joining_date)
VALUES
(1, 'Alice Johnson', 'Engineering', 'Software Developer', 75000.00, 5000.00, 80000.00, '2021-03-15'),
(2, 'Bob Smith', 'Engineering', 'DevOps Engineer', 72000.00, 4500.00, 76500.00, '2020-07-10');Environment configuration
Create a .env file in the project root if it does not already exist.
Example:
DB_HOST=127.0.0.1
DB_NAME=mcp_db
DB_USER=root
DB_PASSWORD=root
DB_PORT=3306
OLLAMA_BASE_URL=http://localhost:11434
LLM_MODEL=llama3.1
EMBEDDING_MODEL=nomic-embed-text
TABLE_NAME=employee_salaryYou can copy the values from .env.example if present in the project.
Running the project with uv
From the project folder:
cd C:\Users\srb3365\Documents\Projects\Python\querybridgeInstall dependencies:
uv syncRun the app:
uv run python main.pyWhen prompted, ask a question such as:
what is base salary of Bob SmithThe app will:
read the schema from MySQL
ask Ollama to generate a safe SELECT query
call the MCP database tool
return a natural-language answer based on the results
Quick validation commands
Check that MySQL is reachable:
uv run python -c "from db.connection import get_engine; from sqlalchemy import text; e=get_engine(); c=e.connect(); print(c.execute(text('SELECT 1 AS ok')).scalar_one()); c.close()"Check the table exists:
uv run python -c "from db.connection import get_engine; from sqlalchemy import text; e=get_engine(); c=e.connect(); print(c.execute(text('SHOW TABLES')).fetchall()); c.close()"Troubleshooting
MySQL connection refused
Confirm XAMPP MySQL service is running
Check that port
3306is enabledUse
127.0.0.1instead oflocalhostValidate the database credentials in
.env
Ollama connection failed
Start Ollama with
ollama servePull the models:
ollama pull llama3.1andollama pull nomic-embed-textConfirm
OLLAMA_BASE_URLpoints to the correct host and port
SQL generated is wrong
This app validates SQL against the current schema and rejects invalid table names or columns. If the model hallucinates a wrong table, the app will use a safe fallback for common employee salary questions.
Notes
This is a local-first project designed to demonstrate:
local model inference with Ollama
structured database access through MCP
MySQL read-only query execution
AI + tools pattern for business data questions
License
This project is provided for local learning and experimentation.
Available Tools
3 toolsget_employee_salary_schemaA
Return the schema of the employee_salary table for AI/agent use.
| Name | Required | Description | Default |
|---|---|---|---|
No parameters | |||
Output Schema
| Name | Required | Description |
|---|---|---|
| result | Yes |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
The description indicates a read-only metadata retrieval operation ('Return the schema') and has no annotations to contradict this. However, it offers no additional behavioral context, such as whether the schema is cached, whether authentication is required, or any limitations. For such a simple tool, the basic behavior is adequately disclosed.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is a single concise sentence with the key action and resource front-loaded. The phrase 'for AI/agent use' is mildly redundant because the tool is already defined in an agent context, which prevents a perfect score.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
For a zero-parameter metadata tool with a provided output schema, the description sufficiently states the returned object. It lacks explicit guidance on when to call it relative to sibling tools, but the simplicity of the operation and the presence of an output schema make the definition essentially complete.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
The tool has zero parameters, so the schema naturally covers all parameter semantics (100% coverage). Per the baseline for 0-parameter tools, the description does not need to add parameter details and none are missing.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description states a specific verb ('Return') and resource ('schema of the employee_salary table'), making the tool's function unambiguous. It clearly differs from sibling tools read_employee_salary and query_employee_salary, which would fetch data rather than metadata.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
No guidance is given on when to use this tool versus the sibling read/query tools. The agent must infer from the tool name and context that this is the metadata lookup and the others are data access, which is not explicit.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
query_employee_salaryA
Run a read-only SQL query against the employee_salary table. Only SELECT statements are allowed.
| Name | Required | Description | Default |
|---|---|---|---|
| sql | Yes |
Output Schema
| Name | Required | Description |
|---|---|---|
| result | Yes |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
With no annotations provided, the description carries the full burden of disclosing behavior. It explicitly states the operation is read-only and limits input to SELECT statements, which is the most important safety behavior. It does not detail output formatting or query limits, but the available output schema helps cover return-value expectations.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is two short sentences with no filler. It front-loads the core action and constraint immediately, and every sentence adds meaningful guidance.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
For a single-parameter tool with an output schema, the description is largely sufficient: it names the target table, restricts the query type, and clarifies read-only intent. It could be more complete by mentioning sibling-tool usage or query limits, but those are secondary for correct invocation.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
The input schema provides only the parameter name 'sql' with no description, so schema coverage is 0%. The description compensates by clarifying that the sql parameter is a SQL query, must target the employee_salary table, and must be a SELECT statement. This gives the agent enough semantic grounding to construct the argument.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states the verb and resource: run a read-only SQL query against the employee_salary table. It also specifies that only SELECT statements are allowed, which gives concrete scope. However, it does not explicitly differentiate itself from sibling tools like read_employee_salary or get_employee_salary_schema.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description implies this tool is for running ad-hoc read-only SQL queries against the employee_salary table. It provides a meaningful constraint ('Only SELECT statements are allowed') but gives no explicit guidance on when to choose this over read_employee_salary or get_employee_salary_schema.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
read_employee_salaryA
Read the latest rows from employee_salary. Keep the result small for LLM use.
| Name | Required | Description | Default |
|---|---|---|---|
| limit | No |
Output Schema
| Name | Required | Description |
|---|---|---|
| result | Yes |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
With no annotations provided, the description carries the behavioral disclosure burden. 'Read' implies a non-mutating operation, and 'latest rows' suggests ordering by recency, but the description does not reveal limits on result size, pagination behavior, or any other side effects or constraints.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is two short sentences with no filler. The primary action is front-loaded, and the secondary sentence provides useful usage guidance without redundancy.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
For a simple read tool with one optional parameter and an output schema, the description is reasonably complete. However, it leaves the limit parameter semantics and the relationship to query_employee_salary implicit, so an agent must infer when this tool is the right choice.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema description coverage is 0%, and the description does not explicitly explain the 'limit' parameter or how it relates to 'latest rows.' The phrase 'Keep the result small' indirectly implies limiting output, but it does not add clear parameter-level meaning beyond the schema's title and default.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states the action ('Read') and the resource ('employee_salary'), and narrows the scope to 'latest rows,' which helps distinguish it from the more general query_employee_salary sibling. However, it does not explicitly name or contrast the sibling tools, so it stops short of full differentiation.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The instruction 'Keep the result small for LLM use' gives clear practical context for how the tool should be invoked. It does not explicitly state when to choose this tool over query_employee_salary or get_employee_salary_schema, so there is no exclusion guidance.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections. Dates show when Glama detected each change.
3 tool updates
v0.1.0- First observed
get_employee_salary_schema - First observed
query_employee_salary - First observed
read_employee_salary
TDQS
Scored across 3 tools
Each tool has a clearly distinct purpose: schema introspection, small sample reads, and arbitrary read-only SQL queries. The read and query tools could theoretically overlap, but their descriptions make the intended use obvious.
All tool names follow a consistent verb_noun pattern around the employee_salary entity. get, read, and query are different verbs but align naturally with each tool's specific action.
Three tools is well-scoped for a focused server that exposes one table with schema, sample data, and ad-hoc querying. There are no unnecessary extras and nothing feels missing.
The server fully covers its intended read-only domain: understanding the schema, seeing recent rows, and running arbitrary SELECT queries. Write operations are not needed given the explicit read-only scope.
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Related MCP Connectors
- mcpOAuthcom.gibsonai
GibsonAI MCP server: manage your databases with natural language
Self-hosted MCP gateway: turn any API, database or MCP server into AI connectors — no code.
Query your warehouse or a CSV with Claude/ChatGPT over MCP, governed by table-level ACL + audit.
The Remote MCP server acts as a standardized bridge between LLM applications (like Claude, ChatGPT, and Cursor) and external services, enabling AI agents to access external tools and resources. Its primary capability is providing a centralized search tool to discover other MCP servers and their respective tools. Unlike local implementations, it runs remotely with OAuth authentication and permission controls for security.
Related MCP Servers
- FlicenseNot gradedqualityDmaintenanceA Model Context Protocol server that enables AI models to interact with MySQL databases through natural language, supporting SQL queries, table creation, and schema exploration.3-
- AlicenseNot gradedqualityDmaintenanceA tool that connects to local MySQL databases and enables large language models (LLMs) to execute SQL queries through the Model Context Protocol (MCP).2201MIT
- FlicenseNot gradedqualityDmaintenanceA secure MySQL Model Context Protocol server that enables AI agents to interact with MySQL databases through standardized operations. Features comprehensive security with SQL injection prevention, connection pooling, and configurable tool access for database operations.1-
- AlicenseAqualityCmaintenanceA lightweight MySQL MCP server that enables LLMs to interact with databases through tools for schema inspection and query execution. It features LLM-friendly formatting, SSL support, and a secure read-only mode with query timeout protections.753MIT
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/shahin-raza/querybridge'
If you have feedback or need assistance with the MCP directory API, please join our Discord server