Skip to content

[MCP Bundle] Add framework session store backed by SessionHandlerInterface#1838

Merged
chr-hertel merged 1 commit intosymfony:mainfrom
simonchrz:feat/mcp-framework-session-store
Apr 11, 2026
Merged

[MCP Bundle] Add framework session store backed by SessionHandlerInterface#1838
chr-hertel merged 1 commit intosymfony:mainfrom
simonchrz:feat/mcp-framework-session-store

Conversation

@simonchrz
Copy link
Copy Markdown
Contributor

@simonchrz simonchrz commented Mar 31, 2026

Q A
Bug fix? no
New feature? yes
Docs? no
License MIT

Summary

Add a framework session store option that wraps Symfony's SessionHandlerInterface for MCP session persistence.

Extracted from #1791 as requested by @chr-hertel.

FrameworkSessionStore

  • Wraps SessionHandlerInterface with a JSON envelope containing data and expiration timestamp
  • Application-level TTL with lazy expiry on read (expired sessions destroyed when accessed)
  • Does not call SessionHandlerInterface::gc() to avoid affecting framework HTTP sessions
  • Configurable prefix (default: mcp-) and TTL (default: 3600s)

Configuration

mcp:
    http:
        session:
            store: framework
            prefix: mcp-
            ttl: 3600

Tests

  • FrameworkSessionStoreTest: 11 tests covering read/write round-trip, TTL expiry, invalid envelope handling, destroy delegation, gc no-op, custom prefix, exists checks
  • McpBundleTest::testSessionStoreFrameworkConfiguration: verifies DI wiring with session.handler reference

Tested in

Tested in a real Symfony application with the framework session store — works as expected.

@carsonbot carsonbot added Feature New feature MCP Bundle Issues & PRs about the MCP SDK integration bundle Status: Needs Review labels Mar 31, 2026
@simonchrz simonchrz force-pushed the feat/mcp-framework-session-store branch 2 times, most recently from 9717ead to ccd11be Compare March 31, 2026 07:45
@chr-hertel
Copy link
Copy Markdown
Member

Hi! Version 0.7 has been released. This PR has changelog/upgrade entries under the 0.7 heading, which is now a released version.

Please update the following files to place your entries under the next version 0.8:

  • src/mcp-bundle/CHANGELOG.md

For CHANGELOG.md files: change the version heading from 0.7 to 0.8
For UPGRADE.md: place entries under UPGRADE FROM 0.7 to 0.8

Thank you!


🤖 This comment was generated automatically by an agent.

@chr-hertel chr-hertel force-pushed the feat/mcp-framework-session-store branch 2 times, most recently from 89d48e6 to 2342b52 Compare April 11, 2026 19:46
@chr-hertel chr-hertel force-pushed the feat/mcp-framework-session-store branch from 2342b52 to 98b7ad5 Compare April 11, 2026 20:01
@chr-hertel
Copy link
Copy Markdown
Member

Thank you @simonchrz.

@chr-hertel chr-hertel merged commit 7f0a02b into symfony:main Apr 11, 2026
408 of 409 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Feature New feature MCP Bundle Issues & PRs about the MCP SDK integration bundle Status: Reviewed

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants