Skip to content

FR: maintain ctx.props #36

@hemanth

Description

@hemanth

I'm trying to access a custom header in order to conditionally load tools on an MCP server.

I'm setting ctx.props in the fetch method, expecting to access it later in the init method.

However, it appears that the ctx.props set during fetch is being flushed or not persisted, as I'm unable to access the expected values in init.

Steps to Reproduce:

  1. Set a custom header in the request.
  2. In the fetch method, read this header and assign it to ctx.props.
  3. Attempt to read ctx.props in init to control conditional tool logic.

Expected Behavior:

The value set in ctx.props during fetch should be accessible in init.

Actual Behavior:

ctx.props appears to be empty or reset by the time init is called post auth.

//cc @geelen (we have discussed about this)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions