Commit a750257
authored
Mcp support (#73)
* feat: Implement Hono-based MCP server with SSE transport
- Introduced a new HonoSSETransport class for managing Server-Sent Events (SSE) connections, enabling real-time communication with the MCP server.
- Created endpoints for establishing SSE connections and handling incoming messages, ensuring robust error handling and response management.
- Integrated the MCP server with the Hono framework, allowing for streamlined message processing and transport management.
- Updated package.json to include the @modelcontextprotocol/sdk dependency for necessary SDK functionalities.
* refactor: Update MCP tools import path
- Changed the import path for addMCPTools from 'mcp/initTools' to './src/mcp/registry.js' to improve module organization and maintainability.
* refactor: Update MCP server configuration and tool registration
- Changed the MCP server name from 'weather' to 'askSentientAI' for better alignment with project goals.
- Refactored tool registration by replacing addMCPTools with ToolRegistry.registerMcpTools to enhance modularity and maintainability.
- Updated package.json to include a new script for starting the MCP server, improving usability for developers.
* feat: Add MCP tool registration functionality
- Introduced the `registerMcpTools` static method in `ToolRegistry` to facilitate the registration of tools with the MCP server.
- Enhanced the tool registration process by iterating over enabled tools and their schemas, allowing for dynamic tool setup.
- Improved the execution handling of registered tools, ensuring proper response formatting and error management.
* test: add test for mcp tool registration
* feat: Enhance specialty domains with additional tools
- Added Calculator and Timestamp Converter tools to multiple specialty domains, improving functionality and versatility.
- Updated the tools array in the domains configuration to include these new tools, ensuring comprehensive coverage across relevant domains.
* chore: Update .dockerignore and .gitignore to include JSON configuration files
- Added configs/*.json to both .dockerignore and .gitignore to prevent JSON configuration files from being included in Docker builds and version control, enhancing project cleanliness and maintainability.
* test: Add Calculator and Timestamp Converter to AskSpecialtyTool tests
- Updated the test suite for AskSpecialtyTool to include new tools: Calculator and Timestamp Converter.
- Enhanced test coverage by verifying the integration of these tools in the toolset, ensuring comprehensive validation of functionality.
* chore: Update ai dependency version in package.json
- Upgraded the "ai" package from version 4.1.45 to 4.3 to ensure compatibility with the latest features and improvements.
- This change supports ongoing efforts to maintain an up-to-date and efficient codebase.
* docs: Update README.md for improved clarity and formatting
- Refined the available tools section by standardizing formatting and enhancing descriptions for better readability.
- Improved API reference details, including clearer parameter descriptions and examples for various endpoints.
- Added whitespace for better visual separation and clarity throughout the document.
- Enhanced overall structure and organization to facilitate easier navigation and understanding for users.
* chore: Update pnpm-lock.yaml with dependency version changes
- Added '@modelcontextprotocol/sdk' version 1.11.0 to the lock file for improved functionality.
- Upgraded 'ai' package from version 4.1.45 to 4.3.13 to ensure compatibility with the latest features.
- Updated various other dependencies to their latest versions, enhancing overall project stability and performance.
* docs: Update README.md to include MCP mode instructions
- Added detailed instructions for running in MCP (Model Context Protocol) mode, including command examples and client configuration.
- Introduced new API endpoints specific to MCP mode, with request and response examples for better clarity.
- Enhanced overall documentation structure to improve user understanding of MCP functionalities.1 parent 1c68bee commit a750257
File tree
10 files changed
+1050
-159
lines changed- src
- registry
- __tests__
- tools
- __tests__
10 files changed
+1050
-159
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
5 | 5 | | |
6 | 6 | | |
7 | 7 | | |
| 8 | + | |
8 | 9 | | |
9 | 10 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
25 | 25 | | |
26 | 26 | | |
27 | 27 | | |
| 28 | + | |
28 | 29 | | |
29 | 30 | | |
30 | 31 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
152 | 152 | | |
153 | 153 | | |
154 | 154 | | |
155 | | - | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
156 | 176 | | |
157 | 177 | | |
158 | 178 | | |
159 | 179 | | |
160 | 180 | | |
161 | | - | |
| 181 | + | |
162 | 182 | | |
163 | 183 | | |
164 | 184 | | |
| |||
171 | 191 | | |
172 | 192 | | |
173 | 193 | | |
174 | | - | |
175 | 194 | | |
176 | 195 | | |
177 | 196 | | |
| |||
217 | 236 | | |
218 | 237 | | |
219 | 238 | | |
220 | | - | |
| 239 | + | |
221 | 240 | | |
222 | 241 | | |
223 | 242 | | |
| |||
318 | 337 | | |
319 | 338 | | |
320 | 339 | | |
321 | | - | |
322 | | - | |
323 | | - | |
324 | | - | |
325 | | - | |
326 | | - | |
327 | | - | |
328 | | - | |
329 | | - | |
330 | | - | |
331 | | - | |
332 | | - | |
333 | | - | |
334 | | - | |
335 | | - | |
336 | | - | |
| 340 | + | |
| 341 | + | |
| 342 | + | |
| 343 | + | |
| 344 | + | |
| 345 | + | |
| 346 | + | |
| 347 | + | |
| 348 | + | |
| 349 | + | |
| 350 | + | |
| 351 | + | |
| 352 | + | |
| 353 | + | |
| 354 | + | |
| 355 | + | |
337 | 356 | | |
338 | 357 | | |
339 | 358 | | |
| |||
387 | 406 | | |
388 | 407 | | |
389 | 408 | | |
| 409 | + | |
390 | 410 | | |
391 | 411 | | |
392 | 412 | | |
| |||
396 | 416 | | |
397 | 417 | | |
398 | 418 | | |
| 419 | + | |
399 | 420 | | |
400 | 421 | | |
401 | 422 | | |
| 423 | + | |
402 | 424 | | |
403 | 425 | | |
404 | 426 | | |
| |||
411 | 433 | | |
412 | 434 | | |
413 | 435 | | |
| 436 | + | |
414 | 437 | | |
415 | 438 | | |
416 | 439 | | |
| |||
422 | 445 | | |
423 | 446 | | |
424 | 447 | | |
| 448 | + | |
425 | 449 | | |
426 | 450 | | |
427 | 451 | | |
428 | 452 | | |
| 453 | + | |
429 | 454 | | |
430 | 455 | | |
431 | 456 | | |
| |||
442 | 467 | | |
443 | 468 | | |
444 | 469 | | |
| 470 | + | |
445 | 471 | | |
446 | 472 | | |
447 | 473 | | |
448 | 474 | | |
| 475 | + | |
449 | 476 | | |
450 | 477 | | |
451 | 478 | | |
| |||
458 | 485 | | |
459 | 486 | | |
460 | 487 | | |
| 488 | + | |
461 | 489 | | |
462 | 490 | | |
463 | 491 | | |
464 | 492 | | |
465 | 493 | | |
466 | 494 | | |
| 495 | + | |
| 496 | + | |
| 497 | + | |
| 498 | + | |
| 499 | + | |
| 500 | + | |
| 501 | + | |
| 502 | + | |
| 503 | + | |
| 504 | + | |
| 505 | + | |
| 506 | + | |
| 507 | + | |
| 508 | + | |
| 509 | + | |
| 510 | + | |
| 511 | + | |
| 512 | + | |
| 513 | + | |
| 514 | + | |
| 515 | + | |
| 516 | + | |
| 517 | + | |
| 518 | + | |
| 519 | + | |
| 520 | + | |
| 521 | + | |
| 522 | + | |
| 523 | + | |
| 524 | + | |
| 525 | + | |
| 526 | + | |
| 527 | + | |
| 528 | + | |
467 | 529 | | |
468 | 530 | | |
469 | 531 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 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 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
6 | 6 | | |
7 | 7 | | |
8 | 8 | | |
| 9 | + | |
9 | 10 | | |
10 | 11 | | |
11 | 12 | | |
| |||
27 | 28 | | |
28 | 29 | | |
29 | 30 | | |
| 31 | + | |
30 | 32 | | |
31 | 33 | | |
32 | | - | |
| 34 | + | |
33 | 35 | | |
34 | 36 | | |
35 | 37 | | |
| |||
0 commit comments