You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 3338e88
Browse filesBrowse the repository at this point in the historyBrowse files
Copy file name to clipboardExpand all lines: .github/copilot-instructions.md
+5-5Lines changed: 5 additions & 5 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -57,14 +57,14 @@ The SDK consists of three main packages:
57
57
58
58
### Naming Conventions
59
59
- Use `McpClient`, `McpServer`, `McpSession` for MCP-related classes (capitalize MCP)
60
-
- Prefix MCP-specific types with `Mcp` (e.g., `McpException`, `McpEndpoint`)
60
+
- Prefix MCP-specific types with `Mcp` (e.g., `McpException`, `McpServerOptions`)
61
61
- Use descriptive names for parameters with `[Description("...")]` attributes when exposing to MCP
62
62
63
63
## Architecture Patterns
64
64
65
65
### Dependency Injection
66
66
- Use Microsoft.Extensions.DependencyInjection patterns
67
-
- Register services with `.AddMcpServer()`and `.AddMcpClient()`extension methods
67
+
- Register the server with the `.AddMcpServer()` extension method
68
68
- Support both builder patterns and options configuration
69
69
70
70
### JSON Serialization
@@ -74,7 +74,7 @@ The SDK consists of three main packages:
74
74
- Set `JsonIgnoreCondition.WhenWritingNull` for optional properties to minimize payload size
75
75
- Use `JsonSerializerDefaults.Web` for camelCase property naming
76
76
- Protocol types are decorated with `[JsonSerializable]` attributes for AOT support
77
-
-Custom converters: `CustomizableJsonStringEnumConverter` for flexible enum serialization
77
+
-When reflection-based serialization is enabled, user-defined enums are serialized as strings with the built-in `JsonStringEnumConverter`; Native AOT enums require source-generated converter metadata such as `JsonStringEnumConverter<TEnum>`.
78
78
79
79
### Async Patterns
80
80
- All I/O operations should be async
@@ -246,7 +246,7 @@ Two primary transport implementations with different invariants:
246
246
- Default to `McpJsonUtilities.DefaultOptions` if not specified
247
247
- Can use reflection-based serialization or custom source generators
248
248
249
-
-**Enum handling**: `CustomizableJsonStringEnumConverter` for flexible enum serialization
249
+
-**Enum handling**: reflection-based serialization uses the built-in `JsonStringEnumConverter`; Native AOT enums require source-generated converter metadata such as `JsonStringEnumConverter<TEnum>`
250
250
251
251
## Architecture and Design Patterns
252
252
@@ -255,7 +255,7 @@ Two primary transport implementations with different invariants:
255
255
-**IMcpServerBuilder** pattern provides fluent API for configuring servers via DI
256
256
- Server primitives (tools, prompts, resources) are discovered via reflection using attributes
257
257
- Support both attribute-based registration (`WithTools<T>()`) and instance-based (`WithTools(target)`)
258
-
- Use `McpServerFactory` to create server instances with configured options
258
+
- Use `McpServer.Create` to create server instances with configured options
259
259
260
260
### Tool/Prompt/Resource Discovery
261
261
- Tools, prompts, and resources use attribute-based discovery: `[McpServerTool]`, `[McpServerPrompt]`, `[McpServerResource]`
0 commit comments