Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
128 commits
Select commit Hold shift + click to select a range
5a0b9bb
encrypt oauth auth settings at rest
jordanrfrazier Aug 22, 2025
8e89ef4
[autofix.ci] apply automated fixes
autofix-ci[bot] Aug 22, 2025
f66f222
Fix rebase changes and add env to env server config
jordanrfrazier Aug 22, 2025
c385207
Correctly unmask secretstr before encryption
jordanrfrazier Aug 22, 2025
9da2f0f
update mcp-composer args
jordanrfrazier Aug 22, 2025
ca1426d
Merge branch 'main' into mcp-composer-oauth
jordanrfrazier Aug 22, 2025
75af111
[autofix.ci] apply automated fixes
autofix-ci[bot] Aug 22, 2025
2cb3637
ruff
jordanrfrazier Aug 22, 2025
cb6d331
ruff
jordanrfrazier Aug 22, 2025
175278f
ruff
jordanrfrazier Aug 22, 2025
17adeba
[autofix.ci] apply automated fixes
autofix-ci[bot] Aug 22, 2025
2eed48e
ruff
jordanrfrazier Aug 22, 2025
074ef60
Merge branch 'main' into mcp-composer-oauth
jordanrfrazier Aug 22, 2025
7cbed82
catch invalidtoken error
jordanrfrazier Aug 22, 2025
54b15ba
ruff
jordanrfrazier Aug 22, 2025
942dfb6
[autofix.ci] apply automated fixes
autofix-ci[bot] Aug 22, 2025
c5d71d9
ruff
jordanrfrazier Aug 22, 2025
ecee186
[autofix.ci] apply automated fixes
autofix-ci[bot] Aug 22, 2025
16eec45
ruff
jordanrfrazier Aug 22, 2025
4d0b3a3
Merge branch 'main' into mcp-composer-oauth
jordanrfrazier Aug 22, 2025
05f7e6e
ruff
jordanrfrazier Aug 22, 2025
bc6b9b7
[autofix.ci] apply automated fixes
autofix-ci[bot] Aug 22, 2025
73c9646
ruff
jordanrfrazier Aug 22, 2025
6b22074
[autofix.ci] apply automated fixes
autofix-ci[bot] Aug 22, 2025
449d2e9
fix test
jordanrfrazier Aug 22, 2025
8bab72e
Add initial mcp composer service and startup
jordanrfrazier Aug 22, 2025
fce37eb
remove token url
jordanrfrazier Aug 23, 2025
12e657f
Register server on project creation
jordanrfrazier Aug 23, 2025
8cbf9ab
WARN: fall back to superuser on no auth params, to allow mcp-composer…
jordanrfrazier Aug 23, 2025
9b6d3ba
update sse url args
jordanrfrazier Aug 24, 2025
37fa686
[autofix.ci] apply automated fixes
autofix-ci[bot] Aug 24, 2025
6a69ed3
[autofix.ci] apply automated fixes (attempt 2/3)
autofix-ci[bot] Aug 24, 2025
e81d5b2
Add langflow api keys to the server configs
jordanrfrazier Aug 24, 2025
dfd1490
[autofix.ci] apply automated fixes
autofix-ci[bot] Aug 24, 2025
413dcac
[autofix.ci] apply automated fixes (attempt 2/3)
autofix-ci[bot] Aug 24, 2025
aed9432
add port searching
jordanrfrazier Aug 24, 2025
916f6d8
[autofix.ci] apply automated fixes
autofix-ci[bot] Aug 24, 2025
d3442a0
Fix for dead servers - use devnull on subprocess to avoid pipe from f…
jordanrfrazier Aug 26, 2025
7f92118
Merge branch 'main' into mcp-composer-integration-v2
jordanrfrazier Aug 26, 2025
aa047f5
uvlock
jordanrfrazier Aug 26, 2025
eae98eb
[autofix.ci] apply automated fixes
autofix-ci[bot] Aug 26, 2025
8dab342
Update composer startup behavior re: auth settings
jordanrfrazier Aug 26, 2025
209206a
[autofix.ci] apply automated fixes
autofix-ci[bot] Aug 26, 2025
984bf2d
fix some auth logic, add dynamic fetch of new url
jordanrfrazier Aug 26, 2025
2dd5db7
Clean up sse-url parameters
jordanrfrazier Aug 26, 2025
52756af
[autofix.ci] apply automated fixes
autofix-ci[bot] Aug 26, 2025
dc8ea76
Only call composer url when composer is enabled
jordanrfrazier Aug 26, 2025
23b33a9
[autofix.ci] apply automated fixes
autofix-ci[bot] Aug 26, 2025
4ed04a9
improve shutdown
jordanrfrazier Aug 26, 2025
18da3b9
starter projects update
jordanrfrazier Aug 26, 2025
107fb68
[autofix.ci] apply automated fixes
autofix-ci[bot] Aug 26, 2025
603b317
update logging
jordanrfrazier Aug 26, 2025
de85fba
revert hack to auth mcp composer
jordanrfrazier Aug 26, 2025
ef8d0c4
[autofix.ci] apply automated fixes
autofix-ci[bot] Aug 26, 2025
29310b0
Fix 500 on composer-url query
jordanrfrazier Aug 26, 2025
e12b5e5
[autofix.ci] apply automated fixes
autofix-ci[bot] Aug 26, 2025
467dca5
Update feature flag; update api key addition to aut-install
jordanrfrazier Aug 26, 2025
8b34825
[autofix.ci] apply automated fixes
autofix-ci[bot] Aug 26, 2025
a72a830
Fix composer url and re-add auth
jordanrfrazier Aug 26, 2025
5bb3859
Merge branch 'main' into mcp-composer-integration-v2
edwinjosechittilappilly Aug 26, 2025
8e645ce
Changed needs_api_key logic
lucaseduoli Aug 26, 2025
273d966
Refactor use-get-composer-url
lucaseduoli Aug 26, 2025
f2b7eba
remove python fallback for now, then pipe stderr to pipe
jordanrfrazier Aug 26, 2025
24cfb4f
[autofix.ci] apply automated fixes
autofix-ci[bot] Aug 26, 2025
db35641
[autofix.ci] apply automated fixes (attempt 2/3)
autofix-ci[bot] Aug 26, 2025
1f36fd9
Changed api key logic to allow connection if not api key and auto log…
lucaseduoli Aug 26, 2025
4b41dbf
fix oauth addition to cmd
jordanrfrazier Aug 26, 2025
3d47a42
restart server when auth values change
jordanrfrazier Aug 26, 2025
2a4cb6a
Restart server on oauth values changes
jordanrfrazier Aug 26, 2025
90de8e6
[autofix.ci] apply automated fixes
autofix-ci[bot] Aug 26, 2025
ea0ce44
Changed project port to be the same as OAuth port
lucaseduoli Aug 27, 2025
80a6b5c
Changed endpoint to provide port_available
lucaseduoli Aug 27, 2025
60c41b7
add is_port_available prop
lucaseduoli Aug 27, 2025
bb2eb65
Added port_available to request
lucaseduoli Aug 27, 2025
a6b331c
Edit mutation to not have linting errors
lucaseduoli Aug 27, 2025
1915b6e
Added port not available state to authentication
lucaseduoli Aug 27, 2025
db5b457
[autofix.ci] apply automated fixes
autofix-ci[bot] Aug 27, 2025
3476b6b
Added port and host to get composer url
lucaseduoli Aug 27, 2025
1b4befa
Invalidate project composer url queries
lucaseduoli Aug 27, 2025
852ef65
Changed to display port and host that is not running
lucaseduoli Aug 27, 2025
c7382d8
Cleanup old port finding and some mypy fixes
jordanrfrazier Aug 29, 2025
83d7f8c
Add print, remove unused env var
jordanrfrazier Aug 29, 2025
c6faea2
Use mcp-composer directly in client and a lot of fixes
jordanrfrazier Sep 2, 2025
38d0207
Merge remote-tracking branch 'origin/release-1.6.0' into mcp-composer…
lucaseduoli Sep 2, 2025
51b8e7d
changed starter projects
lucaseduoli Sep 2, 2025
a6863fa
refactor mcp_projects to use always IP generated for WSL
lucaseduoli Sep 2, 2025
3617273
changed to check args -4 too on installed servers
lucaseduoli Sep 2, 2025
f399db2
changed to just check if sse url is in args
lucaseduoli Sep 2, 2025
c84643d
added member servers in gitignore
lucaseduoli Sep 2, 2025
48ecacf
add check for ff
mfortman11 Sep 2, 2025
4f24e40
Handle secret request response cycle securely and add better logging
jordanrfrazier Sep 2, 2025
7d4792b
Use asycn logger
jordanrfrazier Sep 2, 2025
ec30703
Add decorator to check if composer is enabled in settings
jordanrfrazier Sep 2, 2025
5623174
Merge branch 'release-1.6.0' into mcp-composer-integration-v2
jordanrfrazier Sep 2, 2025
72ed74a
more logging changes
jordanrfrazier Sep 2, 2025
888657f
Much better handling of existing oauth servers when the flag is disab…
jordanrfrazier Sep 2, 2025
45d33ad
Reset oauth projects to apikey or none when composer flag is disabled
jordanrfrazier Sep 2, 2025
87b1b76
fix url for api key auth
mfortman11 Sep 2, 2025
45bea1d
Merge branch 'mcp-composer-integration-v2' of github.com:langflow-ai/…
mfortman11 Sep 2, 2025
2a15e52
Fix auth check; set project auth to api key when auto login disabled
jordanrfrazier Sep 3, 2025
9108173
Ruff, comments, cleanup
jordanrfrazier Sep 3, 2025
c71402a
[autofix.ci] apply automated fixes
autofix-ci[bot] Sep 3, 2025
4bea6ac
[autofix.ci] apply automated fixes (attempt 2/3)
autofix-ci[bot] Sep 3, 2025
3f93f39
Consolidate the auth handling since its used in two endpoints
jordanrfrazier Sep 3, 2025
e5bd82f
[autofix.ci] apply automated fixes
autofix-ci[bot] Sep 3, 2025
5e127c1
Ruff
jordanrfrazier Sep 3, 2025
366faa6
[autofix.ci] apply automated fixes
autofix-ci[bot] Sep 3, 2025
00ae2eb
last ruff
jordanrfrazier Sep 3, 2025
e479abc
Merge branch 'release-1.6.0' into mcp-composer-integration-v2
jordanrfrazier Sep 3, 2025
f967b6e
Update FE env var naming and dont unnecessarily decrypt auth settings…
jordanrfrazier Sep 4, 2025
c3be68b
update feature flag usage - remove mcp composer
jordanrfrazier Sep 4, 2025
c25be9a
[autofix.ci] apply automated fixes
autofix-ci[bot] Sep 4, 2025
a1005d8
Update timeout methods to have more reliable startup
jordanrfrazier Sep 4, 2025
2d98252
more feature flag changes
jordanrfrazier Sep 4, 2025
820a4ef
Attempt to extract helpful user messages
jordanrfrazier Sep 4, 2025
b422ad2
[autofix.ci] apply automated fixes
autofix-ci[bot] Sep 4, 2025
c41e75e
Added loading on mcp server tab auth
lucaseduoli Sep 4, 2025
bafc093
Changed to load on start too
lucaseduoli Sep 4, 2025
0ca3e05
cleanup mcp composer on project deletion
jordanrfrazier Sep 4, 2025
f512474
[autofix.ci] apply automated fixes
autofix-ci[bot] Sep 4, 2025
275bdae
remove nested retry mech
jordanrfrazier Sep 4, 2025
dbce703
Ruff
jordanrfrazier Sep 4, 2025
cd16d65
Merge branch 'release-1.6.0' into mcp-composer-integration-v2
jordanrfrazier Sep 4, 2025
0d9786d
lint
jordanrfrazier Sep 4, 2025
8693ebd
Fix unit tests
jordanrfrazier Sep 4, 2025
877d321
[autofix.ci] apply automated fixes
autofix-ci[bot] Sep 4, 2025
d4c9cbe
ruff
jordanrfrazier Sep 4, 2025
7cc43bc
[autofix.ci] apply automated fixes
autofix-ci[bot] Sep 4, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ LANGFLOW_STORE_ENVIRONMENT_VARIABLES=
# Should enable the MCP composer feature in MCP projects
# Values: true, false
# Default: false
LANGFLOW_FEATURE_MCP_COMPOSER=
LANGFLOW_MCP_COMPOSER_ENABLED=

