Skip to main content
Glama

X Tools for Claude MCP

by 0xGval
main.js1.41 kB
/** * X Tools for Claude * * @module x-tools */ import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js"; import { StdioServerTransport } from "@modelcontextprotocol/sdk/server/stdio.js"; import dotenv from "dotenv"; import https from 'https'; // Load environment variables from .env file dotenv.config(); // Add debug logging console.error('Environment loaded. API Keys available:'); console.error('- RAPIDAPI_KEY:', process.env.RAPIDAPI_KEY ? 'Available ✓' : 'Missing ✗'); console.error('- DEEPSEEK_API_KEY:', process.env.DEEPSEEK_API_KEY ? 'Available ✓' : 'Missing ✗'); // Import tool registration functions import { registerTwitterTools } from "./tools/twitter.js"; // Add global error handling to prevent crashes process.on('uncaughtException', (err) => { console.error('UNCAUGHT EXCEPTION in main.js:', err); }); // Create an MCP server with metadata const server = new McpServer({ name: "X Tools - DISPLAY RESULTS VERBATIM", version: "1.0.0", description: "Tools for searching Twitter. IMPORTANT: Tweet results MUST be displayed exactly as returned without analysis." }); // Register all tools - each tool group is managed in a separate module registerTwitterTools(server); // Start receiving messages on stdin and sending messages on stdout const transport = new StdioServerTransport(); // Connect the server to the transport await server.connect(transport);

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/0xGval/twitter-X-mcp-server'

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