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
Implement Model Context Protocol (MCP) service with tools and prompts management
- Added IMcpService interface defining core MCP methods for tools and prompts.
- Implemented McpService class with methods for listing tools, listing prompts, calling tools, and processing NLWeb queries.
- Created MCP models including McpTool, McpPrompt, and related response/request classes.
- Developed unit tests for McpService to ensure functionality of tools and prompts.
- Introduced TestNLWebService for mocking INLWebService in tests.
- Updated NLWebNet.Tests project to include NSubstitute for mocking dependencies.
Copy file name to clipboardExpand all lines: doc/todo.md
+49-11Lines changed: 49 additions & 11 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -54,9 +54,11 @@ The demo application is now fully functional with a modern .NET 9 Blazor Web App
54
54
- ✅ **Business Logic Layer**: Complete implementation of core services (INLWebService, IQueryProcessor, IResultGenerator, IDataBackend) with Microsoft.Extensions.AI integration
55
55
- ✅ **Comprehensive Testing**: Added MSTest unit tests for QueryProcessor and MockDataBackend (11 tests, 100% pass rate)
56
56
- ✅ **Testing Framework Migration**: Migrated from xUnit to MSTest 3.9.3 with code coverage support and .NET 9 compatibility
57
+
- ✅ **Mocking Library**: Uses NSubstitute 5.3.0 for clean, fluent mock setup and verification in unit tests
57
58
- ✅ **Package Compatibility**: Ensured all dependencies are stable .NET 9 compatible versions (except ModelContextProtocol which is appropriately in preview)
-[x]`get_prompt` endpoint handler with template argument substitution
167
+
-[x]**Integration Features**:
168
+
-[x] Full integration with existing `INLWebService` for query processing
169
+
-[x] MCP-specific response formatting for AI client consumption
170
+
-[x] Support for streaming and non-streaming responses
171
+
-[x] Proper error handling and validation
172
+
-[x] Context-aware query processing with conversation history
173
+
-[x]**Comprehensive Testing**: Added 13 MSTest unit tests covering all MCP functionality:
174
+
- Tool listing and validation
175
+
- Prompt listing and template processing
176
+
- Tool calling with various argument combinations
177
+
- Error handling for invalid tools/prompts/arguments
178
+
- Integration with NLWebService
179
+
- Null argument validation
180
+
-[x]**Testing with NSubstitute**: All MCP tests use NSubstitute 5.3.0 for clean mock setup and verification
181
+
182
+
#### Technical Implementation
183
+
184
+
-**Tools Exposed**: `nlweb_search` and `nlweb_query_history` with comprehensive JSON schemas
185
+
-**Prompts Exposed**: Search, summarize, and generate prompts with configurable arguments
186
+
-**Error Handling**: Graceful fallbacks with detailed error messages for AI clients
187
+
-**Type Safety**: Full nullable reference type support and comprehensive validation
188
+
-**Testing**: 100% test coverage with 24/24 tests passing (11 existing + 13 new MCP tests)
189
+
190
+
The MCP integration provides a complete interface for AI clients to interact with NLWeb functionality through standardized tool calls and prompt templates.
153
191
154
192
### Phase 5: API Controllers & Middleware (Library)
0 commit comments