@antv/mcp-server-chart
Version:
A Model Context Protocol server for generating charts using AntV. This is a TypeScript-based MCP server that provides chart generation capabilities. It allows you to create various types of charts through MCP tools.
36 lines (35 loc) • 1.47 kB
TypeScript
/**
* This is a copy of the InMemoryEventStore from the typescript-sdk.
* reference: https://github.com/modelcontextprotocol/typescript-sdk/blob/main/src/examples/shared/inMemoryEventStore.ts
*/
import type { EventStore } from "@modelcontextprotocol/sdk/server/streamableHttp.js";
import type { JSONRPCMessage } from "@modelcontextprotocol/sdk/types.js";
/**
* Simple in-memory implementation of the EventStore interface for resumability.
* This is primarily intended for examples and testing, not for production use.
* where a persistent storage solution would be more appropriate.
* see more details: https://modelcontextprotocol.io/specification/2025-03-26/basic/transports#resumability-and-redelivery.
*/
export declare class InMemoryEventStore implements EventStore {
private events;
/**
* Generates a unique event ID for a given stream ID
*/
private generateEventId;
/**
* Extracts the stream ID from an event ID
*/
private getStreamIdFromEventId;
/**
* Stores an event with a generated event ID
* Implements EventStore.storeEvent
*/
storeEvent(streamId: string, message: JSONRPCMessage): Promise<string>;
/**
* Replays events that occurred after a specific event ID
* Implements EventStore.replayEventsAfter
*/
replayEventsAfter(lastEventId: string, { send, }: {
send: (eventId: string, message: JSONRPCMessage) => Promise<void>;
}): Promise<string>;
}