Skip to main content
Glama

SQLite MCP Server

SQLite MCP 服务器

概述

模型上下文协议 (MCP) 服务器实现,通过 SQLite 提供数据库交互和商业智能功能。该服务器支持运行 SQL 查询、分析业务数据并自动生成业务洞察备忘录。

成分

资源

服务器公开单个动态资源:

  • memo://insights :持续更新的业务洞察备忘录,汇总分析过程中发现的洞察
    • 通过附加洞察工具发现新见解时自动更新

提示

服务器提供演示提示:

  • mcp-demo :指导用户完成数据库操作的交互式提示
    • 必需参数: topic - 要分析的业务领域
    • 生成适当的数据库模式和示例数据
    • 指导用户进行分析和洞察生成
    • 与业务洞察备忘录集成

工具

该服务器提供六个核心工具:

查询工具
  • read_query
    • 执行 SELECT 查询以从数据库读取数据
    • 输入:
      • query (字符串):要执行的 SELECT SQL 查询
    • 返回:查询结果作为对象数组
  • write_query
    • 执行 INSERT、UPDATE 或 DELETE 查询
    • 输入:
      • query (字符串):SQL 修改查询
    • 返回: { affected_rows: number }
  • create_table
    • 在数据库中创建新表
    • 输入:
      • query (字符串):CREATE TABLE SQL语句
    • 返回:表创建确认
架构工具
  • list_tables
    • 获取数据库中所有表的列表
    • 无需输入
    • 返回:表名称数组
  • describe-table
    • 查看特定表的架构信息
    • 输入:
      • table_name (字符串):要描述的表的名称
    • 返回:具有名称和类型的列定义数组
分析工具
  • append_insight
    • 向备忘录资源添加新的业务见解
    • 输入:
      • insight (字符串):从数据分析中发现的商业洞察
    • 返回:确认洞察力的增加
    • 触发 memo://insights 资源的更新

与 Claude Desktop 一起使用

紫外线

# Add the server to your claude_desktop_config.json "mcpServers": { "sqlite": { "command": "uv", "args": [ "--directory", "parent_of_servers_repo/servers/src/sqlite", "run", "mcp-server-sqlite", "--db-path", "~/test.db" ] } }

Docker

# Add the server to your claude_desktop_config.json "mcpServers": { "sqlite": { "command": "docker", "args": [ "run", "--rm", "-i", "-v", "mcp-test:/mcp", "mcp/sqlite", "--db-path", "/mcp/test.db" ] } }

与 VS Code 一起使用

为了快速安装,请点击下面的安装按钮:

如需手动安装,请将以下 JSON 块添加到 VS Code 中的“用户设置 (JSON)”文件中。您可以按下Ctrl + Shift + P并输入Preferences: Open Settings (JSON)来完成此操作。

或者,您可以将其添加到工作区中名为.vscode/mcp.json的文件中。这样您就可以与其他人共享该配置。

请注意,使用mcp.json文件时需要mcp密钥。

紫外线

{ "mcp": { "inputs": [ { "type": "promptString", "id": "db_path", "description": "SQLite Database Path", "default": "${workspaceFolder}/db.sqlite" } ], "servers": { "sqlite": { "command": "uvx", "args": [ "mcp-server-sqlite", "--db-path", "${input:db_path}" ] } } } }

Docker

{ "mcp": { "inputs": [ { "type": "promptString", "id": "db_path", "description": "SQLite Database Path (within container)", "default": "/mcp/db.sqlite" } ], "servers": { "sqlite": { "command": "docker", "args": [ "run", "-i", "--rm", "-v", "mcp-sqlite:/mcp", "mcp/sqlite", "--db-path", "${input:db_path}" ] } } } }

建筑

Docker:

docker build -t mcp/sqlite .

使用 MCP 检查器进行测试

uv add "mcp[cli]" mcp dev src/mcp_server_sqlite/server.py:wrapper

执照

此 MCP 服务器采用 MIT 许可证。这意味着您可以自由使用、修改和分发该软件,但须遵守 MIT 许可证的条款和条件。更多详情,请参阅项目仓库中的 LICENSE 文件。

Deploy Server
A
security – no known vulnerabilities
A
license - permissive license
A
quality - confirmed to work

local-only server

The server can only run on the client's local machine because it depends on local resources.

模型上下文协议 (MCP) 服务器实现,通过 SQLite 提供数据库交互和商业智能功能。该服务器支持运行 SQL 查询、分析业务数据并自动生成业务洞察备忘录。

  1. 概述
    1. 成分
      1. 资源
      2. 提示
      3. 工具
    2. 与 Claude Desktop 一起使用
      1. 紫外线
      2. Docker
    3. 与 VS Code 一起使用
      1. 紫外线
      2. Docker
    4. 建筑
      1. 使用 MCP 检查器进行测试
        1. 执照

          Related MCP Servers

          • A
            security
            A
            license
            A
            quality
            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.
            Last updated -
            17
            MIT License
            • Apple
          • -
            security
            F
            license
            -
            quality
            A Model Context Protocol server that provides tools for connecting to and interacting with various database systems (SQLite, PostgreSQL, MySQL/MariaDB, SQL Server) through a unified interface.
            Last updated -
            3
          • -
            security
            F
            license
            -
            quality
            A Model Context Protocol server that enables SQL operations (SELECT, INSERT, UPDATE, DELETE) and table management through a standardized interface with SQLite databases.
            Last updated -
            26
          • -
            security
            F
            license
            -
            quality
            A Model Context Protocol (MCP) server that converts natural language queries into SQL statements, allowing users to query MySQL databases using conversational language instead of writing SQL code.
            Last updated -
            3

          View all related MCP servers

          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/modelcontextprotocol/sqlite'

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