npmplus-mcp-server
Version:
Production-ready MCP server for intelligent JavaScript package management. Works with Claude, Windsurf, Cursor, VS Code, and any MCP-compatible AI editor.
64 lines • 1.49 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.createSuccessResponse = createSuccessResponse;
exports.createErrorResponse = createErrorResponse;
exports.createInfoResponse = createInfoResponse;
exports.createWarningResponse = createWarningResponse;
/**
* Creates a successful MCP response with formatted text
*/
function createSuccessResponse(text) {
return {
content: [
{
type: 'text',
text
}
]
};
}
/**
* Creates an error MCP response with formatted error message
*/
function createErrorResponse(error, context) {
const errorMessage = error instanceof Error ? error.message : error;
const text = context
? `❌ ${context}: ${errorMessage}`
: `❌ ${errorMessage}`;
return {
content: [
{
type: 'text',
text
}
],
isError: true
};
}
/**
* Creates a formatted info response
*/
function createInfoResponse(title, content) {
return {
content: [
{
type: 'text',
text: `ℹ️ ${title}\n\n${content}`
}
]
};
}
/**
* Creates a warning response
*/
function createWarningResponse(warning) {
return {
content: [
{
type: 'text',
text: `⚠️ ${warning}`
}
]
};
}
//# sourceMappingURL=response.js.map