mcp sqlite bun server
A Model Context Protocol server that provides database interaction capabilities through SQLite, enabling users to run SQL queries, analyze business data, and automatically generate business insight memos.
A Model Context Protocol server that provides database interaction capabilities through SQLite, enabling users to run SQL queries, analyze business data, and automatically generate business insight memos.
A Model Context Protocol (MCP) server implementation that provides database interaction and business intelligence capabilities through SQLite. This server enables running SQL queries, analyzing business data, and automatically generating business insight memos.
bun install
bun run setup
The setup script will automatically add the server configuration to your Claude Desktop config file, located at:
- macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
The server exposes a single dynamic resource:
- memo://insights
: A continuously updated business insights memo that aggregates discovered insights during analysis
- Auto-updates as new insights are discovered via the append-insight tool
The server provides a demonstration prompt:
- mcp-demo
: Interactive prompt that guides users through database operations
- Required argument: topic
- The business domain to analyze
- Generates appropriate database schemas and sample data
- Guides users through analysis and insight generation
- Integrates with the business insights memo
The server offers six core tools:
read-query
query
(string): The SELECT SQL query to executeReturns: Query results as array of objects
write-query
query
(string): The SQL modification queryReturns: { affected_rows: number }
create-table
query
(string): CREATE TABLE SQL statementlist-tables
Returns: Array of table names
describe-table
table_name
(string): Name of table to describeappend-insight
insight
(string): Business insight discovered from data analysissrc/index.ts
: Main server implementationsrc/logger.ts
: Logging utilityscripts/setup.ts
: Claude Desktop configuration scriptThe server maintains detailed logs in:
- server.log
: Located in the project root directory
- Logs include timestamps, log levels (DEBUG, INFO, WARN, ERROR, FATAL), and structured metadata
The SQLite database file is created at:
- data.sqlite
: Located in the project root directory
- Created automatically if it does not exist
bun run setup
: Configure the server in Claude Desktopbun run lint
: Run ESLint checksbun run lint:fix
: Fix ESLint issues automaticallybun run inspect
: Run the MCP inspectorThis MCP server is licensed under the MIT License. See the LICENSE file for details.
[
{
"description": "Execute a read-only SQL query",
"inputSchema": {
"properties": {
"query": {
"description": "a SELECT query",
"pattern": "^SELECT",
"type": "string"
}
},
"required": [
"query"
],
"type": "object"
},
"name": "read-query"
},
{
"description": "Execute a write SQL query",
"inputSchema": {
"properties": {
"query": {
"description": "an INSERT, UPDATE, or DELETE query",
"pattern": "^(INSERT|UPDATE|DELETE)",
"type": "string"
}
},
"required": [
"query"
],
"type": "object"
},
"name": "write-query"
},
{
"description": "Create a new table in the database",
"inputSchema": {
"properties": {
"query": {
"description": "a CREATE TABLE statement",
"pattern": "^CREATE TABLE",
"type": "string"
}
},
"required": [
"query"
],
"type": "object"
},
"name": "create-table"
},
{
"description": "List all tables in the database",
"inputSchema": {
"type": "object"
},
"name": "list-tables"
},
{
"description": "Get schema information for a table",
"inputSchema": {
"properties": {
"table_name": {
"type": "string"
}
},
"required": [
"table_name"
],
"type": "object"
},
"name": "describe-table"
},
{
"description": "Add a business insight to the memo",
"inputSchema": {
"properties": {
"insight": {
"type": "string"
}
},
"required": [
"insight"
],
"type": "object"
},
"name": "append-insight"
}
]