Files
langflow/docs
Jordan Frazier 65c4e0fcc8 fix(security): bind agentic MCP tools to the authenticated user; close route footguns
Agentic MCP cross-tenant read/write (Issue 14): the langflow-agentic stdio MCP
server's flow/component tools took user_id as a caller-supplied (often optional,
defaulting to None) parameter, so an authenticated tenant could read or write
ANY tenant's flow data/component values by id -- reachable by embedding
`python -m langflow.agentic.mcp` in a flow's MCP stdio config, independent of the
agentic_experience flag. Bind the acting user from the authenticated request
instead of trusting the caller:
- agentic/mcp/server.py: drop user_id from all 9 flow/component tools; add
  _bound_user_id() reading LANGFLOW_AGENTIC_USER_ID and failing closed when absent.
- lfx.base.mcp.security: add AGENTIC_USER_ID_ENV_VAR / AGENTIC_MCP_MODULE; add
  langflow_agentic_user_id to DANGEROUS_ENV_VARS so a tenant stdio config cannot
  supply it.
- lfx.base.mcp.util.update_tools: new current_user_id; after validation, inject
  the authenticated id into the spawn env when the command targets the agentic
  module (auto-provisioned server AND any tenant-authored config -> tenant only
  ever binds their own id). Callers pass it (MCPTools component, v2 mcp servers).

Route footguns (round-4 review):
- api/v1/projects.py update_project: validate the supplied parent_id references a
  folder owned by the caller (404 otherwise) instead of assigning it blind.
- helpers/flow.py get_flow_by_id_or_endpoint_name: document the user_id=None
  unscoped contract and the requirement that callers pass an authenticated id.

Docs: add a "Session cookie hardening" section for LANGFLOW_ACCESS_SECURE /
ACCESS_HTTPONLY / ACCESS_SAME_SITE with the JS-frontend and HTTP caveats.

Tests: MCP stdio denylist + update_tools inject/fail-closed; agentic server
_bound_user_id env/fail-closed; update_project unowned-parent rejection.
2026-06-16 13:16:31 -04:00
..
2025-02-06 17:44:46 +00:00
2023-07-18 15:08:00 -03:00

Website

This website is built using Docusaurus 3, a modern static website generator.

Installation

$ npm install

Local Development

$ npm run start

This command starts a local development server and opens up a browser window. Most changes are reflected live without having to restart the server.

Build

$ npm run build

This command generates static content into the build directory and can be served using any static contents hosting service, including npm run serve.

Import code snippets from the repo

To embed source files directly in the docs, use raw-loader to import the file as a string and pass it to the native CodeBlock component.

import CodeBlock from "@theme/CodeBlock";
import customComponent from "!!raw-loader!@langflow/src/lfx/src/lfx/custom/custom_component/custom_component.py";

<CodeBlock language="python" title="CustomComponent metadata (from codebase)">
  {customComponent}
</CodeBlock>

Docusaurus Versioning

The versioning configuration is found in docusaurus.config.js.

Versioning example for release version 1.9.x on top of 1.8.x:

  1. Before release, the docs in the active release branch should already be set to 1.8.x, the current version.
  2. When ready to release 1.9.x, create a branch and run npm run docs:version -- 1.9.0 to snapshot the current docs.
  3. After creating a new version, update docusaurus.config.js to include the 1.9.0 release:
docs: {
  lastVersion: '1.9.0',
  versions: {
    '1.9.0': {
      label: '1.9.x',
      path: '1.9.0',
    },
    '1.8.0': {
      label: '1.8.x',
      path: '1.8.0',
    },
  },
},
  1. Test the deployment locally:
npm run build
npm run serve
  1. Create a pull request to main, and merge to create your new release.
  2. To create version 2.0.x, repeat the process: update the active release branch docs to 2.0.x when you begin working on it, then when ready to release, run npm run docs:version -- 2.0.0, update docusaurus.config.js with labels using .x notation, and merge to main.
  • lastVersion = the most recent released version (shown as "latest" in the UI).

See the Docusaurus docs for more info.

Disable versioning

  1. Remove the versions configuration from docusaurus.config.js.
  2. Delete the docs/versioned_docs/ and docs/versioned_sidebars/ directories.
  3. Delete docs/versions.json.

References

Deployment

Using SSH:

$ USE_SSH=true npm run deploy

Not using SSH:

$ GIT_USER=<Your GitHub username> npm run deploy

If you are using GitHub pages for hosting, this command is a convenient way to build the website and push to the gh-pages branch.