Skip to main content
Glama

Shortcut MCP Server

Official
by useshortcut
search.ts1.19 kB
import type { MemberInfo } from "@shortcut/client"; const keyRenames = { name: "title" } as const; const mapKeyName = (key: string) => { const lowercaseKey = key.toLowerCase(); return keyRenames[lowercaseKey as keyof typeof keyRenames] || lowercaseKey; }; const getKey = (prop: string) => { if (prop.startsWith("is")) return `is:${mapKeyName(prop.slice(2))}`; if (prop.startsWith("has")) return `has:${mapKeyName(prop.slice(3))}`; return mapKeyName(prop); }; export type QueryParams = { [key: string]: boolean | string | number }; export const buildSearchQuery = async (params: QueryParams, currentUser: MemberInfo | null) => { const query = Object.entries(params) .map(([key, value]) => { const q = getKey(key); if (key === "owner" || key === "requester") { if (value === "me") return `${q}:${currentUser?.mention_name || value}`; return `${q}:${String(value || "").replace(/^@/, "")}`; } if (typeof value === "boolean") return value ? q : `!${q}`; if (typeof value === "number") return `${q}:${value}`; if (typeof value === "string" && value.includes(" ")) return `${q}:"${value}"`; return `${q}:${value}`; }) .join(" "); return query; };

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/useshortcut/mcp-server-shortcut'

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