-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathProgram.cs
More file actions
32 lines (28 loc) · 939 Bytes
/
Copy pathProgram.cs
File metadata and controls
32 lines (28 loc) · 939 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
using System.ComponentModel;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Hosting;
using ModelContextProtocol.Server;
var builder = Host.CreateApplicationBuilder(args);
builder.Services
.AddMcpServer()
.WithStdioServerTransport()
.WithToolsFromAssembly();
await builder.Build().RunAsync();
public record BigIntResult(
long Int64Max,
long UnsafeButNotMax,
long SafeIntegerMax);
[McpServerToolType]
public static class BigNumberTool
{
[McpServerTool(Name = "return_big_numbers", UseStructuredContent = true, ReadOnly = true)]
[Description("Returns 64-bit values using MCP structuredContent.")]
public static BigIntResult ReturnBigNumbers()
{
return new BigIntResult(
Int64Max: long.MaxValue,
UnsafeButNotMax: 9_223_372_036_854_775L,
SafeIntegerMax: 9_007_199_254_740_991L
);
}
}