Docs/MCP Server

MCP Server

Enable AI coding agents like Claude Code and Cursor to interact with your Lubes projects.

Overview

The Lubes MCP Server implements the Model Context Protocol, allowing AI agents to directly interact with your database, functions, storage, and deployments.

What can AI agents do?

  • • Query and modify your database
  • • Browse table schemas and data
  • • Deploy and manage functions
  • • Upload and manage files in storage
  • • View logs and deployment status
  • • Manage environment variables
  • • View Git repository info, branches, and commits
  • • Manage SSH keys for Git access

Installation

Install the MCP server globally or use it directly with npx:

npm (global install)
npm install -g @lubes/mcp-server
npx (no install required)
npx @lubes/mcp-server

Claude Desktop Setup

Add the following to your Claude Desktop configuration file:

macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
{
  "mcpServers": {
    "lubes": {
      "command": "npx",
      "args": ["@lubes/mcp-server"],
      "env": {
        "LUBES_API_KEY": "your-api-key",
        "LUBES_ORG": "your-org-slug",
        "LUBES_PROJECT": "your-project-slug"
      }
    }
  }
}
Windows: %APPDATA%\Claude\claude_desktop_config.json
{
  "mcpServers": {
    "lubes": {
      "command": "npx",
      "args": ["@lubes/mcp-server"],
      "env": {
        "LUBES_API_KEY": "your-api-key",
        "LUBES_ORG": "your-org-slug",
        "LUBES_PROJECT": "your-project-slug"
      }
    }
  }
}

After updating the config, restart Claude Desktop. You can get your API key from the API Keys section of your dashboard.

Claude Code Setup

For Claude Code (CLI), add the server to your project's .mcp.json file:

.mcp.json
{
  "mcpServers": {
    "lubes": {
      "command": "npx",
      "args": ["@lubes/mcp-server"],
      "env": {
        "LUBES_API_KEY": "your-api-key",
        "LUBES_ORG": "your-org-slug",
        "LUBES_PROJECT": "your-project-slug"
      }
    }
  }
}

Cursor Setup

For Cursor IDE, add the MCP server in Settings → MCP Servers:

{
  "mcpServers": {
    "lubes": {
      "command": "npx",
      "args": ["@lubes/mcp-server"],
      "env": {
        "LUBES_API_KEY": "your-api-key",
        "LUBES_ORG": "your-org-slug",
        "LUBES_PROJECT": "your-project-slug"
      }
    }
  }
}

Configuration

Environment Variables

VariableRequiredDescription
LUBES_API_KEYYesYour Lubes API key
LUBES_ORGYesOrganization slug
LUBES_PROJECTYesProject slug
LUBES_API_URLNoCustom API URL (default: https://api.lubes.dev)
LUBES_READ_ONLYNoEnable read-only mode (no mutations)

Available Tools

The MCP server exposes the following tools to AI agents:

Database Tools

  • db_list_tables - List all tables in the database
  • db_get_table_schema - Get schema for a specific table
  • db_query - Execute a SQL query
  • db_table_rows - Browse table data with pagination
  • db_table_count - Get row count for a table
  • db_branch_list - List database branches
  • db_branch_create - Create a new branch

Function Tools

  • fn_list - List deployed functions
  • fn_get - Get function details
  • fn_invoke - Invoke a function
  • fn_logs - View function logs

Storage Tools

  • storage_list_buckets - List storage buckets
  • storage_list_files - List files in a bucket
  • storage_upload - Upload a file
  • storage_download - Download a file
  • storage_delete - Delete a file

Deployment Tools

  • deploy_list - List deployments
  • deploy_status - Get deployment status
  • deploy_logs - View deployment logs

Environment Variable Tools

  • env_list - List environment variables
  • env_get - Get a variable value
  • env_set - Set a variable
  • env_delete - Delete a variable

Git Repository Tools

  • repository_info - Get Git repository info and clone URLs
  • repository_branches - List Git branches
  • repository_commits - List recent commits on a branch

SSH Key Tools

  • ssh_keys_list - List SSH keys for Git access
  • ssh_key_add - Add a new SSH key
  • ssh_key_delete - Delete an SSH key

Example Usage

Once configured, you can ask Claude to interact with your Lubes project:

Example prompts:

  • "Show me all the tables in my database"
  • "Query the users table and show me the first 10 rows"
  • "Create a new table called 'posts' with id, title, content, and created_at columns"
  • "What functions are deployed in my project?"
  • "Upload this image to the avatars bucket"
  • "Show me the recent deployment logs"
  • "What's the Git clone URL for this project?"
  • "Show me the recent commits on the main branch"
  • "List my SSH keys"

Next Steps