Build
MCP
Connect an AI client to LimiLake over the Model Context Protocol to query your data and call your own Functions as tools.
LimiLake runs a Model Context Protocol (MCP) server. Connect an MCP client, such as a desktop chat app or a coding agent, and it can list your Lakehouses, read tables with SQL and call the Functions you publish for it. The client acts as you, with exactly your access.
The server address is:
https://app.limilake.com/mcpWhat you getLink to this section
| Tool | What it does |
|---|---|
list_lakehouses | Lists every Lakehouse you can query, with its tables and their row counts, sizes and last write time |
describe_table | Describes one table: column types, null share, value ranges and, for columns with few values, the exact values |
query_sql | Runs read-only SQL across one or more Lakehouses. Returns 100 rows by default and at most 10,000 |
ask_limilake | Answers a question asked in plain language, and returns the SQL it ran and the tables it read. Listed only when Ask LimiLake is turned on for your Tenant |
| Your Functions | Each Function published with mcp=True that you can reach appears as its own tool. See Expose a Function as a tool |
query_sql refuses INSERT, UPDATE and DELETE. To let a client change data, publish a Function that does the write and expose it as a tool.
Connect a clientLink to this section
You can sign in through OAuth or use a personal access token.
Sign in with your LimiLake loginLink to this section
Add https://app.limilake.com/mcp to your client as a remote MCP server (some clients call it a connector). The client finds the LimiLake sign-in by itself: it registers, opens a LimiLake page in your browser, and you sign in and approve. The client then holds a token and renews it on its own. There is nothing to copy.
LimiLake supports the authorization code flow with PKCE, the device flow for clients without a browser, and dynamic client registration. A client that supports MCP's standard OAuth sign-in needs nothing else.
In the web app, the setup checklist on the home page shows the same address and marks the step done once a client has connected.
Use a personal access tokenLink to this section
If your client cannot do the OAuth sign-in, create a personal access token with the CLI. It is printed once:
limilake auth token create claude-desktop --days 90A token is valid for 90 days by default and for at most 365. It belongs to the Tenant you are signed in to. Give it to the client as a bearer token in the Authorization header. Many clients take a JSON configuration of this shape; the exact keys depend on the client:
{
"mcpServers": {
"limilake": {
"url": "https://app.limilake.com/mcp",
"headers": {
"Authorization": "Bearer ll_pat_..."
}
}
}
}The server speaks streamable HTTP and holds no session state. This page gives no steps for a particular client: check your client's documentation for where a remote server and its headers go.
List and revoke your tokens with the CLI:
limilake auth token list
limilake auth token revoke <token-id>A PAT is a full credential for your account. Keep it in your client's secret store, never in a file you commit.
What a client can reachLink to this section
A connected client reaches exactly the Workspaces you are a member of, at your Access Level in each, and nothing more. There are no extra scopes to choose: an OAuth sign-in and a PAT both carry your own access.
- A
viewerMembership is enough to list Lakehouses, describe tables, runquery_sql, useask_limilakeand call a Function's tool. - Your Tenant Role adds nothing. A
tenant_adminwith no Membership in a Workspace sees nothing in it. - Every tool call is checked live on the server. The tool list your client shows is a convenience, not the boundary: a call to a Function you can no longer reach is refused.
Expose a Function as a toolLink to this section
Add mcp=True to a Function and push it to main. This example gives a client a typed lookup tool:
import limilake
from pydantic import BaseModel, Field
fn = limilake.function(
id="123e4567-e89b-42d3-a456-426614174004", # keep the id the CLI generated
name="invoice-lookup",
description="Look up the open invoices of one customer by customer number.",
mcp=True,
)
class InvoiceQuery(BaseModel):
customer_number: str = Field(pattern=r"^[0-9]{1,10}$")
limit: int = Field(default=20, ge=1, le=200)
@fn.post("/invoices")
def open_invoices(query: InvoiceQuery) -> dict[str, object]:
rows = limilake.lake.query(
"select invoice_number, amount, due_date from silver.invoices "
f"where customer_number = '{query.customer_number}' and status = 'open' "
"order by due_date",
limit=query.limit,
)
return {"invoices": rows}The pattern on customer_number allows only digits, so the value is safe to place in the SQL.
The rules for an mcp=True Function:
- Access. It must use
access="private", the default. Any other access makes the push fail withfunction_declaration_invalid. It may run as the caller (the default) or as an assigned identity. - HTTP routes. Every HTTP route must be a POST with exactly one parameter: a Pydantic model or a
dict[str, T]. A GET, PUT, PATCH or DELETE route, or a POST with no parameter, several parameters, or a scalar or list parameter, makes the push fail withfunction_mcp_method_unsupported. The SDK refuses such a route as soon as the module is imported. - Actions and syncs. A Function with
@fn.actionor@fn.syncandmcp=Truealso becomes one tool. Its arguments are the run input object, which the client fills in without a field list, so prefer a POST route with a model when you want the client to see named, typed arguments. mcp=is a literalTrueorFalsein the call.
What the tool looks like to the client:
- Name. The Function's
name=, in lowercase with every run of other characters replaced by_:invoice-lookupbecomesinvoice_lookup. A Function with several POST routes gives one tool per route, named<name>_<route>, for exampleinvoice_lookup_invoices. If two Functions you can reach produce the same name, or a name equals a built-in tool, LimiLake adds a suffix that tells them apart. - Description. Your
description=, followed by the route (Route: POST /invoices.). Write it for the model: say what the tool does and when to use it. - Arguments. The fields of the body model, with their types, defaults and constraints. A client never chooses the path or the method.
To check that it is published, list your Functions and look for mcp among its surfaces:
git push origin HEAD:main
limilake function listThe tool reaches a connected client within about a minute of the push. A client that does not refresh its tool list on its own may need you to reconnect or reload it.
Calling a Function toolLink to this section
A call runs the Function with your own access, like any private Function call. A route call waits up to 120 seconds, or the Function's timeout= when that is shorter. An action or sync call waits up to 180 seconds. A client that supports MCP tasks gets a task after 15 seconds instead and fetches the result when the run ends. When a wait runs out, the client gets an error, and the run may still finish on the server.
When access changes or a token expiresLink to this section
- Your Membership changes. Calls are checked live, so a removed Membership blocks the next call. The tool list catches up within about a minute.
- A Function is published, removed or changes access. The tool list follows within about a minute.
- An OAuth token expires. The server answers
401withinvalid_token, and the client renews the token by itself. When renewal fails, for example because the 30-day sign-in has expired or you changed your password, the client asks you to sign in again. - A PAT expires or is revoked. Every request answers
401. Create a new token and update the client.
TroubleshootingLink to this section
| What you see | What it means |
|---|---|
401 on every request | No Authorization header, or the token is expired, revoked or not valid. Sign in again or create a new PAT |
| Your Function is not in the tool list | It lacks mcp=True, is not on main yet, uses an access other than private, or is in a Workspace you are not a member of. Wait a minute after the push, then reconnect |
ask_limilake is missing | Ask LimiLake is not turned on for your Tenant |
CATALOG_UNAVAILABLE from a Function tool | LimiLake could not read your Function list for a moment. Try again |
INVALID_PARAMS naming a tool | The client is holding a tool name that no longer exists. Reload the tool list |
... exceeded the 120s invoke limit | The Function took longer than the call can wait. It may still finish; make it faster or move the work to a run |
A tool call result says 403 or 404 | You can no longer reach that Workspace, Lakehouse or Function |
Next stepsLink to this section
- Functions: write and publish the Functions you expose as tools.
- Lakehouses and SQL: Lakehouses, schemas and SQL.
- Agents: run an agent from your own code inside LimiLake.