bottlenecks-mcp-server
Version:
Model Context Protocol server for Bottlenecks database - enables AI agents like Claude to interact with bottleneck data
134 lines • 4.97 kB
JavaScript
/**
* MCP Tools Registry
* Exports all MCP tools for the Bottlenecks server
*/
import { MCPOAuthClient } from '../auth/oauth-client.js';
// Import all tool creators
import { createAgentsStartHereTool, createGetCapabilitiesTool, } from './discovery.js';
import { createGetBottleneckSchemaTool, createGetTaxonomyTool, } from './schema.js';
import { createGetBottleneckTemplateTool } from './templates.js';
import { createSearchBottlenecksTool, createGetBottleneckTool, createListBottlenecksTool, } from './read-operations.js';
import { createListUnapprovedBottlenecksTool } from './admin-operations.js';
import { createCreateBottleneckTool, createUpdateBottleneckTool, createValidateBottleneckDataTool, } from './crud-operations.js';
import { createUploadFileTool, createGetFileAttachmentsTool, createGetFileContentTool, createDownloadFileTool, createDeleteFileTool, } from './file-operations.js';
import { createGetCardValidationTool, createBulkValidationTool, createGetValidationStatsTool, createFindCardsNeedingValidationTool, } from './validation-operations.js';
/**
* Create all MCP tools with the given configuration
*/
export function createMCPTools(config, apiKey) {
const client = new MCPOAuthClient(config, apiKey);
return [
// Discovery Tools (2)
createAgentsStartHereTool(client),
createGetCapabilitiesTool(client),
// Schema & Template Tools (3)
createGetBottleneckSchemaTool(client),
createGetTaxonomyTool(client),
createGetBottleneckTemplateTool(client),
// Read Operations (3)
createSearchBottlenecksTool(client),
createGetBottleneckTool(client),
createListBottlenecksTool(client),
createListUnapprovedBottlenecksTool(client),
// CRUD Operations (3)
createCreateBottleneckTool(client),
createUpdateBottleneckTool(client),
createValidateBottleneckDataTool(client),
// File Operations (5)
createUploadFileTool(client),
createGetFileAttachmentsTool(client),
createGetFileContentTool(client),
createDownloadFileTool(client),
createDeleteFileTool(client),
// Validation Operations (4)
createGetCardValidationTool(client),
createBulkValidationTool(client),
createGetValidationStatsTool(client),
createFindCardsNeedingValidationTool(client),
];
}
/**
* Get tool definitions for MCP server registration
*/
export function getToolDefinitions() {
// Create a temporary client to get tool definitions
const tempConfig = {
apiBaseUrl: 'http://localhost:3000',
supabaseUrl: 'temp',
supabaseKey: 'temp',
};
const tools = createMCPTools(tempConfig);
return tools.map((tool) => ({
name: tool.name,
description: tool.description,
inputSchema: tool.inputSchema,
}));
}
/**
* Tool categories for organization
*/
export const TOOL_CATEGORIES = {
discovery: ['agents_start_here', 'get_capabilities'],
schema: ['get_bottleneck_schema', 'get_taxonomy', 'get_bottleneck_template'],
read: [
'search_bottlenecks',
'get_bottleneck',
'list_bottlenecks',
'list_unapproved_bottlenecks',
],
write: ['create_bottleneck', 'update_bottleneck', 'validate_bottleneck_data'],
files: [
'upload_file',
'get_file_attachments',
'get_file_content',
'download_file',
'delete_file',
],
};
/**
* Get tools by category
*/
export function getToolsByCategory(category, config, apiKey) {
const allTools = createMCPTools(config, apiKey);
const categoryTools = TOOL_CATEGORIES[category];
return allTools.filter((tool) => categoryTools.includes(tool.name));
}
/**
* Tool usage examples for documentation
*/
export const TOOL_EXAMPLES = {
agents_start_here: {
description: 'Get started with the Bottlenecks MCP server',
example: {
include_examples: true,
focus_area: 'workflow',
},
},
search_bottlenecks: {
description: 'Search for performance bottlenecks',
example: {
query: 'database performance',
tags: ['performance', 'database'],
limit: 10,
},
},
create_bottleneck: {
description: 'Create a new bottleneck entry',
example: {
title: 'Database Query Performance Issue',
description: '::: section details\nOur main search query is taking 2+ seconds during peak hours...\n',
tags: ['performance', 'database', 'high-impact'],
is_public: false,
},
},
get_file_attachments: {
description: 'Get files attached to a bottleneck',
example: {
card_id: '123e4567-e89b-12d3-a456-426614174000',
file_types: ['pdf', 'csv'],
include_metadata: true,
},
},
};
export default createMCPTools;
//# sourceMappingURL=index.js.map