Skip to main content
Glama

MCP-Turso

mcp-turso

模型上下文协议 (MCP) 服务器,提供对 Turso 托管的 LibSQL 数据库的访问。目前,该服务器提供以下功能:

  • 检索数据库中的表列表
  • 检索数据库的架构
  • 检索表的架构
  • 执行 SELECT 查询

配置

使用 Claude Desktop

将其添加到您的claude_desktop_config.json中:

{ "mcpServers": [ "turso": { "command": "npx", "args": ["-y", "mcp-turso"], "env": { "TURSO_DATABASE_URL": "your_url", "TURSO_AUTH_TOKEN": "your_token" } } ] }

您需要一个现有的数据库才能继续。如果没有,请创建一个。要通过 Turso CLI 获取数据库 URL,请运行:

turso db show --url <database-name>

然后获取数据库身份验证令牌:

turso db tokens create <database-name>

将这些值添加到您的配置中,如上所示。

使用光标

要使用 Cursor 配置 Turso MCP 服务器,请将以下内容添加到 Cursor 设置中:

  1. 打开 Cursor 并转到“设置 (⚙️)”>“设置 (JSON)”
  2. 将以下配置添加到您的设置 JSON:
"mcpServers": { "turso": { "command": "npx", "args": ["-y", "mcp-turso"], "env": { "TURSO_DATABASE_URL": "your_url", "TURSO_AUTH_TOKEN": "your_token" } } }

按照上一节所述,将your_urlyour_token替换为您的 Turso 数据库 URL 和身份验证令牌。

日志记录

该服务器包含一个自定义日志记录器,用于在 Claude Desktop 之外进行调试。默认情况下,此日志记录器会写入<parent-dir>/logs/mcp-turso.log ,其中<parent-dir>是包含mcp-turso脚本的目录的父目录。换句话说,如果mcp-turso的路径是~/foo/bin/mcp-turso ,则日志将位于~/foo/logs/mcp-turso.log 。如果像上面一样使用 NPX 运行,则默认日志将为:

~/.npm/_npx/<npx-dir-name>/node_modules/mcp-turso/logs/mcp-turso.log

如果您想指定自定义路径,您可以在服务器配置中包含带有绝对 posix 路径--logs标志:

{ "mcpServers": [ "turso": { "command": "npx", "args": ["-y", "mcp-turso", "--logs", "/Users/<username>/path/to/dir/mcp-logs.log"], "env": { "TURSO_DATABASE_URL": "your_url", "TURSO_AUTH_TOKEN": "your_token" } } ] }

服务器创建时,日志文件的路径(默认或自定义)始终会记录到stderr 。对于 Claude 桌面版,该路径将显示在服务器日志的~/Library/Logs/Claude目录中。

注意:目前,我还没有实现为 Windows 指定自定义日志文件,但即将实现。

服务器功能

该服务器提供以下工具:

  • list_tables
    • 获取数据库中所有表的列表
    • 无输入
    • 返回:表名数组
  • get_db_schema
    • 获取数据库中所有表的架构
    • 无输入
    • 返回:SQL 创建语句数组
  • describe_table
    • 查看特定表的架构信息
    • 输入:
      • table_name (字符串):要描述的表的名称
    • 返回:具有名称和类型的列定义数组
  • query_database
    • 执行 SELECT 查询以从数据库读取数据
    • 输入:
      • sql (字符串):要执行的 SELECT SQL 查询
    • 返回:查询结果为类型对象{ columns: string[]; rows: Record<string, unknown>[]; rowCount: number; }

待办事项

  • [ ] 添加在 Windows 上指定自定义日志文件的功能
  • [ ] 添加更多查询工具

执照

MIT 许可证 - 有关详细信息,请参阅LICENSE文件。

-
security - not tested
A
license - permissive license
-
quality - not tested

remote-capable server

The server can be hosted and run remotely because it primarily relies on remote services or has no dependency on the local environment.

模型上下文协议服务器为 Claude 提供对 Turso 托管的 LibSQL 数据库的访问,从而实现数据库表列表、模式检索和 SELECT 查询执行。

  1. 配置
    1. 使用 Claude Desktop
    2. 使用光标
    3. 日志记录
  2. 服务器功能
    1. 待办事项
      1. 执照

        Related MCP Servers

        • -
          security
          F
          license
          -
          quality
          A Model Context Protocol server that enables SQL query execution, database management, and business intelligence capabilities through MySQL connections.
          Last updated -
          JavaScript
        • 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 -
          6
          9
          TypeScript
          MIT License
          • Apple
        • -
          security
          -
          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 -
          Python
        • -
          security
          F
          license
          -
          quality
          A Model Context Protocol server that provides tools for interacting with databases, including PostgreSQL, DuckDB, and Google Cloud Storage Parquet files.
          Last updated -
          2
          TypeScript
          • Linux
          • Apple

        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/nbbaier/mcp-turso'

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