Skip to main content
Glama
sam2332

SQLite MCP Server

by sam2332

SQLite MCP Server

A Model Context Protocol (MCP) server that provides tools for querying SQLite databases. This server allows AI assistants to interact with SQLite databases by listing tables, describing schemas, and executing queries.

Features

  • Connect to SQLite databases: Connect to any SQLite database file

  • List tables: Get all table names in the database

  • Describe table schemas: View column definitions, types, and constraints

  • Query data: Execute SELECT queries with automatic result formatting

  • Execute queries: Run INSERT, UPDATE, DELETE and other SQL operations

  • Get comprehensive table info: View schema, indexes, row counts, and sample data

Related MCP server: SQLite MCP Server

Installation

npm install
npm run build

Usage

As an MCP Server

Add to your MCP client configuration:

{
  "mcpServers": {
    "sqlite": {
      "command": "node",
      "args": ["path/to/dist/index.js"],
      "env": {}
    }
  }
}

Available Tools

  1. connect_database - Connect to a SQLite database file

    • path: Path to the SQLite database file

    • readonly: Optional boolean to open in read-only mode

  2. list_tables - List all tables in the connected database

  3. describe_table - Get the schema/structure of a specific table

    • table_name: Name of the table to describe

  4. query_data - Execute a SELECT query on the database

    • query: SQL SELECT query to execute

    • limit: Optional maximum number of rows to return (default: 100)

  5. execute_query - Execute any SQL query (INSERT, UPDATE, DELETE, etc.)

    • query: SQL query to execute

  6. get_table_info - Get comprehensive information about a table

    • table_name: Name of the table to analyze

    • sample_rows: Optional number of sample rows to return (default: 5)

Example Usage

  1. First connect to a database:

    Tool: connect_database
    Args: {"path": "./sample.db"}
  2. List all tables:

    Tool: list_tables
  3. Get detailed information about a table:

    Tool: get_table_info
    Args: {"table_name": "users", "sample_rows": 3}
  4. Query data:

    Tool: query_data
    Args: {"query": "SELECT * FROM users WHERE active = 1", "limit": 10}

Development

# Build TypeScript
npm run build

# Watch for changes during development
npm run dev

# Start the server
npm start

Requirements

  • Node.js 18 or higher

  • SQLite database files

Security Notes

  • The server can execute any SQL query, so ensure proper access controls

  • Consider using read-only mode for sensitive databases

  • SQL injection protection is the responsibility of the query author

Available Tools

6 tools
connect_databaseC

Connect to a SQLite database file

ParametersJSON Schema
NameRequiredDescriptionDefault
pathYesPath to the SQLite database file
readonlyNoOpen database in read-only mode

TDQS

C2.9/5.0
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, so the description carries the full burden of behavioral disclosure. It states the action ('Connect') but lacks critical details: whether this is a one-time or persistent connection, what happens on failure (e.g., error handling), if it requires specific permissions, or what the expected output might be. For a connection tool with zero annotation coverage, this is a significant gap in transparency.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single, efficient sentence that directly states the tool's purpose without any wasted words. It's front-loaded with the core action and resource, making it easy to parse quickly. Every part of the sentence earns its place by conveying essential information.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the complexity of a database connection tool (which involves state management and potential errors), the description is incomplete. There are no annotations to cover behavioral aspects, no output schema to explain return values, and the description itself lacks details on success/failure outcomes or connection lifecycle. This leaves the agent with insufficient context for reliable use.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The schema description coverage is 100%, meaning the input schema fully documents both parameters ('path' and 'readonly'). The description adds no additional parameter semantics beyond what's in the schema (e.g., it doesn't explain path formats or readonly implications). With high schema coverage, the baseline score of 3 is appropriate as the description doesn't compensate but also doesn't detract.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the action ('Connect to') and the resource ('a SQLite database file'), making the purpose immediately understandable. However, it doesn't differentiate this tool from its siblings (like 'query_data' or 'execute_query'), which would require specifying that this establishes a connection rather than performing operations on an already-connected database.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides no guidance on when to use this tool versus alternatives. It doesn't mention prerequisites (e.g., that this must be called before using other database tools), exclusions, or contextual cues. This leaves the agent to infer usage from the tool name alone, which is insufficient for optimal selection.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

describe_tableB

Get the schema/structure of a specific table

ParametersJSON Schema
NameRequiredDescriptionDefault
table_nameYesName of the table to describe

TDQS

B3.1/5.0
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations provided, the description carries the full burden of behavioral disclosure. It states the tool retrieves schema information but doesn't mention whether this is a read-only operation, if it requires specific permissions, what format the output is in, or any error conditions. This leaves significant gaps for a tool that interacts with database structures.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single, efficient sentence that directly states the tool's purpose without any wasted words. It is front-loaded and appropriately sized for a simple tool, making it easy for an agent to parse quickly.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the tool's low complexity (one parameter) and lack of annotations or output schema, the description is minimally adequate but incomplete. It covers the basic purpose but misses behavioral details like output format or error handling, which are important for a schema retrieval tool in a database context.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The input schema has 100% description coverage, with the 'table_name' parameter clearly documented. The description adds no additional meaning beyond what the schema provides, such as examples or constraints on table names. This meets the baseline for high schema coverage but doesn't enhance parameter understanding.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the tool's purpose with a specific verb ('Get') and resource ('schema/structure of a specific table'), making it easy to understand what it does. However, it doesn't explicitly differentiate from sibling tools like 'get_table_info' or 'list_tables', which might have overlapping functionality, preventing a perfect score.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides no guidance on when to use this tool versus alternatives such as 'get_table_info' or 'list_tables'. It lacks context about prerequisites (e.g., needing a database connection) or exclusions, leaving the agent to infer usage from the purpose alone.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

execute_queryC

Execute any SQL query (INSERT, UPDATE, DELETE, etc.)

ParametersJSON Schema
NameRequiredDescriptionDefault
queryYesSQL query to execute

TDQS

C2.9/5.0
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations provided, the description carries full burden for behavioral disclosure. It states the tool executes queries but doesn't mention critical behaviors: whether it requires authentication, what permissions are needed, if it's destructive (given it handles DELETE), what happens on errors, or what the return format is. For a mutation tool with zero annotation coverage, this leaves significant gaps.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is extremely concise (one sentence) and front-loaded with the core purpose. Every word earns its place by specifying the action and scope, with no redundant information. It efficiently communicates the essential function without unnecessary elaboration.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given this is a mutation tool (handling INSERT, UPDATE, DELETE) with no annotations and no output schema, the description is incomplete. It doesn't address safety concerns, authentication needs, error handling, or return values. For a tool that can modify data, this level of documentation is inadequate and could lead to misuse.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100%, with the single parameter 'query' fully documented in the schema. The description adds no additional parameter semantics beyond implying the query can include various SQL operations. Baseline 3 is appropriate since the schema does the heavy lifting, though the description doesn't compensate with extra details like syntax examples.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the action ('execute') and resource ('SQL query') with specific examples of query types (INSERT, UPDATE, DELETE). It distinguishes from siblings like 'query_data' by emphasizing 'any SQL query' rather than just data retrieval. However, it doesn't explicitly differentiate from all siblings like 'describe_table' or 'list_tables'.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides no guidance on when to use this tool versus alternatives like 'query_data' (which likely handles SELECT queries) or other siblings. It mentions 'any SQL query' but doesn't specify when to choose this over more specialized tools, nor does it mention prerequisites like needing a database connection first.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

get_table_infoB

Get comprehensive information about a table including schema, indexes, and sample data

ParametersJSON Schema
NameRequiredDescriptionDefault
table_nameYesName of the table to analyze
sample_rowsNoNumber of sample rows to return

TDQS

B3.2/5.0
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations provided, the description carries the full burden of behavioral disclosure. It mentions what information is returned but fails to describe critical traits such as whether this is a read-only operation, potential performance impacts, permissions required, or error handling. This leaves significant gaps for a tool that likely queries database metadata.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single, efficient sentence that front-loads the key action and details. It avoids unnecessary words and directly states the tool's function, though it could be slightly more structured by separating core purpose from additional features.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the tool's moderate complexity (2 parameters, no output schema, no annotations), the description is minimally adequate. It covers the basic purpose but lacks completeness in behavioral context, usage guidelines, and output details, which are important for effective agent invocation.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The schema description coverage is 100%, so the input schema already documents both parameters ('table_name' and 'sample_rows') with clear descriptions. The description adds no additional meaning beyond what the schema provides, such as format details or constraints, but doesn't contradict it either.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the verb ('Get') and resource ('table'), specifying what information is retrieved ('comprehensive information about a table including schema, indexes, and sample data'). It distinguishes from siblings like 'describe_table' by mentioning 'sample data', but doesn't explicitly differentiate in terms of scope or depth.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description implies usage for analyzing table structure and content, but provides no explicit guidance on when to use this tool versus alternatives like 'describe_table' or 'query_data'. It lacks any mention of prerequisites, exclusions, or specific contexts for selection.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

list_tablesB

List all tables in the connected database

ParametersJSON Schema
NameRequiredDescriptionDefault

No parameters

TDQS

B3.1/5.0
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations provided, the description carries the full burden of behavioral disclosure. It states the action ('List all tables') but doesn't mention any behavioral traits like whether this is a read-only operation, if it requires specific permissions, how results are formatted, or if there are rate limits. This leaves significant gaps for a tool that interacts with a database.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single, clear sentence with no wasted words. It's front-loaded with the core action and resource, making it easy to parse quickly. Every part of the sentence contributes directly to understanding the tool's purpose.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the complexity of database interactions and the lack of annotations and output schema, the description is incomplete. It doesn't address what the output looks like (e.g., list format, error handling), behavioral aspects like safety or permissions, or how it fits with siblings. For a tool with no structured support, more context is needed.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The input schema has 0 parameters with 100% coverage, so no parameter documentation is needed. The description appropriately doesn't add parameter details, as there are none to explain. This meets the baseline for tools with no parameters.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the verb ('List') and resource ('all tables in the connected database'), making the purpose immediately understandable. However, it doesn't explicitly differentiate from sibling tools like 'get_table_info' or 'describe_table', which might also provide table-related information but with different scopes or details.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides no guidance on when to use this tool versus alternatives such as 'get_table_info' or 'describe_table'. It lacks context about prerequisites (e.g., needing to connect to a database first) or exclusions, leaving the agent to infer usage based on tool names alone.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

query_dataC

Execute a SELECT query on the database

ParametersJSON Schema
NameRequiredDescriptionDefault
queryYesSQL SELECT query to execute
limitNoMaximum number of rows to return

TDQS

C2.9/5.0
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations provided, the description carries full burden but only states the basic action. It doesn't disclose critical behavioral traits like whether this requires authentication, what happens with malformed queries, if there are rate limits, or what the return format looks like. The description is minimal and lacks operational context.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single, efficient sentence that directly states the tool's purpose with zero wasted words. It's appropriately sized and front-loaded, making it easy to parse quickly.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a database query tool with no annotations and no output schema, the description is insufficient. It doesn't explain what gets returned (structure, format), error conditions, or dependencies on other tools like 'connect_database'. Given the complexity of SQL execution and lack of structured metadata, more context is needed.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100%, so the schema already documents both parameters thoroughly. The description adds no additional meaning about parameters beyond what's in the schema (e.g., no examples of valid SQL syntax, no explanation of how limit interacts with query). Baseline 3 is appropriate when schema does the heavy lifting.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the action ('Execute') and target ('SELECT query on the database'), providing a specific verb+resource combination. However, it doesn't distinguish this tool from its sibling 'execute_query', which appears to have overlapping functionality based on naming alone.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides no guidance on when to use this tool versus alternatives like 'execute_query' or 'describe_table'. It lacks any context about prerequisites (e.g., database connection status) or limitations (e.g., query types supported).

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.

  1. 6 tool updates
    • First observedconnect_database
    • First observeddescribe_table
    • First observedexecute_query
    • First observedget_table_info
    • First observedlist_tables
    • First observedquery_data

TDQS

B3.2/5.0
Disambiguation2/5

Multiple tools have overlapping purposes that could cause confusion. For example, 'describe_table' and 'get_table_info' both seem to provide table schema information, and 'execute_query' and 'query_data' both handle SQL queries with unclear boundaries (e.g., whether SELECT queries should use 'execute_query' or 'query_data'). This overlap makes it difficult for an agent to reliably choose the right tool.

Naming Consistency4/5

The tool names follow a consistent verb_noun pattern throughout (e.g., connect_database, describe_table, execute_query), which is predictable and readable. There are no deviations in naming conventions, though the verbs could be more precise to reduce ambiguity.

Tool Count5/5

With 6 tools, the server is well-scoped for interacting with SQLite databases. This count covers essential operations like connecting, listing tables, describing schemas, and executing queries, without being overly complex or too sparse. Each tool appears to earn its place in the set.

Completeness4/5

The tool set covers core database operations such as connection, table listing, schema inspection, and query execution, which are sufficient for most SQLite workflows. However, there is a minor gap in not having explicit tools for database management tasks like creating or dropping tables, though these could be handled via 'execute_query'. This does not significantly hinder agent functionality.

Maintenance

ActivityInactive
ResponsivenessNo issues

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

Related MCP Servers

  • A
    license
    Not graded
    quality
    D
    maintenance
    A Model Context Protocol server implementation that enables AI assistants to execute SQL queries and interact with SQLite databases through a structured interface.
    7
    MIT
  • A
    license
    B
    quality
    A
    maintenance
    A Model Context Protocol server that enables SQL operations (SELECT, INSERT, UPDATE, DELETE) and table management through a standardized interface with SQLite databases.
    7
    140
    1
    ISC
  • A
    license
    Not graded
    quality
    F
    maintenance
    A Model Context Protocol server that enables LLMs like Claude to interact with SQLite and SQL Server databases, allowing for schema inspection and SQL query execution.
    806
    380
    MIT
  • A
    license
    Not graded
    quality
    D
    maintenance
    Implements a Model Context Protocol server that enables natural language interactions with SQLite databases, providing tools to list tables, retrieve schemas, count rows, and execute read-only SQL queries.
    MIT

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/sam2332/mcp-quick-sqlite3'

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