Provides 8 MCP tools for Confluence Cloud: - confluence_list_spaces, confluence_create_space - confluence_search, confluence_get_page - confluence_create_page, confluence_update_page - confluence_get_comments, confluence_add_comment Uses Confluence REST API v2 with basic auth. Registered in Claude Code and mcp-proxy. Refs: CF-935 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
93 lines
2.9 KiB
JavaScript
93 lines
2.9 KiB
JavaScript
"use strict";
|
|
/**
|
|
* Experimental server task features for MCP SDK.
|
|
* WARNING: These APIs are experimental and may change without notice.
|
|
*
|
|
* @experimental
|
|
*/
|
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
exports.ExperimentalServerTasks = void 0;
|
|
/**
|
|
* Experimental task features for low-level MCP servers.
|
|
*
|
|
* Access via `server.experimental.tasks`:
|
|
* ```typescript
|
|
* const stream = server.experimental.tasks.requestStream(request, schema, options);
|
|
* ```
|
|
*
|
|
* For high-level server usage with task-based tools, use `McpServer.experimental.tasks` instead.
|
|
*
|
|
* @experimental
|
|
*/
|
|
class ExperimentalServerTasks {
|
|
constructor(_server) {
|
|
this._server = _server;
|
|
}
|
|
/**
|
|
* Sends a request and returns an AsyncGenerator that yields response messages.
|
|
* The generator is guaranteed to end with either a 'result' or 'error' message.
|
|
*
|
|
* This method provides streaming access to request processing, allowing you to
|
|
* observe intermediate task status updates for task-augmented requests.
|
|
*
|
|
* @param request - The request to send
|
|
* @param resultSchema - Zod schema for validating the result
|
|
* @param options - Optional request options (timeout, signal, task creation params, etc.)
|
|
* @returns AsyncGenerator that yields ResponseMessage objects
|
|
*
|
|
* @experimental
|
|
*/
|
|
requestStream(request, resultSchema, options) {
|
|
return this._server.requestStream(request, resultSchema, options);
|
|
}
|
|
/**
|
|
* Gets the current status of a task.
|
|
*
|
|
* @param taskId - The task identifier
|
|
* @param options - Optional request options
|
|
* @returns The task status
|
|
*
|
|
* @experimental
|
|
*/
|
|
async getTask(taskId, options) {
|
|
return this._server.getTask({ taskId }, options);
|
|
}
|
|
/**
|
|
* Retrieves the result of a completed task.
|
|
*
|
|
* @param taskId - The task identifier
|
|
* @param resultSchema - Zod schema for validating the result
|
|
* @param options - Optional request options
|
|
* @returns The task result
|
|
*
|
|
* @experimental
|
|
*/
|
|
async getTaskResult(taskId, resultSchema, options) {
|
|
return this._server.getTaskResult({ taskId }, resultSchema, options);
|
|
}
|
|
/**
|
|
* Lists tasks with optional pagination.
|
|
*
|
|
* @param cursor - Optional pagination cursor
|
|
* @param options - Optional request options
|
|
* @returns List of tasks with optional next cursor
|
|
*
|
|
* @experimental
|
|
*/
|
|
async listTasks(cursor, options) {
|
|
return this._server.listTasks(cursor ? { cursor } : undefined, options);
|
|
}
|
|
/**
|
|
* Cancels a running task.
|
|
*
|
|
* @param taskId - The task identifier
|
|
* @param options - Optional request options
|
|
*
|
|
* @experimental
|
|
*/
|
|
async cancelTask(taskId, options) {
|
|
return this._server.cancelTask({ taskId }, options);
|
|
}
|
|
}
|
|
exports.ExperimentalServerTasks = ExperimentalServerTasks;
|
|
//# sourceMappingURL=server.js.map
|