================== /// MCP /// /// XIY /// ================== [server:online] [protocol:ready]
xiyan_mcp_server
by XGenerationLab
Model-Context-Protocol (MCP) server that turns natural-language questions into SQL through the XiYanSQL model and executes them on MySQL/PostgreSQL databases.
190
34
Open Source01
get_data
Retrieve data from a database using natural-language input that is automatically converted to SQL and executed, returning the query results.
02
{dialect}://{table_name}
Return a sample portion of data from the specified table in the connected database.
03
{dialect}://
List the names of the databases currently available on the connected server.
Installation
1. Clone the repository
git clone https://github.com/XGenerationLab/xiyan_mcp_server.git
cd xiyan_mcp_server
2. Create and activate a Python virtual environment (Python ≥3.9)
python -m venv .venv
source .venv/bin/activate # Windows: .venv\Scripts\activate
3. Install server dependencies
pip install --upgrade pip
pip install -r requirements.txt
4. Configuration
• Copy the provided environment template if present; otherwise create a .env file.
• Required variables
cp .env.example .env # adjust values
DATABASE_URL # e.g., postgresql://user:pass@localhost/dbname
OPENAI_API_KEY # (or other LLM provider key used by MCP)
SERVER_PORT=8080 # optional – default 8080
5. Run database migrations (if Alembic or equivalent is provided)
alembic upgrade head # skip if repo does not contain migrations
6. Start the server
python -m xiyan_mcp_server --host 0.0.0.0 --port $SERVER_PORT
# or: uvicorn xiyan_mcp_server.app:app --host 0.0.0.0 --port $SERVER_PORT (FastAPI)
7. (Optional) Docker
docker build -t xiyan-mcp .
docker run -d -p 8080:8080 --env-file .env xiyan-mcp
After the server is up, navigate to http://localhost:8080/health or similar health-check endpoint to confirm the deployment.
Documentation
License: Apache License 2.0
Updated 7/30/2025