framework-mcp 1.1.2 → 1.2.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 (48) hide show
  1. package/.do/app.yaml +78 -0
  2. package/CAPABILITY_TRANSFORMATION_SUMMARY.md +158 -0
  3. package/DAYS_5_6_COMPLETION_SUMMARY.md +178 -0
  4. package/DEPLOYMENT_GUIDE.md +335 -0
  5. package/DEPLOYMENT_SUMMARY_v1.1.3.md +211 -0
  6. package/README.md +34 -35
  7. package/RELEASE_NOTES_v1.1.3.md +321 -0
  8. package/RELEASE_NOTES_v1.2.0.md +396 -0
  9. package/dist/core/capability-analyzer.d.ts +29 -0
  10. package/dist/core/capability-analyzer.d.ts.map +1 -0
  11. package/dist/core/capability-analyzer.js +568 -0
  12. package/dist/core/capability-analyzer.js.map +1 -0
  13. package/dist/core/safeguard-manager.d.ts +15 -0
  14. package/dist/core/safeguard-manager.d.ts.map +1 -0
  15. package/dist/core/safeguard-manager.js +315 -0
  16. package/dist/core/safeguard-manager.js.map +1 -0
  17. package/dist/index.d.ts +29 -3
  18. package/dist/index.d.ts.map +1 -1
  19. package/dist/index.js +609 -403
  20. package/dist/index.js.map +1 -1
  21. package/dist/interfaces/http/http-server.d.ts +17 -0
  22. package/dist/interfaces/http/http-server.d.ts.map +1 -0
  23. package/dist/interfaces/http/http-server.js +285 -0
  24. package/dist/interfaces/http/http-server.js.map +1 -0
  25. package/dist/interfaces/mcp/mcp-server.d.ts +18 -0
  26. package/dist/interfaces/mcp/mcp-server.d.ts.map +1 -0
  27. package/dist/interfaces/mcp/mcp-server.js +299 -0
  28. package/dist/interfaces/mcp/mcp-server.js.map +1 -0
  29. package/dist/shared/types.d.ts +89 -0
  30. package/dist/shared/types.d.ts.map +1 -0
  31. package/dist/shared/types.js +3 -0
  32. package/dist/shared/types.js.map +1 -0
  33. package/package.json +17 -6
  34. package/src/core/capability-analyzer.ts +708 -0
  35. package/src/core/safeguard-manager.ts +339 -0
  36. package/src/index.ts +722 -461
  37. package/src/interfaces/http/http-server.ts +360 -0
  38. package/src/interfaces/mcp/mcp-server.ts +367 -0
  39. package/src/shared/types.ts +104 -0
  40. package/test_capability_integration.js +73 -0
  41. package/test_comprehensive_scenarios.js +192 -0
  42. package/test_enhanced_detection.js +74 -0
  43. package/test_integrated_validation.js +112 -0
  44. package/test_language_update.js +101 -0
  45. package/test_live_validation.json +12 -0
  46. package/test_performance_monitoring.js +124 -0
  47. package/test_runner_automated.js +156 -0
  48. package/test_suite_comprehensive.js +218 -0
