random-tables-mcp
Version:
An MCP (Model Context Protocol) server for managing and rolling on random-table assets used in tabletop RPGs. Create, update, and roll on random tables with support for nested tables, weighted entries, and range-based results.
43 lines (42 loc) • 1.3 kB
TypeScript
import { RollService, TableService, RollTemplateService } from '../../../ports/index.js';
/**
* MCP Server implementation for Random Tables.
*/
export declare class McpServer {
private readonly tableService;
private readonly rollService;
private readonly templateService;
private server;
private tools;
private resources;
/**
* Creates a new McpServer instance.
* @param tableService The table service to use.
* @param rollService The roll service to use.
* @param templateService The roll template service to use.
*/
constructor(tableService: TableService, rollService: RollService, templateService: RollTemplateService);
/**
* Initializes the server by registering tools and resources.
*/
initialize(): void;
/**
* Registers tools with the server.
*/
private registerTools;
/**
* Registers resources with the server.
*/
private registerResources;
/**
* Matches a URI against a pattern and extracts parameters.
* @param uri The URI to match.
* @param pattern The pattern to match against.
* @returns An object with extracted parameters, or null if no match.
*/
private matchUriPattern;
/**
* Starts the server.
*/
start(): Promise<void>;
}