Skip to main content
Glama

Server Configuration

Describes the environment variables required to run the server.

NameRequiredDescriptionDefault
DB_TYPENoDatabase engine type (sqlite, postgres, postgresql). Alternative environment variable: MCP_DB_TYPE.
MCP_DB_TYPENoAlternative environment variable for database engine type.
ALLOW_WRITESNoEnable write operations (DML/DDL queries). Default is false.
DATABASE_URLNoDatabase connection string. Alternative environment variable: MCP_DB_CONNECTION_STRING.
ALLOWED_DATABASE_DIRNoRestricts SQLite database paths to be inside this directory.
MCP_DB_CONNECTION_STRINGNoAlternative environment variable for database connection string.

Capabilities

Features and capabilities supported by this server

CapabilityDetails
tools
{
  "listChanged": false
}
prompts
{
  "listChanged": false
}
resources
{
  "subscribe": false,
  "listChanged": false
}
experimental
{}

Tools

Functions exposed to the LLM to take actions

NameDescription
connect_databaseA

Connect to a SQLite or PostgreSQL database. For SQLite, connection_string can be a file path (e.g. 'dev.db') or ':memory:'. For Postgres, connection_string must be a valid PostgreSQL connection URI. Resolves relative paths for SQLite databases against the current working directory.

list_tablesA

List all table names and their descriptions in the connected database.

describe_tableA

Retrieve table columns, data types, primary key status, foreign keys, indexes, and a sample of 5 rows.

run_queryA

Execute a SQL query against the database. Checked for safety. Read-only SELECT by default.

explain_query_planB

Run EXPLAIN on a SQL query to inspect the database execution path.

get_table_statsA

Profile a table to compute row count, null rates, cardinality, and numeric ranges (min/max/average).

generate_erdB

Generate a Mermaid.js Entity Relationship Diagram (ERD) based on tables and foreign keys.

Prompts

Interactive templates invoked by user choice

NameDescription
analyze-schemaHelp analyze the current database schema, suggest insights, and propose analytical questions.
suggest-sqlTranslate a natural language question into a safe and optimized SQL query based on the schema.
optimize-queryAnalyze a SQL query and its EXPLAIN query plan to suggest optimizations and missing indexes.

Resources

Contextual data attached and managed by the client

NameDescription

No resources

Latest Blog Posts

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/arman1o1/mcp-db-explorer'

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