Skip to main content
Glama
nbbaier

MCP-Turso

by nbbaier

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_url和your_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 指定自定义日志文件,但即将实现。

Related MCP server: Supabase MCP Server

服务器功能

该服务器提供以下工具:

  • 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文件。

Available Tools

4 tools
describe_tableC

View schema information for a specific table

ParametersJSON Schema
NameRequiredDescriptionDefault
table_nameYesName of the table to describe

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 the full burden of behavioral disclosure. It implies a read-only operation ('View'), but does not specify permissions, rate limits, error handling, or what 'schema information' entails (e.g., columns, types, constraints). This leaves significant gaps for a tool with mutation potential.

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 is front-loaded and wastes no words. It directly conveys the core purpose without unnecessary elaboration, earning full marks for conciseness.

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 lack of annotations and output schema, the description is incomplete. It does not explain what 'schema information' includes or the return format, which is crucial for a tool that likely provides structured data. This leaves the agent with insufficient context for effective 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 input schema has 100% description coverage, with the parameter 'table_name' well-documented. The description adds no additional meaning beyond the schema, such as format examples or constraints, so it meets the baseline for high schema coverage without compensating value.

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 ('View') and resource ('schema information for a specific table'), making the purpose understandable. However, it does not explicitly differentiate from sibling tools like 'get_db_schema' or 'list_tables', which might also provide schema-related information, so it misses the highest 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_db_schema' or 'list_tables'. It lacks context on prerequisites, exclusions, or specific scenarios, leaving the agent without clear usage instructions.

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

get_db_schemaB

Get the schema for all tables in the 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 ('Get') but lacks details on permissions, rate limits, response format, or potential side effects. For a tool that likely returns structured data, 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, 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 (a tool that likely returns database metadata), lack of annotations, and no output schema, the description is incomplete. It doesn't explain what the schema includes (e.g., table names, columns, types) or the return format, leaving significant gaps for an AI agent to use it effectively.

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 tool has 0 parameters, and schema description coverage is 100%, so no parameter documentation is needed. The description doesn't add parameter details, which is appropriate, but it could have mentioned if any implicit parameters (e.g., database connection) are assumed. Baseline for 0 params is 4.

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 ('Get') and resource ('schema for all tables in the database'), making the purpose immediately understandable. However, it doesn't explicitly differentiate from sibling tools like 'describe_table' or 'list_tables', which might provide similar or overlapping functionality.

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?

No guidance is provided on when to use this tool versus alternatives such as 'describe_table' or 'list_tables'. The description implies a broad scope ('all tables'), but it doesn't specify prerequisites, exclusions, or contextual recommendations for choosing this tool over others.

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 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 tool lists tables but doesn't mention important behavioral aspects like whether it returns metadata, pagination behavior, performance characteristics, or error conditions. 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, efficient sentence that directly states the tool's purpose without any unnecessary words. It's perfectly front-loaded and wastes no space, making it ideal for quick comprehension.

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 tool with no annotations and no output schema, the description is insufficiently complete. It doesn't explain what information is returned about each table, whether there are any constraints or limitations, or how this differs from sibling tools. The agent would need to guess about important operational details.

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 tool has 0 parameters with 100% schema description coverage, so the schema already fully documents the input requirements. The description appropriately doesn't add parameter information beyond what's already covered, earning a baseline score of 4 for zero-parameter tools.

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 ('List') and resource ('all tables in the database'), making the tool's purpose immediately understandable. However, it doesn't explicitly differentiate from sibling tools like 'describe_table' or 'get_db_schema', which prevents 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?

No guidance is provided about when to use this tool versus alternatives like 'get_db_schema' or 'describe_table'. The description only states what the tool does, leaving the agent to infer usage context without explicit direction.

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

query_databaseC

Execute a SELECT query to read data from the database

