Skip to main content
Glama

Plausible MCP Server

by AVIMBU
const PLAUSIBLE_API_URL = process.env.PLAUSIBLE_API_URL || "https://plausible.io/api/v2"; const PLAUSIBLE_API_KEY = process.env.PLAUSIBLE_API_KEY; if (!PLAUSIBLE_API_KEY) { throw new Error("PLAUSIBLE_API_KEY environment variable is required"); } class PlausibleClient { async query(siteId: string, metrics: string[], dateRange: string) { const response = await fetch(`${PLAUSIBLE_API_URL}/query`, { method: "POST", headers: { Authorization: `Bearer ${PLAUSIBLE_API_KEY}`, "Content-Type": "application/json", }, body: JSON.stringify({ site_id: siteId, metrics: metrics, date_range: dateRange, }), }); if (!response.ok) { throw new Error(`Plausible API error: ${response.statusText}`); } return response.json(); } } export const plausibleClient = new PlausibleClient();

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/AVIMBU/plausible-mcp-server'

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