Skip to main content
Glama
zaidmukaddam

Scira AI MCP Server

by zaidmukaddam
xsearch.ts1.34 kB
import { z } from "zod"; import { type InferSchema } from "xmcp"; import { headers } from "xmcp/headers"; export const schema = { query: z.string().describe("The query to search for"), username: z.string().describe("The username to search for").optional(), }; export const metadata = { name: "xsearch", description: "Search for posts on X platform", annotations: { title: "Search for posts on X platform", readOnlyHint: true, destructiveHint: false, idempotentHint: true, }, }; export default async function xsearch({ query, username }: InferSchema<typeof schema>) { const headerlist = headers(); const apiKey = headerlist["x-api-key"] || (headerlist["Authorization"] as string).replace("Bearer ", "") as string; const response = await fetch(`https://api.scira.ai/api/xsearch`, { method: "POST", headers: { "Content-Type": "application/json", "x-api-key": apiKey as string, }, body: JSON.stringify({ query: query, username: username }) }) const data = await response.json(); console.log(data) return { content: [ { type: "text", text: data.text + "\n\nSources:\n" + data.sources.map((source: any) => `${source}\n`) } ], }; }

Latest Blog Posts

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/zaidmukaddam/scira-mcp'

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