Skip to main content
Glama

MCP SQL Agent

by sharansahu
MIT License
  • Apple
  • Linux

Server Configuration

Describes the environment variables required to run the server.

NameRequiredDescriptionDefault
DB_DSNNoOracle database connection string in the format hostname:port/service_name
DB_HOSTNoMySQL database host
DB_NAMENoMySQL database name
DB_PATHNoPath to the SQLite database file
DB_PORTNoMySQL database port
DB_TYPEYesThe type of database to connect to (sqlite, mysql, or oracle)
DB_USERNoDatabase username (for MySQL or Oracle)
DB_PASSWORDNoDatabase password (for MySQL or Oracle)
OPENAI_API_KEYYesYour OpenAI API key from platform.openai.com/api-keys

Schema

Prompts

Interactive templates invoked by user choice

NameDescription
database_contextProvides context about the database schema for the AI assistant
example_prompt

Resources

Contextual data attached and managed by the client

NameDescription

No resources

Tools

Functions exposed to the LLM to take actions

NameDescription
get_schema

Get the complete database schema with table structures and sample data

list_tables

List all tables in the database

describe_table

Get detailed information about a specific table including columns and sample data

query_data

Execute SQL queries safely. Use get_schema() first to understand the database structure.

search_tables

Search for tables or columns containing a specific keyword

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/sharansahu/mcp-sql'

If you have feedback or need assistance with the MCP directory API, please join our Discord server