# STORE_URL
# Example: LANGFLOW_STORE_URL=https://api.langflow.store
Expand Down
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -277,4 +277,6 @@ src/frontend/temp

.dspy_cache/
*.db
*.mcp.json
*.mcp.json

member_servers.json
75 changes: 75 additions & 0 deletions src/backend/base/langflow/api/v1/auth_helpers.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
from typing import Any

from pydantic import SecretStr

from langflow.services.auth.mcp_encryption import decrypt_auth_settings, encrypt_auth_settings
from langflow.services.database.models.folder.model import Folder


def handle_auth_settings_update(
existing_project: Folder,
new_auth_settings: dict | Any | None,
) -> dict[str, bool]:
"""Handle auth settings update including encryption/decryption and MCP Composer logic.

Args:
existing_project: The project being updated (modified in-place)
new_auth_settings: New auth settings (could be dict, Pydantic model, or None)

Returns:
Dict containing:
- should_start_composer: bool
- should_stop_composer: bool
"""
# Get current auth type before update
current_auth_type = None
decrypted_current = None
if existing_project.auth_settings:
current_auth_type = existing_project.auth_settings.get("auth_type")
# Only decrypt if we need access to sensitive fields (for preserving masked values)
if current_auth_type in ["oauth", "apikey"]:
decrypted_current = decrypt_auth_settings(existing_project.auth_settings)

