import { ResourceHandler, ResourceContent, ServerInfo } from '../types/index.js';
export class ServerInfoResource implements ResourceHandler {
constructor(private serverInfo: ServerInfo) {}
async read(uri: string): Promise<ResourceContent> {
return {
uri,
mimeType: 'text/plain',
text: `Simple MCP Server v${this.serverInfo.version}\n\nThis is a basic MCP server implementation that demonstrates:\n- Tool handling (echo, add_numbers, get_current_time)\n- Resource serving\n- Basic MCP protocol compliance`,
};
}
}
export class GreetingResource implements ResourceHandler {
async read(uri: string): Promise<ResourceContent> {
return {
uri,
mimeType: 'text/plain',
text: 'Hello from the Simple MCP Server! 👋\n\nThis server provides basic tools and resources for demonstration purposes.',
};
}
}