Skip to content

docs: add needs_session_stickiness field, session stickiness behavior, and per-call vs sticky connection docs - #5974

Merged
Pratham-Mishra04 merged 1 commit into
devfrom
08-08-docs_document_needs_session_stickiness_across_web_ui_api_and_config.json
Aug 8, 2026
Merged

docs: add needs_session_stickiness field, session stickiness behavior, and per-call vs sticky connection docs#5974
Pratham-Mishra04 merged 1 commit into
devfrom
08-08-docs_document_needs_session_stickiness_across_web_ui_api_and_config.json

Conversation

@Pratham-Mishra04

Copy link
Copy Markdown
Collaborator

Summary

Documents the new needs_session_stickiness field for HTTP MCP client configurations, which controls whether Bifrost holds a single persistent upstream connection or opens a fresh connection per tool call.

Changes

  • Added needs_session_stickiness to the schema reference table with a full description of its behavior, constraints, and relationship to auth types and connection types.
  • Added a new Session Stickiness (HTTP only) section to the connecting-to-servers page, including a behavior comparison table and Web UI, API, and config.json usage examples.
  • Added per-call default behavior callouts to the headers and oauth auth pages, linking to the new session stickiness section.
  • Added needs_session_stickiness to both MCPClientCreateRequestBase and MCPClientUpdateRequest in the OpenAPI schema with full field descriptions.

The field is only meaningful for server-level auth types (oauth, headers, none) on HTTP connections. SSE and STDIO connections are always sticky by nature, and setting needs_session_stickiness: false on either is rejected. Per-user auth types are always per-call regardless of this field.

Type of change

  • Bug fix
  • Feature
  • Refactor
  • Documentation
  • Chore/CI

Affected areas

  • Core (Go)
  • Transports (HTTP)
  • Providers/Integrations
  • Plugins
  • UI (React)
  • Docs

How to test

Review the rendered documentation for:

  • The needs_session_stickiness row in the schema reference table at docs/deployment-guides/config-json/schema-reference.mdx
  • The new Session Stickiness section in docs/mcp/connecting-to-servers.mdx, including the behavior table and all three tabs (Web UI, API, config.json)
  • The per-call default callouts at the bottom of the headers and oauth auth pages

Verify that the OpenAPI schema descriptions for needs_session_stickiness are accurate in both the create and update request objects.

Breaking changes

  • Yes
  • No

Related issues

Security considerations

None. This field controls connection lifecycle behavior only and does not affect credential handling or secret exposure.

Checklist

  • I read docs/contributing/README.md and followed the guidelines
  • I added/updated tests where appropriate
  • I updated documentation where needed
  • I verified builds succeed (Go and UI)
  • I verified the CI pipeline passes locally if applicable

@CLAassistant

Copy link
Copy Markdown

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.

This was referenced Aug 8, 2026

Pratham-Mishra04 commented Aug 8, 2026

Copy link
Copy Markdown
Collaborator Author

This stack of pull requests is managed by Graphite. Learn more about stacking.

@coderabbitai

coderabbitai Bot commented Aug 8, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

📝 Walkthrough

Summary by CodeRabbit

  • Documentation
    • Documented HTTP session stickiness for MCP connections, including per-call defaults, persistent connections, health-checked reconnects, credential failures, and protocol limitations.
    • Added setup guidance for configuring session stickiness through the Web UI, API, and config.json.
    • Clarified authentication-specific behavior for header-authenticated and OAuth connections.
  • Configuration
    • Added the needs_session_stickiness option to MCP client creation and update schemas, defaulting to disabled and applying only to supported authentication modes.

Walkthrough

The MCP documentation now defines needs_session_stickiness for creation and update requests. It describes default per-call HTTP connections, persistent connections, authentication constraints, protocol restrictions, reconnect behavior, and configuration methods.

Changes

MCP session stickiness