ParametersJSON Schema
NameRequiredDescriptionDefault
sqlYesSQL 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 the full burden of behavioral disclosure. It states this is for 'read data' operations, which implies non-destructive behavior, but doesn't clarify important aspects like authentication requirements, rate limits, error handling, or result format. The description is too minimal to provide adequate transparency for a database query tool.

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 - a single sentence that communicates the essential purpose without any wasted words. It's front-loaded with the core functionality and uses precise technical language ('SELECT query', 'read data'). Every word earns its place in this minimal but complete statement.

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 insufficiently complete. It doesn't address critical context like what happens with invalid SQL, whether transactions are supported, what the return format looks like, or any performance considerations. The description covers only the most basic purpose without addressing the operational complexity of database interactions.

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 description adds no parameter-specific information beyond what's already in the schema (which has 100% coverage). The schema fully documents the single 'sql' parameter with its type and constraints. The description doesn't provide additional context about SQL syntax requirements, supported SQL features, or query limitations. Baseline score of 3 is appropriate when schema coverage is complete.

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 a SELECT query') and resource ('read data from the database'), making the purpose immediately understandable. It distinguishes from siblings like 'describe_table' or 'list_tables' by focusing on query execution rather than metadata retrieval. However, it doesn't explicitly mention what type of database or data is involved, which prevents 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 like 'get_db_schema' or 'describe_table'. It doesn't mention prerequisites (e.g., needing valid SQL syntax) or constraints (e.g., read-only queries only). While the description implies usage for reading data, it lacks explicit when-to-use or when-not-to-use instructions.

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.

  1. 4 tool updatesv1.0.0
    • Changeddescribe_table3 fields changed
      • addedInput schema / $schema
        Added value: +"http://json-schema.org/draft-07/schema#"
      • addedInput schema / additionalProperties
        Added value: +false
      • addedInput schema / properties / table_name / description
        Added value: +"Name of the table to describe"
    • Changedget_db_schema2 fields changed
      • addedInput schema / $schema
        Added value: +"http://json-schema.org/draft-07/schema#"
      • addedInput schema / additionalProperties
        Added value: +false
    • Changedlist_tables2 fields changed
      • addedInput schema / $schema
        Added value: +"http://json-schema.org/draft-07/schema#"
      • addedInput schema / additionalProperties
        Added value: +false
    • Changedquery_database3 fields changed
      • addedInput schema / $schema
        Added value: +"http://json-schema.org/draft-07/schema#"
      • addedInput schema / additionalProperties
        Added value: +false
      • addedInput schema / properties / sql / description
        Added value: +"SQL query to execute"
  2. 4 tool updates
    • First observeddescribe_table
    • First observedget_db_schema
    • First observedlist_tables
    • First observedquery_database

TDQS

A3.5/5.0

Scored across 4 tools

Disambiguation5/5

Each tool has a clearly distinct purpose with no overlap: describe_table focuses on a single table's schema, get_db_schema covers all tables' schemas, list_tables simply enumerates table names, and query_database handles data retrieval. An agent can easily differentiate these based on their specific scopes.

Naming Consistency5/5

All tools follow a consistent verb_noun pattern (describe_table, get_db_schema, list_tables, query_database) with clear, descriptive names. The naming is uniform and predictable, making it easy for agents to understand the action and target.

Tool Count5/5

With 4 tools, this server is well-scoped for database interaction, covering essential operations like schema inspection, table listing, and data querying. Each tool earns its place without feeling excessive or insufficient for the domain.

Completeness4/5

The tools provide solid coverage for read-only database operations, including schema exploration and data querying. However, there are minor gaps for a full database management scope, such as lacking write operations (e.g., insert, update, delete) or administrative functions, which agents might need to work around.

Maintenance

ActivityInactive
ResponsivenessUnresponsive

Related MCP Connectors

Related MCP Servers

  • A
    license
    B
    quality
    B
    maintenance
    🗂️ A Model Context Protocol (MCP) server that provides integration with Turso databases for LLMs. This server implements a two-level authentication system to handle both organization-level and database-level operations, making it easy to manage and query Turso databases directly from LLMs.
    9
    93 npm
    18
    MIT
  • A
    license
    Not graded
    quality
    F
    maintenance
    A Model Context Protocol server that enables Claude and other LLMs to perform database operations and invoke Edge Functions within Supabase through natural language.
    1,571 npm
    4
    MIT
  • A
    license
    Not graded
    quality
    D
    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.
    1,009 npm
    385
    MIT
  • F
    license
    Not graded
    quality
    D
    maintenance
    A Model Context Protocol server that allows Large Language Models like Claude to execute SQL queries, explore database schemas, and maintain persistent connections to SQL Server databases.
    -