UNPKG

dataforseo-mcp-server

Version:

A Model Context Protocol (MCP) server for the DataForSEO API, enabling modular and extensible integration of DataForSEO endpoints with support for both HTTP and SSE transports.

36 lines (35 loc) 1.25 kB
import { BaseModule } from '../base.module.js'; import { onpagePrompts } from './onpage.prompt.js'; import { ContentParsingTool } from './tools/content-parsing.tool.js'; import { InstantPagesTool } from './tools/instant-pages.tool.js'; import { LighthouseTool } from './tools/lighthouse.tool.js'; export class OnPageApiModule extends BaseModule { getTools() { const tools = [ new ContentParsingTool(this.dataForSEOClient), new InstantPagesTool(this.dataForSEOClient), new LighthouseTool(this.dataForSEOClient), // Add more tools here ]; return tools.reduce((acc, tool) => ({ ...acc, [tool.getName()]: { description: tool.getDescription(), params: tool.getParams(), handler: (params) => tool.handle(params), }, }), {}); } getPrompts() { return onpagePrompts.reduce((acc, prompt) => ({ ...acc, [prompt.name]: { description: prompt.description, params: prompt.params, handler: (params) => { return prompt.handler(params); }, }, }), {}); } }