Mcp Turso — independently scanned and version-tracked by SaferSkills.
SaferSkills independently audited Mcp Turso (Agent Skill) and scored it 100/100 (green). The audit ran 55 deterministic rules across Security, Supply Chain, Maintenance, Transparency, and Community; it found 0 high-severity and 0 lower-severity findings. The full rule-by-rule trace and per-finding evidence are below. Free, methodology-open.
Findings & checks · 0 flagged
Every scanned point with the score it earned and what moved between them.
First recorded scan — no prior version to compare against.
The primary manifest — the file an agent reads to learn what this artifact does.
MCP Turso é a primeira solução completa para integrar bancos de dados Turso Cloud com o Model Context Protocol (MCP) no VSCode. Este projeto permite que o GitHub Copilot interaja diretamente com seus bancos Turso através de ferramentas MCP, facilitando operações CRUD e consultas SQL.
O Model Context Protocol (MCP) é um protocolo aberto que permite aos Large Language Models (LLMs) se conectarem a ferramentas e dados externos de forma padronizada.
#### Componentes Principais:
#### Fluxo de Funcionamento:
ListToolsCallTool#### Segurança:
mcp-turso/
├── src/
│ └── index.ts # Servidor MCP principal
├── dist/ # Código compilado (gerado)
├── .env # Variáveis de ambiente (não versionado)
├── package.json # Dependências e scripts
├── tsconfig.json # Configuração TypeScript
└── README.md # Esta documentação# Criar pasta do projeto
mkdir mcp-turso
cd mcp-turso
# Inicializar projeto Node.js
npm init -ynpm install @modelcontextprotocol/sdk @libsql/client dotenv
npm install -D typescript @types/node tsxCrie o arquivo tsconfig.json:
{
"compilerOptions": {
"target": "ES2022",
"module": "ES2022",
"moduleResolution": "bundler",
"outDir": "./dist",
"rootDir": "./src",
"strict": true,
"esModuleInterop": true,
"skipLibCheck": true,
"resolveJsonModule": true
},
"include": ["src/**/*"],
"exclude": ["node_modules"]
}Crie a pasta src e o arquivo src/index.ts com o código fornecido no repositório.
Edite o package.json para incluir:
{
"name": "mcp-turso",
"version": "1.0.0",
"type": "module",
"bin": {
"mcp-turso": "./dist/index.js"
},
"scripts": {
"build": "tsc",
"dev": "tsx src/index.ts",
"start": "node dist/index.js"
},
"dependencies": {
"@libsql/client": "^0.14.0",
"@modelcontextprotocol/sdk": "^1.0.4",
"dotenv": "^16.4.5"
},
"devDependencies": {
"@types/node": "^22.10.2",
"tsx": "^4.19.2",
"typescript": "^5.7.2"
}
}npm run buildIsso cria a pasta dist/ com o código JavaScript compilado.
Crie um arquivo .env na raiz do projeto:
TURSO_DATABASE_URL=libsql://seu-banco.turso.io
TURSO_AUTH_TOKEN=seu-token-aquiPara obter o token:
turso auth tokenNa raiz do seu projeto (não do mcp-turso), crie .vscode/mcp.json:
{
"mcpServers": {
"turso-": {
"command": "node",
"args": ["C:/caminho/completo/mcp-turso/dist/index.js"],
"env": {
"TURSO_DATABASE_URL": "libsql://seu-banco.turso.io",
"TURSO_AUTH_TOKEN": "seu-token-aqui"
}
}
}
}Importante: Substitua C:/caminho/completo/ pelo caminho real onde você criou o projeto mcp-turso.
Feche completamente o VSCode e reabra para carregar a configuração MCP.
Abra o Copilot Chat (Ctrl + Shift + I) e teste os comandos:
Liste todas as tabelas do meu banco de timesMostre a estrutura da tabela jogadoresConte quantos jogadores estão confirmadosInsira um novo jogador: nome "Carlos", whatsapp "11987654321"Adicione uma coluna telefone do tipo TEXT na tabela jogadoresCrie um índice único no email dos usuáriosAdicione uma foreign key entre jogadores e times| Ferramenta | Descrição | Exemplo |
|---|---|---|
list_tables | Lista todas as tabelas | {} |
describe_table | Mostra estrutura de uma tabela | {"table": "jogadores"} |
execute_select | Executa SELECT (somente leitura) | {"query": "SELECT * FROM jogadores"} |
insert_data | Insere dados | {"table": "jogadores", "data": {"nome": "João"}} |
update_data | Atualiza dados | {"table": "jogadores", "data": {"status": "confirmado"}, "where": "id = 1"} |
delete_data | Deleta dados | {"table": "jogadores", "where": "id = 1"} |
count_rows | Conta registros | {"table": "jogadores", "where": "status = 'ativo'"} |
add_column | Adiciona coluna a tabela | {"table": "jogadores", "column": "telefone", "type": "TEXT"} |
execute_ddl | Executa comandos DDL | {"sql": "ALTER TABLE jogadores ADD COLUMN email TEXT"} |
create_index | Cria índice | {"name": "idx_jogadores_nome", "table": "jogadores", "column": "nome"} |
add_constraint | Adiciona constraint | {"table": "jogadores", "constraint_name": "fk_time", "constraint_type": "FOREIGN KEY", "columns": ["time_id"], "referenced_table": "times", "referenced_columns": ["id"]} |
begin_transaction | Inicia transação | {} |
commit_transaction | Confirma transação | {} |
rollback_transaction | Cancela transação | {} |
#### list_tables Descrição: Lista todas as tabelas do banco de dados Parâmetros: Nenhum Retorno: Lista de nomes de tabelas
#### describe_table Descrição: Mostra a estrutura completa de uma tabela Parâmetros:
{
"type": "object",
"properties": {
"table": {
"type": "string",
"description": "Nome da tabela a ser descrita"
}
},
"required": ["table"]
}Retorno: Schema da tabela com colunas, tipos e constraints
#### execute_select Descrição: Executa uma query SELECT (somente leitura) Parâmetros:
{
"type": "object",
"properties": {
"query": {
"type": "string",
"description": "Query SQL SELECT válida"
}
},
"required": ["query"]
}Validação: Query deve começar com "SELECT" (case insensitive) Retorno: Resultado da query em formato JSON
#### insert_data Descrição: Insere um novo registro na tabela Parâmetros:
{
"type": "object",
"properties": {
"table": {
"type": "string",
"description": "Nome da tabela"
},
"data": {
"type": "object",
"description": "Objeto com dados a inserir",
"additionalProperties": true
}
},
"required": ["table", "data"]
}Retorno: ID do registro inserido
#### update_data Descrição: Atualiza registros existentes Parâmetros:
{
"type": "object",
"properties": {
"table": {
"type": "string",
"description": "Nome da tabela"
},
"data": {
"type": "object",
"description": "Dados a atualizar",
"additionalProperties": true
},
"where": {
"type": "string",
"description": "Condição WHERE para identificar registros"
}
},
"required": ["table", "data", "where"]
}Retorno: Número de registros afetados
#### delete_data Descrição: Remove registros da tabela Parâmetros:
{
"type": "object",
"properties": {
"table": {
"type": "string",
"description": "Nome da tabela"
},
"where": {
"type": "string",
"description": "Condição WHERE para identificar registros"
}
},
"required": ["table", "where"]
}Retorno: Número de registros removidos
#### count_rows Descrição: Conta registros em uma tabela Parâmetros:
{
"type": "object",
"properties": {
"table": {
"type": "string",
"description": "Nome da tabela"
},
"where": {
"type": "string",
"description": "Condição WHERE opcional"
}
},
"required": ["table"]
}Retorno: Número total de registros
#### add_column Descrição: Adiciona uma nova coluna a uma tabela existente Parâmetros:
{
"type": "object",
"properties": {
"table": {
"type": "string",
"description": "Nome da tabela"
},
"column": {
"type": "string",
"description": "Nome da nova coluna"
},
"type": {
"type": "string",
"description": "Tipo de dados da coluna (ex: 'TEXT', 'INTEGER', 'REAL', 'BLOB')"
},
"nullable": {
"type": "boolean",
"description": "Se a coluna pode ser NULL (padrão: true)",
"default": true
},
"default_value": {
"type": "string",
"description": "Valor padrão da coluna (opcional)"
}
},
"required": ["table", "column", "type"]
}Retorno: Confirmação da adição da coluna
Para desenvolvimento local:
npm run dev # Executa com tsx (hot reload)args no .vscode/mcp.jsonC:/Users/Lucas Silva/projetos/mcp-turso/dist/index.jsnpm run build foi executado.vscode/mcp.json está corretoTURSO_DATABASE_URL e TURSO_AUTH_TOKEN estão corretosturso auth token para gerar um novo token se necessárionpm run build: Compila TypeScriptnpm run dev: Executa em modo desenvolvimentonpm start: Executa versão compiladagit checkout -b feature/nomeMIT
MCP Turso is the first complete solution to integrate Turso Cloud databases with Model Context Protocol (MCP) in VSCode. This project allows GitHub Copilot to interact directly with your Turso databases through MCP tools, facilitating CRUD operations and SQL queries.
Model Context Protocol (MCP) is an open protocol that allows Large Language Models (LLMs) to connect to external tools and data in a standardized way.
#### Main Components:
#### Operation Flow:
ListToolsCallTool#### Security:
mcp-turso/
├── src/
│ └── index.ts # Main MCP server
├── dist/ # Compiled code (generated)
├── .env # Environment variables (not versioned)
├── package.json # Dependencies and scripts
├── tsconfig.json # TypeScript configuration
└── README.md # This documentation# Create project folder
mkdir mcp-turso
cd mcp-turso
# Initialize Node.js project
npm init -ynpm install @modelcontextprotocol/sdk @libsql/client dotenv
npm install -D typescript @types/node tsxCreate tsconfig.json:
{
"compilerOptions": {
"target": "ES2022",
"module": "ES2022",
"moduleResolution": "bundler",
"outDir": "./dist",
"rootDir": "./src",
"strict": true,
"esModuleInterop": true,
"skipLibCheck": true,
"resolveJsonModule": true
},
"include": ["src/**/*"],
"exclude": ["node_modules"]
}Create src folder and src/index.ts with the code provided in the repository.
Edit package.json to include:
{
"name": "mcp-turso",
"version": "1.0.0",
"type": "module",
"bin": {
"mcp-turso": "./dist/index.js"
},
"scripts": {
"build": "tsc",
"dev": "tsx src/index.ts",
"start": "node dist/index.js"
},
"dependencies": {
"@libsql/client": "^0.14.0",
"@modelcontextprotocol/sdk": "^1.0.4",
"dotenv": "^16.4.5"
},
"devDependencies": {
"@types/node": "^22.10.2",
"tsx": "^4.19.2",
"typescript": "^5.7.2"
}
}npm run buildThis creates the dist/ folder with compiled JavaScript code.
Create a .env file in the project root:
TURSO_DATABASE_URL=libsql://your-database.turso.io
TURSO_AUTH_TOKEN=your-token-hereTo get the token:
turso auth tokenIn the root of your project (not mcp-turso), create .vscode/mcp.json:
{
"mcpServers": {
"turso": {
"command": "node",
"args": ["C:/full/path/mcp-turso/dist/index.js"],
"env": {
"TURSO_DATABASE_URL": "libsql://your-database.turso.io",
"TURSO_AUTH_TOKEN": "your-token-here"
}
}
}
}Important: Replace C:/full/path/ with the actual path where you created the mcp-turso project.
Close VSCode completely and reopen to load the MCP configuration.
Open Copilot Chat (Ctrl + Shift + I) and test commands:
List all tables in my times databaseShow the structure of the players tableCount how many players are confirmedInsert a new player: name "Carlos", whatsapp "11987654321"Add a phone column of type TEXT to the players tableCreate a unique index on user emailsAdd a foreign key between players and teams| Tool | Description | Example |
|---|---|---|
list_tables | Lists all tables | {} |
describe_table | Shows table structure | {"table": "players"} |
execute_select | Executes SELECT (read-only) | {"query": "SELECT * FROM players"} |
insert_data | Inserts data | {"table": "players", "data": {"name": "John"}} |
update_data | Updates data | {"table": "players", "data": {"status": "confirmed"}, "where": "id = 1"} |
delete_data | Deletes data | {"table": "players", "where": "id = 1"} |
count_rows | Counts records | {"table": "players", "where": "status = 'active'"} |
add_column | Adds column to table | {"table": "players", "column": "phone", "type": "TEXT"} |
execute_ddl | Executes DDL commands | {"sql": "ALTER TABLE players ADD COLUMN email TEXT"} |
create_index | Creates index | {"name": "idx_players_name", "table": "players", "column": "name"} |
add_constraint | Adds constraint | {"table": "players", "constraint_name": "fk_team", "constraint_type": "FOREIGN KEY", "columns": ["team_id"], "referenced_table": "teams", "referenced_columns": ["id"]} |
begin_transaction | Begins transaction | {} |
commit_transaction | Commits transaction | {} |
rollback_transaction | Rollbacks transaction | {} |
#### list_tables Description: Lists all database tables Parameters: None Return: List of table names
#### describe_table Description: Shows complete table structure Parameters:
{
"type": "object",
"properties": {
"table": {
"type": "string",
"description": "Name of the table to describe"
}
},
"required": ["table"]
}Return: Table schema with columns, types and constraints
#### execute_select Description: Executes a SELECT query (read-only) Parameters:
{
"type": "object",
"properties": {
"query": {
"type": "string",
"description": "Valid SQL SELECT query"
}
},
"required": ["query"]
}Validation: Query must start with "SELECT" (case insensitive) Return: Query result in JSON format
#### insert_data Description: Inserts a new record into the table Parameters:
{
"type": "object",
"properties": {
"table": {
"type": "string",
"description": "Table name"
},
"data": {
"type": "object",
"description": "Object with data to insert",
"additionalProperties": true
}
},
"required": ["table", "data"]
}Return: ID of the inserted record
#### update_data Description: Updates existing records Parameters:
{
"type": "object",
"properties": {
"table": {
"type": "string",
"description": "Table name"
},
"data": {
"type": "object",
"description": "Data to update",
"additionalProperties": true
},
"where": {
"type": "string",
"description": "WHERE condition to identify records"
}
},
"required": ["table", "data", "where"]
}Return: Number of affected records
#### delete_data Description: Removes records from the table Parameters:
{
"type": "object",
"properties": {
"table": {
"type": "string",
"description": "Table name"
},
"where": {
"type": "string",
"description": "WHERE condition to identify records"
}
},
"required": ["table", "where"]
}Return: Number of removed records
#### count_rows Description: Counts records in a table Parameters:
{
"type": "object",
"properties": {
"table": {
"type": "string",
"description": "Table name"
},
"where": {
"type": "string",
"description": "Optional WHERE condition"
}
},
"required": ["table"]
}Return: Total number of records
#### add_column Description: Adds a new column to an existing table Parameters:
{
"type": "object",
"properties": {
"table": {
"type": "string",
"description": "Table name"
},
"column": {
"type": "string",
"description": "Name of the new column"
},
"type": {
"type": "string",
"description": "Data type of the column (e.g., 'TEXT', 'INTEGER', 'REAL', 'BLOB')"
},
"nullable": {
"type": "boolean",
"description": "Whether the column can be NULL (default: true)",
"default": true
},
"default_value": {
"type": "string",
"description": "Default value for the column (optional)"
}
},
"required": ["table", "column", "type"]
}Return: Confirmation of column addition
#### execute_ddl Description: Executes safe DDL (Data Definition Language) commands Parameters:
{
"type": "object",
"properties": {
"sql": {
"type": "string",
"description": "Valid DDL SQL command (ALTER TABLE, CREATE INDEX, etc.)"
}
},
"required": ["sql"]
}Validation: Blocks DROP, TRUNCATE, DELETE commands. Allows only ALTER TABLE, CREATE INDEX, ADD CONSTRAINT Return: Confirmation of command execution
#### create_index Description: Creates an index on a specific column Parameters:
{
"type": "object",
"properties": {
"name": {
"type": "string",
"description": "Index name"
},
"table": {
"type": "string",
"description": "Table name"
},
"column": {
"type": "string",
"description": "Column name"
},
"unique": {
"type": "boolean",
"description": "Whether it should be a unique index",
"default": false
}
},
"required": ["name", "table", "column"]
}Return: Confirmation of index creation
#### add_constraint Description: Adds constraints (foreign key, check, unique) to tables Parameters:
{
"type": "object",
"properties": {
"table": {
"type": "string",
"description": "Table name"
},
"constraint_name": {
"type": "string",
"description": "Constraint name"
},
"constraint_type": {
"type": "string",
"description": "Type: 'FOREIGN KEY', 'CHECK', 'UNIQUE'",
"enum": ["FOREIGN KEY", "CHECK", "UNIQUE"]
},
"columns": {
"type": "array",
"items": {"type": "string"},
"description": "Columns involved"
},
"referenced_table": {
"type": "string",
"description": "Referenced table (for FK)"
},
"referenced_columns": {
"type": "array",
"items": {"type": "string"},
"description": "Referenced columns (for FK)"
},
"check_expression": {
"type": "string",
"description": "CHECK expression (for CHECK)"
}
},
"required": ["table", "constraint_name", "constraint_type", "columns"]
}Return: Confirmation of constraint addition
#### begin_transaction Description: Begins a new transaction Parameters: None Return: Confirmation of transaction start
#### commit_transaction Description: Commits all operations in the current transaction Parameters: None Return: Confirmation of commit
#### rollback_transaction Description: Cancels all operations in the current transaction Parameters: None Return: Confirmation of rollback
}, "column": { "type": "string", "description": "Nome da coluna" }, "unique": { "type": "boolean", "description": "Se deve ser índice único", "default": false } }, "required": ["name", "table", "column"] }
**Return**: Confirmação da criação do índice
#### `add_constraint`
**Descrição**: Adiciona constraints (foreign key, check, unique) a tabelas
**Parâmetros**:{ "type": "object", "properties": { "table": { "type": "string", "description": "Nome da tabela" }, "constraint_name": { "type": "string", "description": "Nome da constraint" }, "constraint_type": { "type": "string", "description": "Tipo: 'FOREIGN KEY', 'CHECK', 'UNIQUE'", "enum": ["FOREIGN KEY", "CHECK", "UNIQUE"] }, "columns": { "type": "array", "items": {"type": "string"}, "description": "Colunas envolvidas" }, "referenced_table": { "type": "string", "description": "Tabela referenciada (para FK)" }, "referenced_columns": { "type": "array", "items": {"type": "string"}, "description": "Colunas referenciadas (para FK)" }, "check_expression": { "type": "string", "description": "Expressão CHECK (para CHECK)" } }, "required": ["table", "constraint_name", "constraint_type", "columns"] }
**Return**: Confirmação da adição da constraint
#### `begin_transaction`
**Descrição**: Inicia uma nova transação
**Parâmetros**: Nenhum
**Return**: Confirmação do início da transação
#### `commit_transaction`
**Descrição**: Confirma todas as operações da transação atual
**Parâmetros**: Nenhum
**Return**: Confirmação do commit
#### `rollback_transaction`
**Descrição**: Cancela todas as operações da transação atual
**Parâmetros**: Nenhum
**Return**: Confirmação do rollback
## Development
For local development:
npm run dev # Runs with tsx (hot reload)
## Troubleshooting
### "command not found" error
- Use absolute path in `args` in `.vscode/mcp.json`
- Example: `C:/Users/Lucas Silva/projects/mcp-turso/dist/index.js`
### Permission error
- On first use, Copilot will ask for permission
- Click "Allow" or "Continue"
### Tools don't appear
- Make sure `npm run build` was executed
- Restart VSCode completely
- Confirm the path in `.vscode/mcp.json` is correct
- Check logs in Output → MCP
### Turso connection error
- Confirm `TURSO_DATABASE_URL` and `TURSO_AUTH_TOKEN` are correct
- Run `turso auth token` to generate a new token if needed
## Available Scripts
- `npm run build`: Compiles TypeScript
- `npm run dev`: Runs in development mode
- `npm start`: Runs compiled version
## Roadmap
### Upcoming Features
- [ ] SQL transactions support
- [ ] Complex queries with JOIN
- [ ] Database backup and restore
- [ ] Optional web interface for administration
- [ ] Support for multiple Turso databases
- [ ] Integration with other MCP tools
### Planned Improvements
- [ ] More rigorous schema validation
- [ ] Support for advanced data types
- [ ] Cache for frequent queries
- [ ] Structured logging
- [ ] Performance metrics
## Additional Resources
### MCP Documentation
- [Official MCP Specification](https://modelcontextprotocol.io/specification)
- [MCP Introduction](https://modelcontextprotocol.io/introduction)
- [MCP Server Examples](https://github.com/modelcontextprotocol/examples)
### Turso
- [Turso Documentation](https://docs.turso.tech/)
- [LibSQL SDK](https://github.com/tursodatabase/libsql)
## Contributing
1. Fork the project
2. Create a branch: `git checkout -b feature/name`
3. Commit your changes
4. Open a Pull Request
## License
MIT~30 seconds. Free. No account. Every finding cites a rule and a line of evidence.