@@ -0,0 +1,17 @@
1
+ #!/usr/bin/env node
2
+ export declare class FrameworkHttpServer {
3
+ private app;
4
+ private capabilityAnalyzer;
5
+ private safeguardManager;
6
+ private port;
7
+ constructor(port?: number);
8
+ private setupMiddleware;
9
+ private setupRoutes;
10
+ private setupErrorHandling;
11
+ private validateInput;
12
+ private validateTextInput;
13
+ private validateCapability;
14
+ private createErrorResponse;
15
+ start(): void;
16
+ }
17
+ //# sourceMappingURL=http-server.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"http-server.d.ts","sourceRoot":"","sources":["../../../src/interfaces/http/http-server.ts"],"names":[],"mappings":";AAeA,qBAAa,mBAAmB;IAC9B,OAAO,CAAC,GAAG,CAAsB;IACjC,OAAO,CAAC,kBAAkB,CAAqB;IAC/C,OAAO,CAAC,gBAAgB,CAAmB;IAC3C,OAAO,CAAC,IAAI,CAAS;gBAET,IAAI,GAAE,MAAa;IAW/B,OAAO,CAAC,eAAe;IAmCvB,OAAO,CAAC,WAAW;IAyMnB,OAAO,CAAC,kBAAkB;IAsB1B,OAAO,CAAC,aAAa;IAYrB,OAAO,CAAC,iBAAiB;IAczB,OAAO,CAAC,kBAAkB;IAQ1B,OAAO,CAAC,mBAAmB;IAQpB,KAAK,IAAI,IAAI;CAoBrB"}
@@ -0,0 +1,285 @@
1
+ #!/usr/bin/env node
2
+ import express from 'express';
3
+ import cors from 'cors';
4
+ import helmet from 'helmet';
5
+ import compression from 'compression';
6
+ import { CapabilityAnalyzer } from '../../core/capability-analyzer.js';
7
+ import { SafeguardManager } from '../../core/safeguard-manager.js';
8
+ export class FrameworkHttpServer {
9
+ constructor(port = 8080) {
10
+ this.app = express();
11
+ this.capabilityAnalyzer = new CapabilityAnalyzer();
12
+ this.safeguardManager = new SafeguardManager();
13
+ this.port = port;
14
+ this.setupMiddleware();
15
+ this.setupRoutes();
16
+ this.setupErrorHandling();
17
+ }
18
+ setupMiddleware() {
19
+ // Security middleware
20
+ this.app.use(helmet({
21
+ contentSecurityPolicy: {
22
+ directives: {
23
+ defaultSrc: ["'self'"],
24
+ styleSrc: ["'self'", "'unsafe-inline'"],
25
+ scriptSrc: ["'self'"],
26
+ imgSrc: ["'self'", "data:", "https:"],
27
+ },
28
+ },
29
+ }));
30
+ // CORS configuration
31
+ this.app.use(cors({
32
+ origin: process.env.ALLOWED_ORIGINS?.split(',') || ['http://localhost:3000'],
33
+ methods: ['GET', 'POST', 'OPTIONS'],
34
+ allowedHeaders: ['Content-Type', 'Authorization', 'X-Requested-With'],
35
+ credentials: true
36
+ }));
37
+ // Compression and parsing
38
+ this.app.use(compression());
39
+ this.app.use(express.json({ limit: '10mb' }));
40
+ this.app.use(express.urlencoded({ extended: true, limit: '10mb' }));
41
+ // Request logging in production
42
+ if (process.env.NODE_ENV === 'production') {
43
+ this.app.use((req, res, next) => {
44
+ console.log(`[${new Date().toISOString()}] ${req.method} ${req.path}`);
45
+ next();
46
+ });
47
+ }
48
+ }
49
+ setupRoutes() {
50
+ // Health check endpoint (required for DigitalOcean App Services)
51
+ this.app.get('/health', (req, res) => {
52
+ const metrics = this.capabilityAnalyzer.getPerformanceMetrics();
53
+ res.json({
54
+ status: 'healthy',
55
+ uptime: Math.round((Date.now() - metrics.uptime) / 1000),
56
+ totalRequests: metrics.totalRequests,
57
+ errorCount: metrics.errorCount,
58
+ version: '1.2.0',
59
+ timestamp: new Date().toISOString()
60
+ });
61
+ });
62
+ // Primary validation endpoint
63
+ this.app.post('/api/validate-vendor-mapping', async (req, res) => {
64
+ try {
65
+ const { vendor_name, safeguard_id, claimed_capability, supporting_text } = req.body;
66
+ // Input validation
67
+ this.validateInput(req.body, [
68
+ 'vendor_name',
69
+ 'safeguard_id',
70
+ 'claimed_capability',
71
+ 'supporting_text'
72
+ ]);
73
+ this.validateTextInput(supporting_text, 'Supporting text');
74
+ this.validateCapability(claimed_capability);
75
+ this.safeguardManager.validateSafeguardId(safeguard_id);
76
+ const safeguard = this.safeguardManager.getSafeguardDetails(safeguard_id);
77
+ if (!safeguard) {
78
+ return res.status(404).json(this.createErrorResponse('Safeguard not found'));
79
+ }
80
+ const result = this.capabilityAnalyzer.validateVendorMapping(vendor_name, safeguard_id, claimed_capability, supporting_text, safeguard);
81
+ res.json(result);
82
+ }
83
+ catch (error) {
84
+ console.error('[HTTP Server] validate-vendor-mapping error:', error);
85
+ res.status(400).json(this.createErrorResponse(error instanceof Error ? error.message : 'Unknown error'));
86
+ }
87
+ });
88
+ // Capability analysis endpoint
89
+ this.app.post('/api/analyze-vendor-response', async (req, res) => {
90
+ try {
91
+ const { vendor_name, safeguard_id, response_text } = req.body;
92
+ this.validateInput(req.body, ['vendor_name', 'safeguard_id', 'response_text']);
93
+ this.validateTextInput(response_text, 'Response text');
94
+ this.safeguardManager.validateSafeguardId(safeguard_id);
95
+ const safeguard = this.safeguardManager.getSafeguardDetails(safeguard_id);
96
+ if (!safeguard) {
97
+ return res.status(404).json(this.createErrorResponse('Safeguard not found'));
98
+ }
99
+ const result = this.capabilityAnalyzer.performCapabilityAnalysis(vendor_name, safeguard, response_text);
100
+ res.json(result);
101
+ }
102
+ catch (error) {
103
+ console.error('[HTTP Server] analyze-vendor-response error:', error);
104
+ res.status(400).json(this.createErrorResponse(error instanceof Error ? error.message : 'Unknown error'));
105
+ }
106
+ });
107
+ // Coverage claim validation endpoint
108
+ this.app.post('/api/validate-coverage-claim', async (req, res) => {
109
+ try {
110
+ const { vendor_name, safeguard_id, claimed_capability, response_text } = req.body;
111
+ this.validateInput(req.body, ['vendor_name', 'safeguard_id', 'claimed_capability', 'response_text']);
112
+ this.validateTextInput(response_text, 'Response text');
113
+ this.validateCapability(claimed_capability);
114
+ this.safeguardManager.validateSafeguardId(safeguard_id);
115
+ const safeguard = this.safeguardManager.getSafeguardDetails(safeguard_id);
116
+ if (!safeguard) {
117
+ return res.status(404).json(this.createErrorResponse('Safeguard not found'));
118
+ }
119
+ // Use the primary validation method for coverage claims
120
+ const result = this.capabilityAnalyzer.validateVendorMapping(vendor_name, safeguard_id, claimed_capability, response_text, safeguard);
121
+ res.json(result);
122
+ }
123
+ catch (error) {
124
+ console.error('[HTTP Server] validate-coverage-claim error:', error);
125
+ res.status(400).json(this.createErrorResponse(error instanceof Error ? error.message : 'Unknown error'));
126
+ }
127
+ });
128
+ // Get safeguard details endpoint
129
+ this.app.get('/api/safeguards/:safeguardId', (req, res) => {
130
+ try {
131
+ const { safeguardId } = req.params;
132
+ const includeExamples = req.query.include_examples === 'true';
133
+ this.safeguardManager.validateSafeguardId(safeguardId);
134
+ const safeguard = this.safeguardManager.getSafeguardDetails(safeguardId, includeExamples);
135
+ if (!safeguard) {
136
+ return res.status(404).json(this.createErrorResponse('Safeguard not found'));
137
+ }
138
+ res.json(safeguard);
139
+ }
140
+ catch (error) {
141
+ console.error('[HTTP Server] get-safeguard-details error:', error);
142
+ res.status(400).json(this.createErrorResponse(error instanceof Error ? error.message : 'Unknown error'));
143
+ }
144
+ });
145
+ // List all safeguards endpoint
146
+ this.app.get('/api/safeguards', (req, res) => {
147
+ try {
148
+ const safeguards = this.safeguardManager.listAvailableSafeguards();
149
+ res.json({
150
+ safeguards,
151
+ total: safeguards.length,
152
+ framework: 'CIS Controls v8.1',
153
+ timestamp: new Date().toISOString()
154
+ });
155
+ }
156
+ catch (error) {
157
+ console.error('[HTTP Server] list-safeguards error:', error);
158
+ res.status(500).json(this.createErrorResponse('Internal server error'));
159
+ }
160
+ });
161
+ // Performance metrics endpoint
162
+ this.app.get('/api/metrics', (req, res) => {
163
+ try {
164
+ const metrics = this.capabilityAnalyzer.getPerformanceMetrics();
165
+ res.json({
166
+ uptime_seconds: Math.round((Date.now() - metrics.uptime) / 1000),
167
+ total_requests: metrics.totalRequests,
168
+ error_count: metrics.errorCount,
169
+ error_rate: metrics.totalRequests > 0 ?
170
+ ((metrics.errorCount / metrics.totalRequests) * 100).toFixed(2) + '%' : '0%',
171
+ request_counts: Object.fromEntries(metrics.requestCounts),
172
+ timestamp: new Date().toISOString()
173
+ });
174
+ }
175
+ catch (error) {
176
+ console.error('[HTTP Server] metrics error:', error);
177
+ res.status(500).json(this.createErrorResponse('Metrics unavailable'));
178
+ }
179
+ });
180
+ // API documentation endpoint
181
+ this.app.get('/api', (req, res) => {
182
+ res.json({
183
+ name: 'Framework MCP HTTP API',
184
+ version: '1.2.0',
185
+ description: 'Dual-architecture HTTP API for vendor capability assessment against CIS Controls Framework',
186
+ endpoints: {
187
+ 'POST /api/validate-vendor-mapping': 'Primary capability validation with domain validation',
188
+ 'POST /api/analyze-vendor-response': 'Capability role determination for vendor responses',
189
+ 'POST /api/validate-coverage-claim': 'Validate FULL/PARTIAL implementation claims',
190
+ 'GET /api/safeguards': 'List all available CIS safeguards',
191
+ 'GET /api/safeguards/:id': 'Get detailed safeguard breakdown',
192
+ 'GET /health': 'Health check endpoint',
193
+ 'GET /api/metrics': 'Performance metrics',
194
+ 'GET /api': 'This documentation'
195
+ },
196
+ capabilities: [
197
+ 'FULL - Complete implementation of safeguard',
198
+ 'PARTIAL - Limited scope implementation',
199
+ 'FACILITATES - Enhancement capabilities',
200
+ 'GOVERNANCE - Policy/process management',
201
+ 'VALIDATES - Evidence collection and reporting'
202
+ ],
203
+ domain_validation: 'Auto-downgrade protection for inappropriate capability claims',
204
+ framework: 'CIS Controls v8.1 (153 safeguards)',
205
+ deployment: 'DigitalOcean App Services compatible'
206
+ });
207
+ });
208
+ // Root endpoint redirect
209
+ this.app.get('/', (req, res) => {
210
+ res.redirect('/api');
211
+ });
212
+ }
213
+ setupErrorHandling() {
214
+ // 404 handler
215
+ this.app.use('*', (req, res) => {
216
+ res.status(404).json(this.createErrorResponse(`Endpoint not found: ${req.method} ${req.originalUrl}`, 'Use GET /api for available endpoints'));
217
+ });
218
+ // Global error handler
219
+ this.app.use((error, req, res, next) => {
220
+ console.error('[HTTP Server] Unhandled error:', error);
221
+ if (!res.headersSent) {
222
+ res.status(500).json(this.createErrorResponse('Internal server error', process.env.NODE_ENV === 'development' ? error.message : undefined));
223
+ }
224
+ });
225
+ }
226
+ validateInput(body, requiredFields) {
227
+ if (!body || typeof body !== 'object') {
228
+ throw new Error('Request body is required and must be valid JSON');
229
+ }
230
+ for (const field of requiredFields) {
231
+ if (!body[field] || typeof body[field] !== 'string') {
232
+ throw new Error(`Field '${field}' is required and must be a non-empty string`);
233
+ }
234
+ }
235
+ }
236
+ validateTextInput(text, fieldName) {
237
+ if (typeof text !== 'string') {
238
+ throw new Error(`${fieldName} must be a string`);
239
+ }
240
+ if (text.length < 10) {
241
+ throw new Error(`${fieldName} must be at least 10 characters long`);
242
+ }
243
+ if (text.length > 10000) {
244
+ throw new Error(`${fieldName} must be less than 10,000 characters`);
245
+ }
246
+ }
247
+ validateCapability(capability) {
248
+ const validCapabilities = ['full', 'partial', 'facilitates', 'governance', 'validates'];
249
+ if (!validCapabilities.includes(capability.toLowerCase())) {
250
+ throw new Error(`Invalid capability '${capability}'. Valid options: ${validCapabilities.join(', ')}`);
251
+ }
252
+ }
253
+ createErrorResponse(error, details) {
254
+ return {
255
+ error,
256
+ details,
257
+ timestamp: new Date().toISOString()
258
+ };
259
+ }
260
+ start() {
261
+ this.app.listen(this.port, '0.0.0.0', () => {
262
+ console.log(`🚀 Framework MCP HTTP Server v1.2.0 running on port ${this.port}`);
263
+ console.log(`📊 Health check: http://localhost:${this.port}/health`);
264
+ console.log(`📖 API docs: http://localhost:${this.port}/api`);
265
+ console.log(`🔧 Environment: ${process.env.NODE_ENV || 'development'}`);
266
+ console.log(`⚡ DigitalOcean App Services compatible`);
267
+ });
268
+ // Graceful shutdown handling
269
+ process.on('SIGTERM', () => {
270
+ console.log('🔄 Received SIGTERM, shutting down gracefully...');
271
+ process.exit(0);
272
+ });
273
+ process.on('SIGINT', () => {
274
+ console.log('🔄 Received SIGINT, shutting down gracefully...');
275
+ process.exit(0);
276
+ });
277
+ }
278
+ }
279
+ // Start server if this file is run directly
280
+ if (import.meta.url === `file://${process.argv[1]}`) {
281
+ const port = parseInt(process.env.PORT || '8080', 10);
282
+ const server = new FrameworkHttpServer(port);
283
+ server.start();
284
+ }
285
+ //# sourceMappingURL=http-server.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"http-server.js","sourceRoot":"","sources":["../../../src/interfaces/http/http-server.ts"],"names":[],"mappings":";AAEA,OAAO,OAAO,MAAM,SAAS,CAAC;AAC9B,OAAO,IAAI,MAAM,MAAM,CAAC;AACxB,OAAO,MAAM,MAAM,QAAQ,CAAC;AAC5B,OAAO,WAAW,MAAM,aAAa,CAAC;AACtC,OAAO,EAAE,kBAAkB,EAAE,MAAM,mCAAmC,CAAC;AACvE,OAAO,EAAE,gBAAgB,EAAE,MAAM,iCAAiC,CAAC;AAQnE,MAAM,OAAO,mBAAmB;IAM9B,YAAY,OAAe,IAAI;QAC7B,IAAI,CAAC,GAAG,GAAG,OAAO,EAAE,CAAC;QACrB,IAAI,CAAC,kBAAkB,GAAG,IAAI,kBAAkB,EAAE,CAAC;QACnD,IAAI,CAAC,gBAAgB,GAAG,IAAI,gBAAgB,EAAE,CAAC;QAC/C,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;QAEjB,IAAI,CAAC,eAAe,EAAE,CAAC;QACvB,IAAI,CAAC,WAAW,EAAE,CAAC;QACnB,IAAI,CAAC,kBAAkB,EAAE,CAAC;IAC5B,CAAC;IAEO,eAAe;QACrB,sBAAsB;QACtB,IAAI,CAAC,GAAG,CAAC,GAAG,CAAC,MAAM,CAAC;YAClB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,CAAC;CACF;AAED,4CAA4C;AAC5C,IAAI,MAAM,CAAC,IAAI,CAAC,GAAG,KAAK,UAAU,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC;IACpD,MAAM,IAAI,GAAG,QAAQ,CAAC,OAAO,CAAC,GAAG,CAAC,IAAI,IAAI,MAAM,EAAE,EAAE,CAAC,CAAC;IACtD,MAAM,MAAM,GAAG,IAAI,mBAAmB,CAAC,IAAI,CAAC,CAAC;IAC7C,MAAM,CAAC,KAAK,EAAE,CAAC;AACjB,CAAC"}
@@ -0,0 +1,18 @@
1
+ #!/usr/bin/env node
2
+ export declare class FrameworkMcpServer {
3
+ private server;
4
+ private capabilityAnalyzer;
5
+ private safeguardManager;
6
+ constructor();
7
+ private setupHandlers;
8
+ private validateVendorMapping;
9
+ private analyzeVendorResponse;
10
+ private validateCoverageClaim;
11
+ private getSafeguardDetails;
12
+ private listAvailableSafeguards;
13
+ private validateTextInput;
14
+ private validateCapability;
15
+ private formatErrorMessage;
16
+ run(): Promise<void>;
17
+ }
18
+ //# sourceMappingURL=mcp-server.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"mcp-server.d.ts","sourceRoot":"","sources":["../../../src/interfaces/mcp/mcp-server.ts"],"names":[],"mappings":";AAaA,qBAAa,kBAAkB;IAC7B,OAAO,CAAC,MAAM,CAAS;IACvB,OAAO,CAAC,kBAAkB,CAAqB;IAC/C,OAAO,CAAC,gBAAgB,CAAmB;;IAgB3C,OAAO,CAAC,aAAa;YA2JP,qBAAqB;YA+BrB,qBAAqB;YAuBrB,qBAAqB;YA+BrB,mBAAmB;YAoBnB,uBAAuB;IAkBrC,OAAO,CAAC,iBAAiB;IAczB,OAAO,CAAC,kBAAkB;IAQ1B,OAAO,CAAC,kBAAkB;IAqBb,GAAG,IAAI,OAAO,CAAC,IAAI,CAAC;CAOlC"}
@@ -0,0 +1,299 @@
1
+ #!/usr/bin/env node
2
+ import { Server } from '@modelcontextprotocol/sdk/server/index.js';
3
+ import { StdioServerTransport } from '@modelcontextprotocol/sdk/server/stdio.js';
4
+ import { CallToolRequestSchema, ListToolsRequestSchema, } from '@modelcontextprotocol/sdk/types.js';
5
+ import { CapabilityAnalyzer } from '../../core/capability-analyzer.js';
6
+ import { SafeguardManager } from '../../core/safeguard-manager.js';
7
+ export class FrameworkMcpServer {
8
+ constructor() {
9
+ this.server = new Server({
10
+ name: 'framework-analyzer',
11
+ version: '1.2.0',
12
+ });
13
+ this.capabilityAnalyzer = new CapabilityAnalyzer();
14
+ this.safeguardManager = new SafeguardManager();
15
+ this.setupHandlers();
16
+ }
17
+ setupHandlers() {
18
+ // List available tools
19
+ this.server.setRequestHandler(ListToolsRequestSchema, async () => {
20
+ return {
21
+ tools: [
22
+ {
23
+ name: 'validate_vendor_mapping',
24
+ description: 'PRIMARY: Validate vendor capability claims with domain validation and evidence analysis',
25
+ inputSchema: {
26
+ type: 'object',
27
+ properties: {
28
+ vendor_name: {
29
+ type: 'string',
30
+ description: 'Name of the vendor/tool being analyzed'
31
+ },
32
+ safeguard_id: {
33
+ type: 'string',
34
+ description: 'CIS safeguard ID (e.g., "1.1", "5.1")'
35
+ },
36
+ claimed_capability: {
37
+ type: 'string',
38
+ description: 'Claimed capability role',
39
+ enum: ['full', 'partial', 'facilitates', 'governance', 'validates']
40
+ },
41
+ supporting_text: {
42
+ type: 'string',
43
+ description: 'Vendor text supporting their capability claim'
44
+ }
45
+ },
46
+ required: ['vendor_name', 'safeguard_id', 'claimed_capability', 'supporting_text']
47
+ }
48
+ },
49
+ {
50
+ name: 'analyze_vendor_response',
51
+ description: 'Determine vendor tool capability role for specific safeguard',
52
+ inputSchema: {
53
+ type: 'object',
54
+ properties: {
55
+ vendor_name: {
56
+ type: 'string',
57
+ description: 'Name of the vendor'
58
+ },
59
+ safeguard_id: {
60
+ type: 'string',
61
+ description: 'CIS safeguard ID (e.g., "1.1", "5.1")'
62
+ },
63
+ response_text: {
64
+ type: 'string',
65
+ description: 'Vendor response text to analyze'
66
+ }
67
+ },
68
+ required: ['vendor_name', 'safeguard_id', 'response_text']
69
+ }
70
+ },
71
+ {
72
+ name: 'validate_coverage_claim',
73
+ description: 'Validate FULL/PARTIAL implementation capability claims',
74
+ inputSchema: {
75
+ type: 'object',
76
+ properties: {
77
+ vendor_name: {
78
+ type: 'string',
79
+ description: 'Name of the vendor'
80
+ },
81
+ safeguard_id: {
82
+ type: 'string',
83
+ description: 'CIS safeguard ID (e.g., "1.1", "5.1")'
84
+ },
85
+ claimed_capability: {
86
+ type: 'string',
87
+ description: 'Claimed capability (typically "full" or "partial")',
88
+ enum: ['full', 'partial', 'facilitates', 'governance', 'validates']
89
+ },
90
+ response_text: {
91
+ type: 'string',
92
+ description: 'Vendor response text supporting the claim'
93
+ }
94
+ },
95
+ required: ['vendor_name', 'safeguard_id', 'claimed_capability', 'response_text']
96
+ }
97
+ },
98
+ {
99
+ name: 'get_safeguard_details',
100
+ description: 'Get detailed safeguard breakdown',
101
+ inputSchema: {
102
+ type: 'object',
103
+ properties: {
104
+ safeguard_id: {
105
+ type: 'string',
106
+ description: 'CIS safeguard ID (e.g., "1.1", "5.1")'
107
+ },
108
+ include_examples: {
109
+ type: 'boolean',
110
+ description: 'Include implementation examples (default: false)'
111
+ }
112
+ },
113
+ required: ['safeguard_id']
114
+ }
115
+ },
116
+ {
117
+ name: 'list_available_safeguards',
118
+ description: 'List all available CIS safeguards',
119
+ inputSchema: {
120
+ type: 'object',
121
+ properties: {},
122
+ additionalProperties: false
123
+ }
124
+ },
125
+ ],
126
+ };
127
+ });
128
+ // Handle tool calls
129
+ this.server.setRequestHandler(CallToolRequestSchema, async (request) => {
130
+ const { name, arguments: args } = request.params;
131
+ try {
132
+ switch (name) {
133
+ case 'validate_vendor_mapping':
134
+ return await this.validateVendorMapping(args);
135
+ case 'analyze_vendor_response':
136
+ return await this.analyzeVendorResponse(args);
137
+ case 'validate_coverage_claim':
138
+ return await this.validateCoverageClaim(args);
139
+ case 'get_safeguard_details':
140
+ return await this.getSafeguardDetails(args);
141
+ case 'list_available_safeguards':
142
+ return await this.listAvailableSafeguards();
143
+ default:
144
+ throw new Error(`Unknown tool: ${name}`);
145
+ }
146
+ }
147
+ catch (error) {
148
+ const errorMessage = this.formatErrorMessage(error, name);
149
+ console.error(`[Framework MCP] Tool execution error: ${name}`, error);
150
+ return {
151
+ content: [
152
+ {
153
+ type: 'text',
154
+ text: JSON.stringify({
155
+ error: errorMessage,
156
+ timestamp: new Date().toISOString()
157
+ }, null, 2),
158
+ },
159
+ ],
160
+ };
161
+ }
162
+ });
163
+ }
164
+ async validateVendorMapping(args) {
165
+ const { vendor_name = 'Unknown Vendor', safeguard_id, claimed_capability, supporting_text } = args;
166
+ // Input validation
167
+ this.validateTextInput(supporting_text, 'Supporting text');
168
+ this.validateCapability(claimed_capability);
169
+ this.safeguardManager.validateSafeguardId(safeguard_id);
170
+ const safeguard = this.safeguardManager.getSafeguardDetails(safeguard_id);
171
+ if (!safeguard) {
172
+ throw new Error(`Safeguard ${safeguard_id} not found`);
173
+ }
174
+ const validation = this.capabilityAnalyzer.validateVendorMapping(vendor_name, safeguard_id, claimed_capability, supporting_text, safeguard);
175
+ return {
176
+ content: [
177
+ {
178
+ type: 'text',
179
+ text: JSON.stringify(validation, null, 2),
180
+ },
181
+ ],
182
+ };
183
+ }
184
+ async analyzeVendorResponse(args) {
185
+ const { vendor_name = 'Unknown Vendor', safeguard_id, response_text } = args;
186
+ this.validateTextInput(response_text, 'Response text');
187
+ this.safeguardManager.validateSafeguardId(safeguard_id);
188
+ const safeguard = this.safeguardManager.getSafeguardDetails(safeguard_id);
189
+ if (!safeguard) {
190
+ throw new Error(`Safeguard ${safeguard_id} not found`);
191
+ }
192
+ const analysis = this.capabilityAnalyzer.performCapabilityAnalysis(vendor_name, safeguard, response_text);
193
+ return {
194
+ content: [
195
+ {
196
+ type: 'text',
197
+ text: JSON.stringify(analysis, null, 2),
198
+ },
199
+ ],
200
+ };
201
+ }
202
+ async validateCoverageClaim(args) {
203
+ const { vendor_name = 'Unknown Vendor', safeguard_id, claimed_capability, response_text } = args;
204
+ this.validateTextInput(response_text, 'Response text');
205
+ this.validateCapability(claimed_capability);
206
+ this.safeguardManager.validateSafeguardId(safeguard_id);
207
+ const safeguard = this.safeguardManager.getSafeguardDetails(safeguard_id);
208
+ if (!safeguard) {
209
+ throw new Error(`Safeguard ${safeguard_id} not found`);
210
+ }
211
+ // Use the primary validation method for coverage claims
212
+ const validation = this.capabilityAnalyzer.validateVendorMapping(vendor_name, safeguard_id, claimed_capability, response_text, safeguard);
213
+ return {
214
+ content: [
215
+ {
216
+ type: 'text',
217
+ text: JSON.stringify(validation, null, 2),
218
+ },
219
+ ],
220
+ };
221
+ }
222
+ async getSafeguardDetails(args) {
223
+ const { safeguard_id, include_examples = false } = args;
224
+ this.safeguardManager.validateSafeguardId(safeguard_id);
225
+ const safeguard = this.safeguardManager.getSafeguardDetails(safeguard_id, include_examples);
226
+ if (!safeguard) {
227
+ throw new Error(`Safeguard ${safeguard_id} not found`);
228
+ }
229
+ return {
230
+ content: [
231
+ {
232
+ type: 'text',
233
+ text: JSON.stringify(safeguard, null, 2),
234
+ },
235
+ ],
236
+ };
237
+ }
238
+ async listAvailableSafeguards() {
239
+ const safeguards = this.safeguardManager.listAvailableSafeguards();
240
+ return {
241
+ content: [
242
+ {
243
+ type: 'text',
244
+ text: JSON.stringify({
245
+ safeguards,
246
+ total: safeguards.length,
247
+ framework: 'CIS Controls v8.1',
248
+ version: '1.2.0'
249
+ }, null, 2),
250
+ },
251
+ ],
252
+ };
253
+ }
254
+ validateTextInput(text, fieldName) {
255
+ if (typeof text !== 'string') {
256
+ throw new Error(`${fieldName} must be a string`);
257
+ }
258
+ if (text.length < 10) {
259
+ throw new Error(`${fieldName} must be at least 10 characters long`);
260
+ }
261
+ if (text.length > 10000) {
262
+ throw new Error(`${fieldName} must be less than 10,000 characters`);
263
+ }
264
+ }
265
+ validateCapability(capability) {
266
+ const validCapabilities = ['full', 'partial', 'facilitates', 'governance', 'validates'];
267
+ if (!validCapabilities.includes(capability.toLowerCase())) {
268
+ throw new Error(`Invalid capability '${capability}'. Valid options: ${validCapabilities.join(', ')}`);
269
+ }
270
+ }
271
+ formatErrorMessage(error, toolName) {
272
+ if (error instanceof Error) {
273
+ // Provide helpful guidance for common errors
274
+ if (error.message.includes('Safeguard') && error.message.includes('not found')) {
275
+ return `${error.message}. Use list_available_safeguards to see all available options.`;
276
+ }
277
+ if (error.message.includes('Invalid capability')) {
278
+ return `${error.message}. Capability roles determine what function the vendor tool plays in safeguard implementation.`;
279
+ }
280
+ if (error.message.includes('characters')) {
281
+ return `${error.message}. Ensure your input text is substantive enough for analysis.`;
282
+ }
283
+ return error.message;
284
+ }
285
+ return `Unknown error in tool ${toolName}`;
286
+ }
287
+ async run() {
288
+ const transport = new StdioServerTransport();
289
+ await this.server.connect(transport);
290
+ console.error('🤖 Framework MCP Server v1.2.0 running via stdio');
291
+ console.error('📊 Capability assessment with domain validation enabled');
292
+ }
293
+ }
294
+ // Start server if this file is run directly
295
+ if (import.meta.url === `file://${process.argv[1]}`) {
296
+ const server = new FrameworkMcpServer();
297
+ server.run().catch(console.error);
298
+ }
299
+ //# sourceMappingURL=mcp-server.js.map