Skip to main content

An MCP server to interact with a Tinybird Workspace from any MCP client.

Project description

Tinybird MCP server

An MCP server to interact with a Tinybird Workspace from any MCP client.

Features

  • Query Tinybird Data Sources using the Tinybird Query API
  • Get the result of existing Tinybird API Endpoints with HTTP requests
  • Push Datafiles

Usage examples

Setup

Prerequisites

MCP is still very new and evolving, we recommend following the MCP documentation to get the MCP basics up and running.

You'll need:

Configuration

1. Configure Claude Desktop

Create the following file depending on your OS

On MacOS: ~/Library/Application Support/Claude/claude_desktop_config.json

On Windows: %APPDATA%/Claude/claude_desktop_config.json

Paste this template in the file and replace <TINYBIRD_API_URL> and <TINYBIRD_ADMIN_TOKEN> with your Tinybird API URL and Admin Token:

{
    "mcpServers": {
        "mcp-tinybird": {
            "command": "uvx",
            "args": [
                "mcp-tinybird"
            ],
            "env": {
                "TB_API_URL": "<TINYBIRD_API_URL>",
                "TB_ADMIN_TOKEN": "<TINYBIRD_ADMIN_TOKEN>"
            }
        }
    }
}

2. Restart Claude Desktop

Prompts

The server provides a single prompt:

  • tinybird-default: Assumes you have loaded some data in Tinybird and want help exploring it.
    • Requires a "topic" argument which defines the topic of the data you want to explore, for example, "Bluesky data" or "retail sales".

You can configure additional prompt workflows:

  • Create a prompts Data Source in your workspace with this schema and append your prompts. The MCP loads prompts on initialization so you can configure it to your needs:
SCHEMA >
    `name` String `json:$.name`,
    `description` String `json:$.description`,
    `timestamp` DateTime `json:$.timestamp`,
    `arguments` Array(String) `json:$.arguments[:]`,
    `prompt` String `json:$.prompt`

Tools

The server implements several tools to interact with the Tinybird Workspace:

  • list-data-sources: Lists all Data Sources in the Tinybird Workspace
  • list-pipes: Lists all Pipe Endpoints in the Tinybird Workspace
  • get-data-source: Gets the information of a Data Source given its name, including the schema.
  • get-pipe: Gets the information of a Pipe Endpoint given its name, including its nodes and SQL transformation to understand what insights it provides.
  • request-pipe-data: Requests data from a Pipe Endpoints via an HTTP request. Pipe endpoints can have parameters to filter the analytical data.
  • run-select-query: Allows to run a select query over a Data Source to extract insights.
  • append-insight: Adds a new business insight to the memo resource
  • llms-tinybird-docs: Contains the whole Tinybird product documentation, so you can use it to get context about what Tinybird is, what it does, API reference and more.
  • save-event: This allows to send an event to a Tinybird Data Source. Use it to save a user generated prompt to the prompts Data Source. The MCP server feeds from the prompts Data Source on initialization so the user can instruct the LLM the workflow to follow.
  • analyze-pipe: Uses the Tinybird analyze API to run a ClickHouse explain on the Pipe Endpoint query and check if indexes, sorting key, and partition key are being used and propose optimizations suggestions
  • push-datafile: Creates a remote Data Source or Pipe in the Tinybird Workspace from a local datafile. Use the Filesystem MCP to save files generated by this MCP server.

Development

Config

If you are working locally add two environment variables to a .env file in the root of the repository:

TB_API_URL=
TB_ADMIN_TOKEN=
{
  "mcpServers": {
    "mcp-tinybird_local": {
      "command": "uv",
      "args": [
        "--directory",
        "/Users/alrocar/gr/mcp-tinybird",
        "run",
        "mcp-tinybird"
      ]
    }
  }
}

Building and Publishing

To prepare the package for distribution:

  1. Sync dependencies and update lockfile:
uv sync
  1. Build package distributions:
uv build

This will create source and wheel distributions in the dist/ directory.

  1. Publish to PyPI:
uv publish

Note: You'll need to set PyPI credentials via environment variables or command flags:

  • Token: --token or UV_PUBLISH_TOKEN
  • Or username/password: --username/UV_PUBLISH_USERNAME and --password/UV_PUBLISH_PASSWORD

Debugging

Since MCP servers run over stdio, debugging can be challenging. For the best debugging experience, we strongly recommend using the MCP Inspector.

You can launch the MCP Inspector via npm with this command:

npx @modelcontextprotocol/inspector uv --directory /Users/alrocar/gr/mcp-tinybird run mcp-tinybird

Upon launching, the Inspector will display a URL that you can access in your browser to begin debugging.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

mcp_tinybird-0.1.5.tar.gz (231.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

mcp_tinybird-0.1.5-py3-none-any.whl (17.1 kB view details)

Uploaded Python 3

File details

Details for the file mcp_tinybird-0.1.5.tar.gz.

File metadata

  • Download URL: mcp_tinybird-0.1.5.tar.gz
  • Upload date:
  • Size: 231.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.5.4

File hashes

Hashes for mcp_tinybird-0.1.5.tar.gz
Algorithm Hash digest
SHA256 93f9832355ccafa101e9be0d855cfdb60b466a1a5d53852a883de9710817ab99
MD5 260d39ce23853e1b2493772b5a79f61b
BLAKE2b-256 af61eb73d18d4581cf635251799ddf413a21c6ebeead55ab3efd1a9b8243473c

See more details on using hashes here.

File details

Details for the file mcp_tinybird-0.1.5-py3-none-any.whl.

File metadata

File hashes

Hashes for mcp_tinybird-0.1.5-py3-none-any.whl
Algorithm Hash digest
SHA256 66d978cca2600f995279d83aac4551a3e768b89423480b908c7e5ca94643faed
MD5 c42e5f1de9945ae6888bcd3912ceeb22
BLAKE2b-256 ce9a84a3f4a51ebf71c00c8a89697b7d13c84f73f5830ea33638cbbb0d788f6b

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page