Layer / File(s) Summary
Configuration contract
docs/openapi/schemas/management/mcp.yaml, docs/deployment-guides/config-json/schema-reference.mdx
Adds needs_session_stickiness to MCP creation and update schemas. Documents defaults, authentication restrictions, connection behavior, and SSE/STDIO requirements.
Connection behavior documentation
docs/mcp/connecting-to-servers.mdx, docs/mcp/auth/headers.mdx, docs/mcp/auth/oauth.mdx
Describes per-call defaults, persistent HTTP connections, credential resolution, reconnect handling, and Web UI, API, and config.json configuration.

Estimated code review effort: 2 (Simple) | ~10 minutes

Possibly related PRs

Suggested reviewers: akshaydeo, danpiths, bearts

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Description check ✅ Passed The description covers the purpose, changes, affected areas, validation steps, breaking changes, security, and documentation checklist items.
Title check ✅ Passed The title clearly and concisely summarizes the documentation changes for the field and session stickiness behavior.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch 08-08-docs_document_needs_session_stickiness_across_web_ui_api_and_config.json

Comment @coderabbitai help to get the list of available commands.

Pratham-Mishra04 commented Aug 8, 2026

Copy link
Copy Markdown
Collaborator Author

Merge activity

  • Aug 8, 10:33 AM UTC: A user started a stack merge that includes this pull request via Graphite.
  • Aug 8, 11:49 AM UTC: Graphite rebased this pull request as part of a merge.
  • Aug 8, 11:51 AM UTC: @Pratham-Mishra04 merged this pull request with Graphite.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 3

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@docs/mcp/auth/headers.mdx`:
- Line 103: Scope the per-call default wording to HTTP clients in
docs/mcp/auth/headers.mdx lines 103-103 by prefixing it with “For HTTP header
clients” while retaining the Session Stickiness link; apply the equivalent “For
HTTP OAuth clients” prefix in docs/mcp/auth/oauth.mdx lines 167-167, also
retaining that link.

In `@docs/mcp/connecting-to-servers.mdx`:
- Line 76: Update the sticky connection row to make recovery client-specific:
direct OAuth clients to use admin reauthorize, instruct headers clients to
update their stored headers, and avoid prescribing a recovery action for none
clients. Verify the guidance matches the documented client behavior and config
schema.

In `@docs/openapi/schemas/management/mcp.yaml`:
- Around line 197-207: The create schema currently permits
needs_session_stickiness: false for non-HTTP connection types, despite server
validation rejecting it. Update the schema constraint around
needs_session_stickiness to require connection_type: http when the field is
explicitly false, while preserving default: false only on the HTTP create
subtype so SSE and STDIO schemas do not generate that value.
🪄 Autofix

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: 4ed79cbd-e1b8-40b5-bb24-af143f864b9c

📥 Commits

Reviewing files that changed from the base of the PR and between 6d002c3 and 71bc16e.

📒 Files selected for processing (5)
  • docs/deployment-guides/config-json/schema-reference.mdx
  • docs/mcp/auth/headers.mdx
  • docs/mcp/auth/oauth.mdx
  • docs/mcp/connecting-to-servers.mdx
  • docs/openapi/schemas/management/mcp.yaml

Comment thread docs/mcp/auth/headers.mdx
</Tab>
</Tabs>

By default this connection is per-call (a fresh connection per tool call, no shared upstream connection to keep alive) — see [Session Stickiness](../connecting-to-servers#session-stickiness-http-only) to make it sticky instead.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🎯 Functional Correctness | 🟠 Major | ⚡ Quick win

Scope the per-call default to HTTP.

Both pages also support SSE, which remains sticky regardless of this setting.

  • docs/mcp/auth/headers.mdx#L103-L103: Prefix the statement with “For HTTP header clients” and retain the Session Stickiness link.
  • docs/mcp/auth/oauth.mdx#L167-L167: Prefix the statement with “For HTTP OAuth clients” and retain the Session Stickiness link.

As per path instructions, “Check docs for parity with code, config.schema.json, and provider behavior.”

📍 Affects 2 files
  • docs/mcp/auth/headers.mdx#L103-L103 (this comment)
  • docs/mcp/auth/oauth.mdx#L167-L167
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@docs/mcp/auth/headers.mdx` at line 103, Scope the per-call default wording to
HTTP clients in docs/mcp/auth/headers.mdx lines 103-103 by prefixing it with
“For HTTP header clients” while retaining the Session Stickiness link; apply the
equivalent “For HTTP OAuth clients” prefix in docs/mcp/auth/oauth.mdx lines
167-167, also retaining that link.

Source: Path instructions


| Value | Behavior |
| --- | --- |
| `true` | **Sticky.** One shared connection is opened once and reused for every tool call, with an automatic health-checked reconnect on failure. Lower per-call latency; if the connection's credential dies, the client needs an admin `reauthorize` to recover. |

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🎯 Functional Correctness | 🟠 Major | ⚡ Quick win

Make the sticky recovery action auth-specific.

This row applies to headers and none clients, but reauthorize only applies to shared OAuth clients. For headers, instruct users to update the stored headers. Do not prescribe reauthorize for none.

As per path instructions, “Check docs for parity with code, config.schema.json, and provider behavior.”

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@docs/mcp/connecting-to-servers.mdx` at line 76, Update the sticky connection
row to make recovery client-specific: direct OAuth clients to use admin
reauthorize, instruct headers clients to update their stored headers, and avoid
prescribing a recovery action for none clients. Verify the guidance matches the
documented client behavior and config schema.

Source: Path instructions

Comment on lines +197 to +207
needs_session_stickiness:
type: boolean
default: false
description: |
HTTP-only. Only meaningful for auth_type "oauth", "headers", or "none"
(a server-level connection) — per-user auth types are always per-call
regardless of this field. When true, Bifrost holds one persistent
upstream connection, reused for every tool call. When false or
omitted (the default), a fresh connection is dialed per tool call.
Cannot be set to false for connection_type "sse" or "stdio" — both
are always sticky.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🗄️ Data Integrity & Integration | 🟠 Major | ⚡ Quick win

Enforce the HTTP-only restriction in the create schema.

MCPClientCreateRequestSSE and MCPClientCreateRequestSTDIO inherit this field and currently accept needs_session_stickiness: false. The server rejects that value unless connection_type is http.

Add an if/then constraint that requires connection_type: http when this field is explicitly false. Keep the default: false annotation on the HTTP create subtype so generated SSE and STDIO forms do not prefill a rejected value.

As per path instructions, “Check docs for parity with code, config.schema.json, and provider behavior.”

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@docs/openapi/schemas/management/mcp.yaml` around lines 197 - 207, The create
schema currently permits needs_session_stickiness: false for non-HTTP connection
types, despite server validation rejecting it. Update the schema constraint
around needs_session_stickiness to require connection_type: http when the field
is explicitly false, while preserving default: false only on the HTTP create
subtype so SSE and STDIO schemas do not generate that value.

Source: Path instructions

@Pratham-Mishra04
Pratham-Mishra04 changed the base branch from 08-08-fix_correct_per-user_mcp_state-projection_and_reauthorize_completion_bugs to graphite-base/5974 August 8, 2026 11:45
@Pratham-Mishra04
Pratham-Mishra04 changed the base branch from graphite-base/5974 to dev August 8, 2026 11:47
@Pratham-Mishra04
Pratham-Mishra04 requested a review from a team as a code owner August 8, 2026 11:47
@Pratham-Mishra04
Pratham-Mishra04 force-pushed the 08-08-docs_document_needs_session_stickiness_across_web_ui_api_and_config.json branch from 71bc16e to 33214a2 Compare August 8, 2026 11:48
@Pratham-Mishra04
Pratham-Mishra04 merged commit 52d906b into dev Aug 8, 2026
14 checks passed
@Pratham-Mishra04
Pratham-Mishra04 deleted the 08-08-docs_document_needs_session_stickiness_across_web_ui_api_and_config.json branch August 8, 2026 11:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants