Tinybird Mcp 伺服器
概覽
什麼是 MCP-Tinybird?
MCP-Tinybird 是一個開源項目,托管在 GitHub 上,屬於 Tinybirdco 組織。它是一個強大的工具,幫助開發者高效地構建和管理數據管道。該代碼庫旨在促進 Tinybird 功能與各種應用程序的集成,使用戶能夠利用實時數據處理和分析。
MCP-Tinybird 的特點
- 實時數據處理:MCP-Tinybird 使用户能夠實時處理和分析數據,非常適合需要即時洞察的應用程序。
- 用戶友好的界面:該項目提供了一個簡單的界面,簡化了數據管道的管理,使各種技能水平的開發者都能輕鬆使用。
- 開源:作為一個開源項目,MCP-Tinybird 鼓勵社區貢獻和合作,讓開發者能夠增強其功能和特性。
- 集成能力:該代碼庫支持與各種數據源和服務的集成,提供了數據攝取和處理的靈活性。
- 文檔和支持:提供全面的文檔,以幫助用戶入門並解決可能遇到的問題。
如何使用 MCP-Tinybird
-
克隆代碼庫:首先,使用以下命令從 GitHub 克隆 MCP-Tinybird 代碼庫到本地機器:
git clone https://github.com/tinybirdco/mcp-tinybird.git
-
安裝依賴:導航到項目目錄並安裝必要的依賴。這通常可以使用 npm 或 yarn 等包管理器完成:
cd mcp-tinybird npm install
-
配置您的環境:根據代碼庫中提供的文檔設置您的環境變量和配置文件。
-
運行應用程序:啟動應用程序以開始處理數據。這通常可以使用以下命令完成:
npm start
-
探索和自定義:利用 MCP-Tinybird 的功能來構建您的數據管道。您可以根據具體需求自定義應用程序並將其與其他服務集成。
常見問題解答
Q1: MCP-Tinybird 是免費使用的嗎?
A1: 是的,MCP-Tinybird 是一個開源項目,這意味著根據 Apache-2.0 許可證的條款,它是免費使用和修改的。
Q2: 我可以為 MCP-Tinybird 項目做貢獻嗎?
A2: 當然可以!歡迎貢獻。您可以分叉代碼庫,進行更改,並提交拉取請求以供審核。
Q3: 我可以在哪裡找到 MCP-Tinybird 的文檔?
A3: 文檔通常在代碼庫本身中提供,通常在 README.md
文件或專門的 docs
文件夾中。
Q4: MCP-Tinybird 支持哪些技術?
A4: MCP-Tinybird 設計用於與各種數據源一起工作,並可以與多種技術集成,增強其在不同用例中的多功能性。
Q5: 我該如何報告問題或錯誤?
A5: 您可以通過導航到 MCP-Tinybird GitHub 代碼庫中的“問題”選項卡,提交一個新問題,並詳細說明問題來報告問題。
詳細
Tinybird MCP server
An MCP server to interact with a Tinybird Workspace from any MCP client.
<a href="https://glama.ai/mcp/servers/53l5ojnx30"><img width="380" height="200" src="https://glama.ai/mcp/servers/53l5ojnx30/badge" alt="Tinybird server MCP server" /></a>
Features
- Query Tinybird Data Sources using the Tinybird Query API
- Get the result of existing Tinybird API Endpoints with HTTP requests
- Push Datafiles
It supports both SSE and STDIO modes.
Usage examples
Setup
Installation
Using MCP package managers
Smithery
To install Tinybird MCP for Claude Desktop automatically via Smithery:
npx @smithery/cli install @tinybirdco/mcp-tinybird --client claude
mcp-get
You can install the Tinybird MCP server using mcp-get:
npx @michaellatman/mcp-get@latest install mcp-tinybird
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",
"stdio"
],
"env": {
"TB_API_URL": "<TINYBIRD_API_URL>",
"TB_ADMIN_TOKEN": "<TINYBIRD_ADMIN_TOKEN>"
}
}
}
}
2. Restart Claude Desktop
SSE mode
Alternatively, you can run the MCP server in SSE mode by running the following command:
uvx mcp-tinybird sse
This mode is useful to integrate with an MCP client that supports SSE (like a web app).
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 Workspacelist-pipes
: Lists all Pipe Endpoints in the Tinybird Workspaceget-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 resourcellms-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 suggestionspush-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=
For local development, update your Claude Desktop configuration:
{
"mcpServers": {
"mcp-tinybird_local": {
"command": "uv",
"args": [
"--directory",
"/path/to/your/mcp-tinybird",
"run",
"mcp-tinybird",
"stdio"
]
}
}
}
<details>
<summary>Published Servers Configuration</summary>
"mcpServers": {
"mcp-tinybird": {
"command": "uvx",
"args": [
"mcp-tinybird"
]
}
}
</details>
Building and Publishing
To prepare the package for distribution:
- Sync dependencies and update lockfile:
uv sync
- Build package distributions:
uv build
This will create source and wheel distributions in the dist/
directory.
- Publish to PyPI:
uv publish
Note: You'll need to set PyPI credentials via environment variables or command flags:
- Token:
--token
orUV_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.
Monitoring
To monitor the MCP server, you can use any compatible Prometheus client such as Grafana. Learn how to monitor your MCP server here.
伺服器配置
{
"mcpServers": {
"mcp-tinybird": {
"command": "docker",
"args": [
"run",
"-i",
"--rm",
"ghcr.io/metorial/mcp-container--tinybirdco--mcp-tinybird--mcp-tinybird",
"mcp-tinybird stdio"
],
"env": {
"TB_API_URL": "tb-api-url",
"TB_ADMIN_TOKEN": "tb-admin-token"
}
}
}
}