@zhanglc77/bitbucket-mcp-server
Version:
MCP server for Bitbucket API integration - supports both Cloud and Server
32 lines • 973 B
JavaScript
import { RESOURCE_DEFINITIONS, RESOURCE_TEMPLATES, generateResourceContent } from '../resources/resource-definitions.js';
export class ResourceHandlers {
async listResources() {
return {
resources: RESOURCE_DEFINITIONS,
resourceTemplates: RESOURCE_TEMPLATES
};
}
async readResource(uri) {
const content = await generateResourceContent(uri);
return {
contents: [{
type: 'text',
text: content
}]
};
}
parseResourceUri(uri) {
const match = uri.match(/^([^:]+):\/\/([^\/]+)\/([^\/]+)(?:\/(.+))?$/);
if (!match) {
throw new Error('Invalid resource URI format');
}
const [, scheme, domain, category, resource] = match;
return {
scheme,
domain,
category,
resource
};
}
}
//# sourceMappingURL=resource-handlers.js.map