@utaba/ucm-mcp-server 6.5.1 → 6.7.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (108) hide show
  1. package/dist/clients/UcmLocalApiClient.d.ts +221 -2
  2. package/dist/clients/UcmLocalApiClient.js +211 -3
  3. package/dist/index.js +1 -1
  4. package/dist/interfaces/IMcpTool.d.ts +2 -2
  5. package/dist/server/ToolRegistry.js +44 -8
  6. package/dist/tools/authorization/ListAuthorizationsTool.js +2 -2
  7. package/dist/tools/authorization/SignOutTool.js +2 -2
  8. package/dist/tools/base/BaseToolController.d.ts +7 -4
  9. package/dist/tools/base/BaseToolController.js +28 -11
  10. package/dist/tools/connections/AccessConnectionTool.js +2 -2
  11. package/dist/tools/connections/CallRemoteToolTool.js +3 -3
  12. package/dist/tools/core/DeleteArtifactTool.js +5 -4
  13. package/dist/tools/core/EditArtifactMetadataTool.js +1 -1
  14. package/dist/tools/core/GetArtifactTool.js +1 -1
  15. package/dist/tools/core/GetArtifactVersionsTool.js +1 -1
  16. package/dist/tools/core/GetChunkTool.js +1 -1
  17. package/dist/tools/core/ListArtifactsTool.js +1 -1
  18. package/dist/tools/core/MoveArtifactTool.d.ts +1 -1
  19. package/dist/tools/core/MoveArtifactTool.js +2 -2
  20. package/dist/tools/core/PublishArtifactFromFileTool.js +1 -1
  21. package/dist/tools/core/PublishArtifactTool.js +2 -2
  22. package/dist/tools/core/SearchArtifactsTool.js +7 -6
  23. package/dist/tools/memory-graph/GraphCreateEntitiesTool.d.ts +14 -0
  24. package/dist/tools/memory-graph/GraphCreateEntitiesTool.js +58 -0
  25. package/dist/tools/memory-graph/GraphCreateRelationshipsTool.d.ts +14 -0
  26. package/dist/tools/memory-graph/GraphCreateRelationshipsTool.js +57 -0
  27. package/dist/tools/memory-graph/GraphCreateTool.d.ts +14 -0
  28. package/dist/tools/memory-graph/GraphCreateTool.js +64 -0
  29. package/dist/tools/memory-graph/GraphDeleteEntitiesTool.d.ts +14 -0
  30. package/dist/tools/memory-graph/GraphDeleteEntitiesTool.js +45 -0
  31. package/dist/tools/memory-graph/GraphDeleteRelationshipsTool.d.ts +14 -0
  32. package/dist/tools/memory-graph/GraphDeleteRelationshipsTool.js +45 -0
  33. package/dist/tools/memory-graph/GraphExploreTool.d.ts +14 -0
  34. package/dist/tools/memory-graph/GraphExploreTool.js +73 -0
  35. package/dist/tools/memory-graph/GraphFindEntitiesTool.d.ts +14 -0
  36. package/dist/tools/memory-graph/GraphFindEntitiesTool.js +68 -0
  37. package/dist/tools/memory-graph/GraphFindPathsTool.d.ts +14 -0
  38. package/dist/tools/memory-graph/GraphFindPathsTool.js +62 -0
  39. package/dist/tools/memory-graph/GraphGetEntityTool.d.ts +14 -0
  40. package/dist/tools/memory-graph/GraphGetEntityTool.js +49 -0
  41. package/dist/tools/memory-graph/GraphGetRelationshipsTool.d.ts +14 -0
  42. package/dist/tools/memory-graph/GraphGetRelationshipsTool.js +62 -0
  43. package/dist/tools/memory-graph/GraphListTemplatesTool.d.ts +14 -0
  44. package/dist/tools/memory-graph/GraphListTemplatesTool.js +34 -0
  45. package/dist/tools/memory-graph/GraphListTool.d.ts +14 -0
  46. package/dist/tools/memory-graph/GraphListTool.js +45 -0
  47. package/dist/tools/memory-graph/GraphOpenTool.d.ts +15 -0
  48. package/dist/tools/memory-graph/GraphOpenTool.js +50 -0
  49. package/dist/tools/memory-graph/GraphProposeVocabularyTool.d.ts +14 -0
  50. package/dist/tools/memory-graph/GraphProposeVocabularyTool.js +149 -0
  51. package/dist/tools/memory-graph/GraphSearchTool.d.ts +14 -0
  52. package/dist/tools/memory-graph/GraphSearchTool.js +94 -0
  53. package/dist/tools/memory-graph/GraphTraverseTool.d.ts +14 -0
  54. package/dist/tools/memory-graph/GraphTraverseTool.js +114 -0
  55. package/dist/tools/memory-graph/GraphUpdateEntitiesTool.d.ts +14 -0
  56. package/dist/tools/memory-graph/GraphUpdateEntitiesTool.js +58 -0
  57. package/dist/tools/memory-graph/GraphUpdateTool.d.ts +14 -0
  58. package/dist/tools/memory-graph/GraphUpdateTool.js +59 -0
  59. package/dist/tools/memory-graph/KnowledgeSetListTool.d.ts +14 -0
  60. package/dist/tools/memory-graph/KnowledgeSetListTool.js +25 -0
  61. package/dist/tools/memory-graph/KnowledgeSetOpenTool.d.ts +14 -0
  62. package/dist/tools/memory-graph/KnowledgeSetOpenTool.js +31 -0
  63. package/dist/tools/repository/CreateRepositoryTool.js +10 -9
  64. package/dist/tools/repository/GetRepositoryTool.js +15 -15
  65. package/dist/tools/repository/UpdateRepositoryTool.js +10 -9
  66. package/dist/tools/sharepoint/SharePointListConnectionsTool.js +1 -1
  67. package/dist/tools/sharepoint/SharePointListFoldersTool.js +1 -1
  68. package/dist/tools/utility/AuthorIndexTool.js +6 -5
  69. package/dist/tools/utility/AuthorRecentsTool.js +6 -5
  70. package/dist/tools/utility/ListRepositoriesTool.js +5 -4
  71. package/dist/utils/McpErrorHandler.js +1 -1
  72. package/package.json +1 -1
  73. package/package.json.backup +1 -1
  74. package/dist/clients/UcmApiClient.d.ts +0 -157
  75. package/dist/clients/UcmApiClient.js +0 -443
  76. package/dist/publish/package.json +0 -37
  77. package/dist/tools/artifacts/GetArtifactController.d.ts +0 -34
  78. package/dist/tools/artifacts/GetArtifactController.js +0 -397
  79. package/dist/tools/artifacts/GetLatestController.d.ts +0 -39
  80. package/dist/tools/artifacts/GetLatestController.js +0 -469
  81. package/dist/tools/artifacts/ListVersionsController.d.ts +0 -43
  82. package/dist/tools/artifacts/ListVersionsController.js +0 -530
  83. package/dist/tools/artifacts/PublishArtifactController.d.ts +0 -37
  84. package/dist/tools/artifacts/PublishArtifactController.js +0 -605
  85. package/dist/tools/discovery/BrowseCategoriesController.d.ts +0 -25
  86. package/dist/tools/discovery/BrowseCategoriesController.js +0 -400
  87. package/dist/tools/discovery/FindByPurposeController.d.ts +0 -12
  88. package/dist/tools/discovery/FindByPurposeController.js +0 -131
  89. package/dist/tools/discovery/ListAuthorsController.d.ts +0 -20
  90. package/dist/tools/discovery/ListAuthorsController.js +0 -274
  91. package/dist/tools/discovery/SearchArtifactsController.d.ts +0 -14
  92. package/dist/tools/discovery/SearchArtifactsController.js +0 -226
  93. package/dist/tools/navigation/ExploreNamespaceController.d.ts +0 -35
  94. package/dist/tools/navigation/ExploreNamespaceController.js +0 -548
  95. package/dist/tools/repository/DeleteRepositoryGuidanceTool.d.ts +0 -13
  96. package/dist/tools/repository/DeleteRepositoryGuidanceTool.js +0 -93
  97. package/dist/tools/sharepoint/SharePointSignOutTool.d.ts +0 -22
  98. package/dist/tools/sharepoint/SharePointSignOutTool.js +0 -114
  99. package/dist/tools/utility/HealthCheckController.d.ts +0 -11
  100. package/dist/tools/utility/HealthCheckController.js +0 -60
  101. package/dist/tools/utility/SubmitFeedbackTool.d.ts +0 -16
  102. package/dist/tools/utility/SubmitFeedbackTool.js +0 -68
  103. package/dist/tools/utility/ValidatePathController.d.ts +0 -30
  104. package/dist/tools/utility/ValidatePathController.js +0 -465
  105. package/dist/utils/HttpsAgentFactory.d.ts +0 -21
  106. package/dist/utils/HttpsAgentFactory.js +0 -50
  107. package/dist/utils/ValidationUtils.d.ts +0 -10
  108. package/dist/utils/ValidationUtils.js +0 -50
