McpServerToolCreateOptions miss MarshalResult option.
Maintainer thường phản hồi trong vòng 1 ngày
@jstar0 đang làm issue này rồi.
Từ ngày 13/9/2026.
Đánh giá
- Độ khó
- 3/5
- Thời gian dự kiến
- 1-2 ngày
- Mức phù hợp với người mới
- 68/100
- Loại issue
- Tính năng
- Độ rõ ràng
- Khá rõ ràng
- Mức độ hoạt động
- Sôi nổi
- Công nghệ
- csharp
- Lĩnh vực
- backend-api-design
Hướng nghiên cứu
Bắt đầu với McpServerToolCreateOptions, AIFunctionFactoryOptions, McpServerTool.Create, DeriveOptions và CreateAIFunctionFactoryOptions để theo dõi cách các thiết đặt tạo được truyền đi. Thêm một cách được hỗ trợ để cấu hình MarshalResult thông qua các tùy chọn tạo tool, sau đó xác minh rằng callback đã cấu hình đến được AIFunctionFactoryOptions mà không dùng reflection.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
Is your feature request related to a problem? Please describe.
i need MarshalResult for AIFunctionFactoryOptions, but the CreateAIFunctionFactoryOptions assign the MarshalResult=new ValueTask(result).
i without any solution to reset it, i just can to create a AIFunction,then use the AIFunction to create McpServerTool.
but i will loss many settings from DeriveOptions and CreateAIFunctionFactoryOptions(private methods).
Describe the solution you'd like
please add a MarhsalResult option in McpServerToolCreateOptions, then i can initialize the AIFunctionFactoryOptions.MarshalResult.
or add a Action< AIFunctionFactoryOptions > initailizeAIFunctionOptions, then call after CreateAIFunctionFactoryOptions, give me a chance to update the aifunction options.
public new static AIFunctionMcpServerResource Create(MethodInfo method, object? target, McpServerResourceCreateOptions? options
, Action<AIFunctionFactoryOptions> initializeAIFunctionFactoryOptions = null)
{
Throw.IfNull(method, "method");
options = DeriveOptions(method, options);
var aioptions = CreateAIFunctionFactoryOptions(method, options);
initializeAIFunctionFactoryOptions?.Invoke(aioptions);
return Create(AIFunctionFactory.Create(method, target, aioptions), options);
}
public new static AIFunctionMcpServerTool Create(MethodInfo method, object? target, McpServerToolCreateOptions? options
, Action<AIFunctionFactoryOptions> initializeAIFunctionFactoryOptions = null)
{
Throw.IfNull(method, "method");
options = DeriveOptions(method, options);
var aioptions = CreateAIFunctionFactoryOptions(method, options);
initializeAIFunctionFactoryOptions?.Invoke(aioptions);
return Create(AIFunctionFactory.Create(method, target, aioptions), options);
}`
public new static AIFunctionMcpServerPrompt Create(MethodInfo method, object? target, McpServerPromptCreateOptions? options
, Action<AIFunctionFactoryOptions> initializeAIFunctionFactoryOptions = null)
{
Throw.IfNull(method, "method");
options = DeriveOptions(method, options);
var aioptions = CreateAIFunctionFactoryOptions(method, options);
initializeAIFunctionFactoryOptions?.Invoke(aioptions);
return Create(AIFunctionFactory.Create(method, target, aioptions), options);
}
Describe alternatives you've considered
currently , i just can use reflection to invoke DeriveOptions and CreateAIFunctionFactoryOptions,
but this was not stable in the future version. please add a standard MarshalResult options for my feature.
var createoptions = new McpServerToolCreateOptions()
{
Name = mcpname,
SerializerOptions = serializeroptions,
};
createoptions = (McpServerToolCreateOptions)DummyInstance.Value.Tool_DeriveOptions.Invoke(null, [mcpmethod, createoptions]);
var aifuncoptions = (AIFunctionFactoryOptions)DummyInstance.Value.Tool_CreateAIFunctionFactoryOptions.Invoke(null, [mcpmethod, createoptions]);
aifuncoptions.MarshalResult = OnToolMarshalResult;
var aifunc = AIFunctionFactory.Create(mcpmethod, instance, aifuncoptions);
var tool = McpServerTool.Create(aifunc, createoptions);
log.Info($"McpTool 已建立 - tool:{tool}。\r\n{mcpmethod}");
tools.Add(tool);
- Ngôn ngữ chính
- C#
- Star
- 4.6k
- Fork
- 819
- Merge trung bình
- 8 ngày 7 giờ
- Pull request đã merge (30 ngày)
- 3
Chuẩn bị môi trường
Khởi chạy dev container của dự án ngay trên trình duyệt, bằng tài khoản GitHub của bạn.
- Không có Dockerfile hay tệp Docker Compose
- Không có mẫu pull request
- Đọc hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của modelcontextprotocol/csharp-sdk
-
ClaimsPrincipal parameter injection sample requestCó thể đã có người làm Có pull request liên kết đang mở hoặc đã được merge. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 74/100
modelcontextprotocol/csharp-sdk#1899 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Document ClientOAuthOptions.ScopeSelector usageCó thể đã có người làm @z0rimo đã nhận 25 ngày trước. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
modelcontextprotocol/csharp-sdk#1867 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
HTTP+SSE client: POST responses are never disposed, leaking one connection per sent messageCó thể đã có người làm @yalcinfu22 đã nhận 40 ngày trước. Đang mở
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 88/100
modelcontextprotocol/csharp-sdk#1840 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
stdio client never closes the server's stdin, so every client dispose burns the full ShutdownTimeout (5s by default)Có thể đã có người làm @luisangelrod đã nhận 40 ngày trước. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 84/100
modelcontextprotocol/csharp-sdk#1836 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
enhancement needs confirmation
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 64/100
modelcontextprotocol/csharp-sdk#678 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
Tất cả issue của modelcontextprotocol/csharp-sdk
Issue tương tự
-
[Doc Gap] Document new --enable-public-network-access breaking change for azurebackup vault createĐang mởcopilot documentation
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 86/100
Maintainer thường phản hồi trong vòng 1 ngày
-
area-dashboard
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
Maintainer thường phản hồi trong vòng 1 ngày
-
0 - Backlog Bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
BrighterCommand/Brighter#4539 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
triage
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
-
area-networking
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
dotnet/aspnetcore#69671 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày