Skip to main content
LambdaDB can be used from any Model Context Protocol (MCP) client through the LambdaDB MCP server. This makes data stored in LambdaDB available to AI assistants that need to inspect collections, list documents, fetch records, or run search queries against a project. For a guided first search with a coding agent, see Start with an AI agent. Use the CLI setup to connect supported coding agents, or follow the manual steps below for another MCP client, such as Claude Desktop. The MCP server works with one project per process and exposes 11 read tools, or 27 tools when writes are enabled, covering collections, documents, search, branches, tags, and aliases. Started without project variables, it also adds three connection tools. Organization listing, project creation and selection, and usage reports are CLI account commands, not MCP tools.

Before you start

Both connection methods require Node.js 22.14.0 or later, npm, and an MCP client. Account-based CLI setup also requires access to the OS credential store. For direct package setup, obtain:
  • A LambdaDB project API key
  • Your project’s base URL
  • Your project name
The MCP package is read-only by default. Guided CLI init defaults to enabling write tools in its generated connection; disable them under Change options if you want read-only access.

Connect with the CLI

Install the LambdaDB CLI, then run:
Choose account login to select or create a project and explicitly issue a key, or reuse an existing connection. Select the agents, review the scope and write-tool setting, and approve the file plan. Supported agents include Codex, Claude Code, Cursor, VS Code, Gemini CLI, OpenCode, GitHub Copilot CLI, Kiro, and the Cline VS Code extension; see agent setup for their scope restrictions and non-interactive examples. Claude Desktop uses the manual steps below. CLI 0.7.0 generates a launch command pinned to that CLI version, which runs MCP 0.8.0 through lambdadb mcp. The bridge reads the selected OS credential or environment variable and forwards the project’s base URL, name, and key to the MCP process. It adds no account-management tools and stores no key value in generated agent files. A saved OS credential needs the same OS user and access to the unlocked store; an environment-held key must be available to the agent process. Restart or reload the agent and verify the connection. After upgrading the CLI or changing its selected project, rerun init for the same agents and scope to update their pinned settings. Existing agent connections do not automatically follow projects use. The numbered steps below describe direct package setup, which supplies connection details through the MCP environment rather than the CLI bridge.

Step 1: Get your LambdaDB connection details

From LambdaDB Cloud, collect the following values for the project you want to expose to your MCP client:
  • Base URL
  • Project name
  • Project API key
Project creation does not automatically issue an API key. In the project’s API Keys tab, an organization Owner or Admin must select Create key and save the full value when it is shown. Use that saved value for the MCP configuration; it cannot be revealed again from the key list. See API key management.
Store your project API key securely. Do not commit it to source control or share it in screenshots, prompts, or logs.

Step 2: Choose the published package

The npm package is @functional-systems/lambdadb-mcp. This guide covers version 0.8.0; the commands below use the latest stable release. No source checkout or build is required.
With the required environment variables supplied, an MCP client can launch:
This is a stdio server: when launched in a terminal it waits for MCP protocol input, rather than showing an interactive prompt. It has no CLI --help or --version mode; use npm metadata to check the package version. Protocol messages use stdout and diagnostics use stderr. Alternatively, install globally with npm install --global @functional-systems/lambdadb-mcp@latest and configure your client to run lambdadb-mcp with no arguments. Installed copies do not update themselves; run the same install command to update or npm uninstall --global @functional-systems/lambdadb-mcp to remove it. The client configuration below pins version 0.8.0 for reproducible launches. Review releases and update the version explicitly.

Transport limit

The documented MCP server release has a 10 MiB stdio receive-buffer limit (10,485,760 bytes). Exceeding it closes the connection. Split large tool inputs into smaller calls; bulk tools accept document arrays, not local paths or URLs. This transport limit does not increase LambdaDB’s API request limits.

Environment variables

The three project variables are required together: setting any one of them selects this explicit configuration, and a missing one fails startup. With none of the three set, the server starts disconnected and adds lambdadb_connect, lambdadb_connection_status, and lambdadb_cancel_connection. lambdadb_connect returns a verification link and code; after you sign in and approve one project in the browser, the server saves a project key in the OS credential store and reuses it on later starts. Until a project is connected, the data tools return not_connected. The connection tools are not added when the project variables are set, and a service that does not offer this flow returns connect_not_offered; use the project variables in that case. See Connect without a key for the optional variables and credential-store requirements. When launched directly, the installed package reads the process environment. It does not read the general CLI’s config file or automatically load .env or .env.local; the CLI bridge resolves CLI credentials and supplies this environment for you. LAMBDADB_ENV_FILE is only for the source repository’s development launchers. Set secrets through your client’s protected local configuration or environment forwarding; do not put the key in command arguments.