@@ -1,114 +0,0 @@
1
- /**
2
- * SharePointSignOutTool
3
- * Revoke user's OnBehalfOf authorization for a SharePoint connection
4
- */
5
- import { BaseToolController } from '../base/BaseToolController.js';
6
- import { McpError, McpErrorCode } from '../../utils/McpErrorHandler.js';
7
- export class SharePointSignOutTool extends BaseToolController {
8
- constructor(ucmClient, logger, publishingAuthorId) {
9
- super(ucmClient, logger, publishingAuthorId);
10
- }
11
- get name() {
12
- return 'ucm_sharepoint_signout';
13
- }
14
- get description() {
15
- return 'This signs the user out only for connections with user-delegated permissions.';
16
- }
17
- get inputSchema() {
18
- return {
19
- type: 'object',
20
- properties: {
21
- connectionId: {
22
- type: 'string',
23
- description: 'SharePoint connection ID to revoke authorization for (get this from list_connections)',
24
- minLength: 36,
25
- maxLength: 36
26
- }
27
- },
28
- required: ['connectionId']
29
- };
30
- }
31
- validateParams(params) {
32
- super.validateParams(params);
33
- // Validate connectionId
34
- if (!params.connectionId || typeof params.connectionId !== 'string') {
35
- throw new McpError(McpErrorCode.InvalidParams, 'connectionId is required and must be a string');
36
- }
37
- if (params.connectionId.length !== 36) {
38
- throw new McpError(McpErrorCode.InvalidParams, 'connectionId must be a valid UUID (36 characters)');
39
- }
40
- }
41
- async handleExecute(params) {
42
- this.logger.info('SharePointSignOutTool', `Revoking SharePoint authorization for connection ${params.connectionId}`);
43
- try {
44
- // Call API to revoke authorization
45
- const result = await this.ucmClient.sharePointSignOut(params.connectionId);
46
- this.logger.info('SharePointSignOutTool', 'Authorization revoked successfully', '', {
47
- connectionId: params.connectionId,
48
- success: result.success
49
- });
50
- // Return structured markdown response
51
- const markdown = this.formatSignOutResponse(result);
52
- return markdown;
53
- }
54
- catch (error) {
55
- // Sanitize error for logging to avoid circular reference issues
56
- const sanitizedError = {
57
- message: error?.message,
58
- status: error?.response?.status,
59
- data: error?.response?.data
60
- };
61
- this.logger.error('SharePointSignOutTool', 'Failed to revoke authorization', '', sanitizedError);
62
- if (error instanceof McpError) {
63
- throw error;
64
- }
65
- // Handle API errors
66
- if (error.response) {
67
- const status = error.response.status;
68
- const errorData = error.response.data;
69
- if (status === 401 || status === 403) {
70
- throw new McpError(McpErrorCode.InvalidRequest, `Access denied: ${errorData?.message || 'Not authorized to revoke SharePoint authorization'}`);
71
- }
72
- if (status === 404) {
73
- throw new McpError(McpErrorCode.InvalidRequest, `Connection not found: ${errorData?.message || 'SharePoint connection does not exist'}`);
74
- }
75
- if (status === 400 && errorData?.error === 'INVALID_AUTH_TYPE') {
76
- throw new McpError(McpErrorCode.InvalidRequest, `Invalid operation: Only OnBehalfOf (user-delegated) connections support user authorization. This connection uses ServicePrincipal authentication.`);
77
- }
78
- throw new McpError(McpErrorCode.InternalError, `API error: ${errorData?.message || error.message}`);
79
- }
80
- throw new McpError(McpErrorCode.InternalError, `Failed to revoke SharePoint authorization: ${error.message}`);
81
- }
82
- }
83
- /**
84
- * Format sign out response as markdown
85
- */
86
- formatSignOutResponse(result) {
87
- const lines = [];
88
- lines.push('# SharePoint Authorization Revoked\n');
89
- if (result.success) {
90
- lines.push('✅ **Status**: Authorization successfully revoked\n');
91
- lines.push(`**Connection ID**: ${result.connectionId}\n`);
92
- if (result.revokedAt) {
93
- lines.push(`**Revoked At**: ${new Date(result.revokedAt).toLocaleString()}\n`);
94
- }
95
- lines.push('\n## What This Means\n');
96
- lines.push('- Your access tokens have been deleted from the system');
97
- lines.push('- You are now signed out of this SharePoint connection');
98
- lines.push('- To access SharePoint files again, you must re-authorize\n');
99
- if (result._links?.authorize) {
100
- lines.push('\n## Re-authorize Access\n');
101
- lines.push(`To grant access again, visit: ${result._links.authorize.href}\n`);
102
- }
103
- }
104
- else {
105
- lines.push('⚠️ **Status**: Revocation failed or not needed\n');
106
- lines.push(`**Message**: ${result.message}\n`);
107
- if (result.details?.reason) {
108
- lines.push(`**Reason**: ${result.details.reason}\n`);
109
- }
110
- }
111
- return lines.join('\n');
112
- }
113
- }
114
- //# sourceMappingURL=SharePointSignOutTool.js.map
@@ -1,11 +0,0 @@
1
- import { BaseToolController } from '../base/BaseToolController.js';
2
- import { UcmLocalApiClient } from '../../clients/UcmLocalApiClient.js';
3
- import { ILogger } from '../../interfaces/ILogger.js';
4
- export declare class HealthCheckController extends BaseToolController {
5
- constructor(ucmClient: UcmLocalApiClient, logger: ILogger, publishingAuthorId?: string);
6
- get name(): string;
7
- get description(): string;
8
- get inputSchema(): any;
9
- protected handleExecute(_params: any): Promise<any>;
10
- }
11
- //# sourceMappingURL=HealthCheckController.d.ts.map
@@ -1,60 +0,0 @@
1
- import { BaseToolController } from '../base/BaseToolController.js';
2
- //import packageJson from '../../../../publish/package.json' assert { type: 'json' };
3
- const version = '6.5.1'; //TODO: tried to sync this with packageJson but it didn't work.
4
- export class HealthCheckController extends BaseToolController {
5
- constructor(ucmClient, logger, publishingAuthorId) {
6
- super(ucmClient, logger, publishingAuthorId);
7
- }
8
- get name() {
9
- return 'ucm_health_check';
10
- }
11
- get description() {
12
- return 'Checks API connectivity only — does NOT load operational context. Use ucm_connect for conversation initialisation';
13
- }
14
- get inputSchema() {
15
- return {
16
- type: 'object',
17
- properties: {},
18
- required: []
19
- };
20
- }
21
- async handleExecute(_params) {
22
- try {
23
- // Check UCM API connectivity
24
- const ucmHealth = await this.ucmClient.healthCheck();
25
- return {
26
- status: 'healthy',
27
- mcpServer: {
28
- status: 'running',
29
- timestamp: new Date().toISOString(),
30
- uptime: process.uptime(),
31
- version: version
32
- },
33
- ucmApi: {
34
- status: 'connected',
35
- response: ucmHealth
36
- },
37
- config: {
38
- defaultRepository: 'main',
39
- author: this.publishingAuthorId
40
- }
41
- };
42
- }
43
- catch (error) {
44
- return {
45
- status: 'unhealthy',
46
- mcpServer: {
47
- status: 'running',
48
- timestamp: new Date().toISOString(),
49
- uptime: process.uptime(),
50
- version: version
51
- },
52
- ucmApi: {
53
- status: 'disconnected',
54
- error: error instanceof Error ? error.message : String(error)
55
- }
56
- };
57
- }
58
- }
59
- }
60
- //# sourceMappingURL=HealthCheckController.js.map
@@ -1,16 +0,0 @@
1
- import { BaseToolController } from '../base/BaseToolController.js';
2
- import { UcmLocalApiClient } from '../../clients/UcmLocalApiClient.js';
3
- import { ILogger } from '../../interfaces/ILogger.js';
4
- export declare class SubmitFeedbackTool extends BaseToolController {
5
- constructor(ucmClient: UcmLocalApiClient, logger: ILogger, publishingAuthorId?: string);
6
- get name(): string;
7
- get description(): string;
8
- get inputSchema(): any;
9
- protected handleExecute(params: {
10
- title: string;
11
- body: string;
12
- reportType: 'issue' | 'feedback';
13
- tags?: string;
14
- }): Promise<any>;
15
- }
16
- //# sourceMappingURL=SubmitFeedbackTool.d.ts.map
@@ -1,68 +0,0 @@
1
- import { BaseToolController } from '../base/BaseToolController.js';
2
- export class SubmitFeedbackTool extends BaseToolController {
3
- constructor(ucmClient, logger, publishingAuthorId) {
4
- super(ucmClient, logger, publishingAuthorId);
5
- }
6
- get name() {
7
- return 'ucm_submit_user_issue_or_feedback';
8
- }
9
- get description() {
10
- return 'Submit user feedback, bug reports, feature requests ONLY if the user requests it and they want to send details to the UCM development team. Do NOT include sensitive or project related details. Ask the user before submitting the data if it is appropriate.';
11
- }
12
- get inputSchema() {
13
- return {
14
- type: 'object',
15
- properties: {
16
- title: {
17
- type: 'string',
18
- description: 'Brief title for the feedback or issue (1-100 characters)',
19
- minLength: 1,
20
- maxLength: 100
21
- },
22
- body: {
23
- type: 'string',
24
- description: 'Detailed description of the feedback or issue (1-1000 characters)',
25
- minLength: 1,
26
- maxLength: 1000
27
- },
28
- reportType: {
29
- type: 'string',
30
- enum: ['issue', 'feedback'],
31
- description: 'Type of report: "issue" for bug reports and problems, "feedback" for feature requests and general feedback'
32
- },
33
- tags: {
34
- type: 'string',
35
- description: 'Optional comma-separated tags for categorization (e.g., "ui,bug,performance")',
36
- maxLength: 1000
37
- }
38
- },
39
- required: ['title', 'body', 'reportType']
40
- };
41
- }
42
- async handleExecute(params) {
43
- this.logger.info('SubmitFeedbackTool', `Submitting ${params.reportType}: ${params.title}`);
44
- try {
45
- const result = await this.ucmClient.submitFeedback({
46
- title: params.title,
47
- body: params.body,
48
- reportType: params.reportType,
49
- tags: params.tags
50
- });
51
- this.logger.info('SubmitFeedbackTool', `Successfully submitted ${params.reportType} with ID: ${result.feedbackId}`);
52
- return {
53
- success: true,
54
- feedbackId: result.feedbackId,
55
- submittedAt: result.createdAt,
56
- message: result.message,
57
- reportType: params.reportType,
58
- title: params.title
59
- };
60
- }
61
- catch (error) {
62
- const errorMessage = error instanceof Error ? error.message : String(error);
63
- this.logger.error('SubmitFeedbackTool', `Failed to submit ${params.reportType}: ${errorMessage}`, '', error);
64
- throw error;
65
- }
66
- }
67
- }
68
- //# sourceMappingURL=SubmitFeedbackTool.js.map
@@ -1,30 +0,0 @@
1
- import { BaseToolController } from '../base/BaseToolController.js';
2
- import { UcmApiClient } from '../../clients/UcmLocalApiClient.js';
3
- import { ILogger } from '../../interfaces/ILogger.js';
4
- export declare class ValidatePathController extends BaseToolController {
5
- constructor(ucmClient: UcmApiClient, logger: ILogger);
6
- get name(): string;
7
- get description(): string;
8
- get inputSchema(): any;
9
- protected handleExecute(params: any): Promise<any>;
10
- private performPathValidation;
11
- private validateBasicFormat;
12
- private parsePathComponents;
13
- private determinePathType;
14
- private isVersionedPath;
15
- private looksLikeVersion;
16
- private validateComponents;
17
- private validateSemantics;
18
- private checkPathExistence;
19
- private checkParentPathExistence;
20
- private findSimilarPaths;
21
- private generateSuggestions;
22
- private applyStrictModeValidation;
23
- private validateComponentConsistency;
24
- private isValidAuthorId;
25
- private isValidSubcategory;
26
- private isValidTechnology;
27
- private calculatePathSimilarity;
28
- private generateSimilarityReason;
29
- }
30
- //# sourceMappingURL=ValidatePathController.d.ts.map