if new_auth_settings is None:
# Explicitly set to None - clear auth settings
existing_project.auth_settings = None
# If we were using OAuth, stop the composer
return {"should_start_composer": False, "should_stop_composer": current_auth_type == "oauth"}

# Handle different input types (dict vs Pydantic model)
if isinstance(new_auth_settings, dict):
auth_dict = new_auth_settings.copy()
else:
# Pydantic model - use python mode to get raw values without SecretStr masking
auth_dict = new_auth_settings.model_dump(mode="python", exclude_none=True)

# Handle SecretStr fields
secret_fields = ["api_key", "oauth_client_secret"]
for field in secret_fields:
field_val = getattr(new_auth_settings, field, None)
if isinstance(field_val, SecretStr):
auth_dict[field] = field_val.get_secret_value()

new_auth_type = auth_dict.get("auth_type")

# Handle masked secret fields from frontend
# If frontend sends back "*******" for a secret field, preserve the existing value
if decrypted_current:
secret_fields = ["oauth_client_secret", "api_key"]
for field in secret_fields:
if field in auth_dict and auth_dict[field] == "*******" and field in decrypted_current:
auth_dict[field] = decrypted_current[field]

# Encrypt and store the auth settings
existing_project.auth_settings = encrypt_auth_settings(auth_dict)

# Determine MCP Composer actions
should_start_composer = new_auth_type == "oauth"
should_stop_composer = current_auth_type == "oauth" and new_auth_type != "oauth"
should_handle_composer = current_auth_type == "oauth" or new_auth_type == "oauth"

return {
"should_start_composer": should_start_composer,
"should_stop_composer": should_stop_composer,
"should_handle_composer": should_handle_composer,
}
Loading
Loading