Skip to main content
Glama

MarketAuxMcpServer

by Zolo-Ryan
server.ts1.63 kB
import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js"; import { StdioServerTransport } from "@modelcontextprotocol/sdk/server/stdio.js"; import { SearchAllNewsTool } from "./tools/SearchAllNewsTool.js"; export class MarketMcpServer { private server: McpServer; private all_news_api: string; private similar_news_api: string; private SearchAllNewsTool: SearchAllNewsTool; constructor(private marketaux_api_key: string) { this.all_news_api = `https://api.marketaux.com/v1/news/all?api_token=${marketaux_api_key}&`; this.similar_news_api = `https://api.marketaux.com/v1/news/similar?api_token=${marketaux_api_key}&`; this.server = new McpServer({ name: "News Mcp server", version: "0.0.1", capabilities: { resources: {}, tools: {}, }, }); this.SearchAllNewsTool = new SearchAllNewsTool(this.all_news_api, this.similar_news_api); this.setupTools(); } private setupTools(): void { this.server.tool( this.SearchAllNewsTool.name, this.SearchAllNewsTool.description, this.SearchAllNewsTool.inputSchema.shape, // Remove .shape async (input) => { return await this.SearchAllNewsTool.executeSearchAll(input); // Proper binding } ); } public async start() { const transport = new StdioServerTransport(); await this.server.connect(transport); console.error("MarketAux MCP Server running on stdio"); } public log( message: string, level: "error" | "debug" | "info" | "warning" ): void { this.server.server.sendLoggingMessage({ level, message, }); } }

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/Zolo-Ryan/MarketAuxMcpServer'

If you have feedback or need assistance with the MCP directory API, please join our Discord server