Skip to content

MCP 暴露的方法 在上下文中无法获取到请求头 #137

Description

@s454637190

Is there an existing issue for this?

  • I have searched the existing issues

Is your feature request related to a problem? Please describe the problem.

[McpTool]
[Description("带上下文的工具示例")]
public string ToolWithContext(IMcpCallContext callContext, string input)
{
/*
获取http请求头
*/

var requestId = callContext.McpRequestId;
return $"请求 ID:{requestId},输入:{input}";

}

Describe the solution you'd like

我希望可以直接从MCP方法中获取请求头, 灵活性扩展性都很高

Additional context

No response

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions