ClickCease

Leni developers

Leni MCP runtime reference

Connect an MCP-compatible AI host to the Leni intelligent runtime with delegated end-user OAuth, tenant-safe data access, memory context, and bounded tools.

SettingCurrent contract
Server nameleni-runtime
Remote endpointhttps://mcp.leni.co/mcp
OAuth issuerhttps://auth.leni.co
TransportStreamable HTTP over HTTPS
AuthenticationOAuth 2.0 authorization code with PKCE; delegated Leni user consent is always required
Client registrationDynamic Client Registration and published client metadata are supported

OAuth discovery and lifecycle

ResourceURL or current maximum
Authorization-server metadatahttps://auth.leni.co/.well-known/oauth-authorization-server
Protected-resource metadatahttps://mcp.leni.co/.well-known/oauth-protected-resource
Access token10 minutes
Refresh token30 days
Authorization code2 minutes
Interactive authorization transaction10 minutes

Compatible hosts should discover endpoints from metadata, use S256 PKCE, request the required scopes, and refresh short-lived access tokens without asking the user to sign in again. Reconnect is required after the grant is revoked, the refresh token expires, or new permissions are added. Lifetimes are current production maxima and may be shortened; clients must use the expiry returned with the token.

Backend and autonomous agents

MCP is the delegated end-user surface: every connected person signs in and consents with a Leni account. For a non-interactive server-to-server integration, use the HTTP API with a Leni project key. Do not automate a user password or copy a project key into an MCP client.

OAuth scopes

ScopeAllows
leni:account:readRead account, plan eligibility, and percentage usage remaining.
leni:analysis:runStart a Leni analysis that can consume account usage.
leni:analysis:readRead status and completed analysis sessions.
leni:data:readDiscover and query authorized Leni semantic-layer data.
leni:memory:readList authorized memory and folders and consult relevant context.
leni:memory:files:readCreate short-lived links for files attached to authorized memory notes.
leni:memory:writeCreate and update memory after explicit user intent.
leni:memory:deleteDelete an authorized memory note after explicit user intent.

Advertised tools

Tool names and descriptions are sent to the AI host during MCP discovery. The host—not Leni—decides whether to call a tool for a prompt. Ask explicitly to “Use Leni” when deterministic connector use matters.

ToolClassPurpose
leni_get_accountAccountPlan eligibility and percentage usage remaining; no dollar balance.
leni_get_portfolio_occupancyDataCurrent authorized occupancy with optional unit counts and property breakdown.
leni_list_data_modelsDataDiscover models available through the Leni semantic layer.
leni_describe_data_modelDataList exact measures and dimensions before a structured query.
leni_query_portfolio_dataDataRun a bounded read-only semantic query; arbitrary SQL is not accepted.
leni_consult_memory_contextContextRetrieve relevant user and organization context for the question.
leni_analyze_real_estate_financeAnalysisRun real-estate, finance, market, operating, or organizational synthesis.
leni_get_analysis_statusAnalysisRead the state of a previously started analysis.
leni_get_analysis_sessionAnalysisRead the authorized completed session and result.
leni_list_memoryMemorySearch authorized personal or organization memory.
leni_list_memory_foldersMemoryList authorized folders and their note references.
leni_get_memory_filesMemory filesCreate five-minute links for files on one authorized note.
leni_create_memoryMemory writeCreate personal or organization memory when the user asks.
leni_update_memoryMemory writeUpdate an authorized memory note when the user asks.
leni_delete_memoryMemory deleteDelete an authorized memory note only on explicit user intent.

Structured-data boundaries

  • Call model discovery before constructing a query; use only the returned member names.
  • Queries require 1–12 measures and allow up to 12 dimensions, 20 filters, 2 time dimensions, and 5 order fields.
  • Row limit defaults to 50 and is capped at 100.
  • Clients cannot submit SQL or select a warehouse, schema, organization, or unauthorized property.
  • Server-owned organization and property filters are applied to every direct query.
MCP inputBounds
Structured-query filtersequals, notEquals, contains, notContains, startsWith, endsWith, gt, gte, lt, lte, inDateRange, notInDateRange, beforeDate, afterDate, set, and notSet
Analysis question3–8,000 characters
Analysis property selectionUp to 100 authorized building IDs
Analysis memory selectionUp to 20 authorized memory IDs
Analysis depthquick or deep
Memory consultation scopecombined, user, or organization
Memory-file page sizeDefaults to 20 and is capped at 25
Tool response textCapped at 100,000 characters

MCP rate limits

LimitIdentityCurrent allowance
Runtime requestsSigned-in OAuth subject + client120 requests per 60 seconds
Structured semantic queriesSigned-in principal + client20 requests per 60 seconds
Memory context consultationLeni account across connected clients12 requests per 60 seconds

Limits overlap and the most restrictive applicable limit wins. A 429 response includes Retry-After. Invalid or unauthenticated traffic is separately throttled and is not part of the authenticated service allowance.

Read and write behavior

Portfolio and semantic-layer tools are read-only. Analysis can consume the same plan usage and funded API-credit spillover as Leni. Memory create, update, and delete are deliberate write tools protected by separate scopes and should be called only after explicit user intent. Leni never moves money or modifies property-management records through MCP.

MCP troubleshooting

SymptomAction
Connector will not registerUse OAuth discovery and supported DCR or client-metadata behavior; preserve the host-provided redirect URI exactly.
OAuth expiredLet the host refresh the access token. Reconnect only when refresh fails, the grant was revoked, or scopes changed.
Tool is not selectedEnable Leni in the conversation and ask explicitly to use Leni for the task.
Data member is rejectedList and describe models again, then use exact current member names.
Analysis is processingKeep analysisId for status checks and sessionId for completed-session retrieval. Do not start a duplicate.
Memory file is unavailableRecheck the note scope, request a fresh link, and retry a page when partial is true.