Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Support for Parameter Passing in MCP Configuration and Runtime Context #1023

Open
@magicbrighter

Description

@magicbrighter

Description

Title: Support for Parameter Passing in MCP Configuration and Runtime Context

Issue Description:

I would like to request support for parameter passing in MCP (Model Context Protocol) in two key scenarios:

1. Configuration-time Parameter Passing

Use Case: When configuring streamable HTTP connections, there's a need to pass business-specific parameters to the MCP server during initialization.

Request:

  • How can we configure additional business parameters in the MCP configuration?
  • What's the proper way for MCP servers to receive and process these configuration parameters?
  • Is there a dedicated entry point or configuration section for custom parameters?

Example Scenario:

{"mcpServers": {
     "weather": {
              "url": "http://localhost:8000/mcp",
              "transport": "streamable_http",
              "customParams": {
                    "apiKey": "xxx",
                    "environment": "production",
                    "businessConfig": {...}
               }
          }
  }
}

2. Runtime Context Parameter Passing

Use Case: During MCP tool invocation, there's a need to pass sensitive or context-specific parameters that should:

  • Be accessible to the MCP server tools
  • Remain hidden from the AI model for security reasons
  • Be transmitted transparently through the MCP protocol

Request:

  • Support for header-like parameter passing mechanism in MCP SDK
  • Secure context parameter transmission that bypasses model visibility
  • Runtime parameter injection for tool execution

Previous Implementation Reference:
In previous business implementations, we used HTTP headers to pass such parameters. We're looking for similar functionality in the MCP SDK.

Expected Behavior:

// Client side - passing context parameters
await mcpClient.callTool('my-tool', {arguments: {...},
  context: {userId: "user123",
    sessionId: "session456",
    securityToken: "token789"// Hidden from model}
});

// Server side - accessing context parameters
function myTool(args, context) {
  const userId = context.userId;const securityToken = context.securityToken;
  // Tool implementation
}

Would appreciate guidance on current capabilities and potential roadmap for these features.

References

No response

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