Skip to content

feat: add session continuity for full context forwarding#40

Open
marcusquinn wants to merge 3 commits intosteipete:mainfrom
marcusquinn:feature/session-continuity
Open

feat: add session continuity for full context forwarding#40
marcusquinn wants to merge 3 commits intosteipete:mainfrom
marcusquinn:feature/session-continuity

Conversation

@marcusquinn
Copy link

@marcusquinn marcusquinn commented Jan 15, 2026

Summary

  • Add session continuity to forward full context across calls
  • Add file-based session persistence for reliability across server restarts
  • Improve continuity for multi-step Claude Code MCP usage

Changes

  1. Session continuity - sessionId parameter and --resume flag support
  2. File-based persistence - Sessions stored in ~/.claude-code-mcp/sessions/ survive restarts
  3. Messages injection - Forward conversation history on first call
  4. Slash command translation - / -> @ for subagent invocation

Testing

  • Manual testing of session persistence across server restarts

Source

- Add sessionId parameter to maintain conversation state across calls
- Add messages array for injecting conversation history on first call
- Use Claude CLI --resume flag for session continuation
- Parse JSON output to extract session_id for mapping
- Add slash command translation (/ -> @) for subagent invocation
- Add stateless option for backward-compatible single-prompt mode
- Update tool description to document new capabilities

This enables parent interfaces to use claude-code-mcp as if Claude Code
were the model, with full context awareness and session continuity.
- Add LRU-style session map eviction (max 1000 sessions)
- Fix slash command regex to avoid matching file paths
- Improve JSON parsing to handle multi-line output
- Add runtime validation for sessionId and messages parameters
- Restore detailed JSDoc for findClaudeCli function
- Improve error message for missing prompt parameter
- Store session mappings in ~/.config/claude-code-mcp/sessions.json
- Sessions persist across MCP server restarts
- Auto-expire sessions after 24 hours
- Clean expired sessions on load
- Maintain LRU eviction (max 1000 sessions)

This enables session continuity even when the MCP server is spawned
fresh for each call (e.g., via npx).
marcusquinn added a commit to marcusquinn/aidevops that referenced this pull request Jan 25, 2026
Keep using github:marcusquinn/claude-code-mcp fork until
steipete/claude-code-mcp#40 is merged.
marcusquinn added a commit to marcusquinn/aidevops that referenced this pull request Jan 25, 2026
* refactor: optimize MCP loading with lazy-load strategy

- Add claude-code subagent for on-demand claude-code-mcp access
- Remove claude-code-mcp_* from main agent tool lists (Build+, AI-DevOps)
- Set 12 MCPs to lazy-load (enabled: false): claude-code-mcp, gsc, localwp,
  chrome-devtools, outscraper, amazon-order-history, google-analytics-mcp,
  dataforseo, shadcn, macos-automator, quickfile, MCP_DOCKER
- Keep 8 MCPs eager-loaded for all main agents: osgrep, augment-context-engine,
  context7, repomix, playwriter, gh_grep, sentry, socket
- Enable playwriter_* and repomix_* globally for all main agents
- Add MCP loading policy enforcement to update existing configs

This reduces OpenCode startup time by deferring MCP server initialization
until the specific subagent that needs them is invoked.

* fix: address code review feedback

- Remove hardcoded /opt/homebrew/bin/npx fallback, use shutil.which only
- Add warning for uncategorized MCPs in loading policy
- Remove redundant else blocks that duplicated loading policy logic
- Update claude-code-mcp.json template to use upstream @steipete package
- Add sys import for stderr warnings

* fix: revert to fork until upstream PR #40 merged

Keep using github:marcusquinn/claude-code-mcp fork until
steipete/claude-code-mcp#40 is merged.
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.

1 participant