Step 3: Add the server to your MCP client

For Claude Desktop, open Settings → Developer → Edit Config and merge this entry into claude_desktop_config.json, preserving existing servers. This uses the official local-server configuration format.
Replace each placeholder locally. This file contains a credential once filled in: keep it private and out of source control. Do not assume a desktop application inherits variables exported in a terminal. Fully quit and restart Claude Desktop. Other MCP clients can use the same command, arguments, and environment values, but their configuration schema can differ.

Step 4: Verify the connection

Open your client’s server/tool list (in Claude Desktop, Manage connectors → lambdadb). A read-only connection configured with the project variables should advertise these 11 tools:
  • lambdadb_list_collections
  • lambdadb_get_collection
  • lambdadb_query_collection
  • lambdadb_list_docs
  • lambdadb_fetch_docs
  • lambdadb_list_branches
  • lambdadb_list_tags
  • lambdadb_list_aliases
  • lambdadb_get_branch
  • lambdadb_get_tag
  • lambdadb_get_alias
A server started without the project variables lists the three connection tools as well. Tool discovery confirms the local MCP connection; it does not authenticate to LambdaDB. To check project access:
  1. Call lambdadb_list_collections with { "size": 1 } to confirm the project connection.
  2. Call lambdadb_get_collection for a known collection. Its indexConfigs include each field’s description when one is set, which helps an assistant choose fields.
  3. Run lambdadb_query_collection with a small query against that collection.
Query, fetch, and list tools accept an optional ref such as { "kind": "tag", "name": "release" }; omitting it reads from main. Use lambdadb_list_branches, lambdadb_list_tags, and lambdadb_list_aliases to discover refs when main is not the intended target. Each returns one page in name order: pass size (1–100; the server default is 10) and, while the response carries nextPageToken, pass it back as pageToken to read the next page. Each branch owns its index schema and a tag pins one, so before searching a ref other than main, read its indexConfigs with lambdadb_get_branch, lambdadb_get_tag, or lambdadb_get_alias. A tag that is still waiting for its first snapshot has snapshotId, snapshotCommittedAt, and dataUpdatedAt set to null and numDocs: 0 until a build publishes its captured writes. Query, fetch, and list accept consistentRead: true with a branch ref, including the default main branch, or an alias that currently targets a branch; a tag ref or an alias that targets a tag rejects it. Reads of a tag, or of an alias that targets a tag, already include the writes the tag captured. See Data versioning. Query, fetch, and list follow the service result and ID limits. List also accepts optional filter, fields, includeVectors, partitionFilter, and sort: one to four objects, each mapping one field to "asc" or "desc", as in the list API; an empty sort is rejected before any request. Keep size small while exploring and use fields to leave out large stored fields. For example, these lambdadb_list_docs arguments list main by category, including its pending writes:
To read the next page, add the returned nextPageToken as pageToken and repeat every other argument unchanged. With a substring filter, a page can hold fewer than size documents, or none, while nextPageToken is present; keep calling lambdadb_list_docs until it is absent. A page token is bound to size, sort, consistentRead, filter, fields, partitionFilter, includeVectors, and ref, and a changed argument returns HTTP 400. For example, pass these arguments to lambdadb_query_collection for the sample collection created in the CLI guide:
The MCP server also accepts keyword facets, an omitted query for match-all, and size: 0 with nonempty facets for counts only.

Native reranking

The MCP server accepts optional rerank on lambdadb_query_collection. For the sample collection above, pass:
LambdaDB manages the provider credentials. Omitting rerank or passing null keeps existing search behavior. Applied results preserve the final score, envelope retrievalScore, server order, and top-level rerank metadata, including docsUrl downloads. Check rerank.status before interpreting scores; fallback uses original search scores and exposes no partial reranking scores. See Native reranking for custom criteria, candidate depth, and failure/query restrictions. Reranking is available through the read tool and does not require enabling write tools. The MCP server accepts the Bayesian request through lambdadb_query_collection. Add collectionName for a collection with the example’s body and bodyEmbedding fields. Without reranking, pass top-level candidateSize; with reranking, omit it and use rerank.candidateSize. The read tool preserves result scores and rerank metadata, including downloaded results.

Optional: Enable write tools

The LambdaDB MCP server can also expose write operations: The MCP server accepts all 49 fixed text analyzer presets when creating collections. The create and update tools accept an embedding block in indexConfigs for native embeddings; schema updates follow the index schema update rules. Their indexConfigs schemas also accept an optional description on every field, including nested objectIndexConfigs children; on update, omitting it or passing null keeps the stored description and "" clears it. A text field takes substringIndex: true for substring filters only in lambdadb_create_collection, and reads return it so that an update built from them keeps it. lambdadb_query_collection, lambdadb_list_docs, and lambdadb_delete_docs accept substring clauses in queries and filters. Every tool takes collectionName. The other inputs are: A typical versioning workflow creates a branch from main, writes and evaluates on it, pins a tag once the intended data is committed, and then retargets the serving alias:
To discard later writes to candidate and restore it from the tag, pass these arguments to lambdadb_rollback_branch after the user confirms:
Document writes without branch go to main. asOf is an integer Unix epoch millisecond cutoff. Branch and tag sources can be a branch or a tag, never an alias; a tag source does not accept asOf, and alias targets cannot be aliases. main cannot be deleted, and a branch or tag still referenced by an alias cannot be deleted until the alias is retargeted or removed. Without asOf, a new branch or tag takes its source’s committed snapshot, if one exists, together with the writes still pending on the source; with asOf, it takes only the latest retained committed snapshot at or before the cutoff. Captured pending writes appear in ordinary reads of a new branch after a build commits them, and pending bulk imports after indexing, so verify the data before relying on a new ref; see what a branch and a tag capture. Bulk inputs must fit the transport limit; the tool does not accept local paths or URLs. For direct package setup, enable them by changing the environment value and restarting the MCP server:
For CLI-generated connections, use the write-tool setting in init and restart the agent; lambdadb mcp uses its --write-tools flag rather than an inherited environment setting.
Enable write tools only in environments where document creation, updates, and deletion are intended. Start with a non-production project when testing write access from an MCP client.
Successful writes are accepted before committed search visibility is verified. Confirm expected documents with subsequent reads; tool success alone is not an indexing readiness check.

Troubleshooting

If the server starts but tools fail:
  • Verify that base URL, project name, and project API key all belong to the same LambdaDB project.
  • Confirm that the project API key is still valid.
  • Check the MCP client logs for startup or tool-call errors.
  • Run the server locally first to make sure the process starts with the expected environment variables.
If tools are missing:
  • Confirm that the client launches the pinned npm package or the intended installed executable.
  • Restart the MCP client after editing its configuration.
  • If you expect write tools, make sure LAMBDADB_MCP_ENABLE_WRITE_TOOLS=true is set.
If the server cannot start:
  • Check that the Node executable visible to the client is version 22.14.0 or newer, and that npx is on its PATH. For ENOENT, use the absolute path returned by command -v npx on macOS/Linux or where npx on Windows, and ensure Node is also reachable.
  • A missing-variable error means only some of the three project variables were supplied to the child process; set all three, or none to use the connection tools. Editing a checkout’s .env.local does not configure an npm-launched server.
  • Use true or false for write opt-in; an invalid boolean fails startup.
  • Check npm/network errors if the pinned package cannot be downloaded. Check JSON syntax and restart the server after configuration changes.
  • On macOS, Claude Desktop logs are under ~/Library/Logs/Claude; on Windows, %APPDATA%\Claude\logs. Inspect mcp.log and mcp-server-lambdadb.log locally, without sharing credentials or document data.

Optional: Build from source

For development, use a release tag and Node.js 22.14.0 or later:
Fill in .env.local locally, then run npm run start:env. The source launcher selects LAMBDADB_ENV_FILE when set, otherwise .env.local if present, otherwise .env. Exported values take precedence. Direct node dist/index.js does not load these files. See the repository README for development and Inspector usage.

Next steps