Getting Started
Installation
Install Metrifyr MCP server in your preferred client
Installation
Metrifyr MCP server works with any MCP-compatible client. This guide covers the most popular options.
Prerequisites
- Node.js 18 or later
- A Metrifyr API key (get one here)
Claude Desktop
The official Claude desktop app from Anthropic.
macOS
- Open Claude Desktop config:
code ~/Library/Application\ Support/Claude/claude_desktop_config.json- Add Metrifyr to
mcpServers:
{
"mcpServers": {
"metrifyr": {
"command": "npx",
"args": ["-y", "@metrifyr/mcp-server@latest"],
"env": {
"METRIFYR_API_KEY": "your-api-key-here"
}
}
}
}- Restart Claude Desktop
Windows
- Open config file:
notepad %APPDATA%\Claude\claude_desktop_config.json- Add the same configuration as macOS
- Restart Claude Desktop
Linux
- Open config file:
nano ~/.config/Claude/claude_desktop_config.json- Add the same configuration
- Restart Claude Desktop
Cursor IDE
Cursor supports MCP through the Cline extension.
- Install Cline extension in Cursor
- Open Cline MCP settings (Cmd/Ctrl + Shift + P → "Cline: Open MCP Settings")
- Add Metrifyr configuration:
{
"mcpServers": {
"metrifyr": {
"command": "npx",
"args": ["-y", "@metrifyr/mcp-server@latest"],
"env": {
"METRIFYR_API_KEY": "your-api-key-here"
}
}
}
}- Reload Cursor
VS Code (Cline Extension)
Same as Cursor - install Cline extension and configure MCP settings.
Zed Editor
- Open Zed settings (Cmd/Ctrl + ,)
- Add to your
settings.json:
{
"context_servers": {
"metrifyr": {
"command": {
"path": "npx",
"args": ["-y", "@metrifyr/mcp-server@latest"],
"env": {
"METRIFYR_API_KEY": "your-api-key-here"
}
}
}
}
}- Restart Zed
Custom MCP Client
If you're building your own MCP client or using a different tool:
import { Client } from '@modelcontextprotocol/sdk/client/index.js';
import { StdioClientTransport } from '@modelcontextprotocol/sdk/client/stdio.js';
const transport = new StdioClientTransport({
command: 'npx',
args: ['-y', '@metrifyr/mcp-server@latest'],
env: {
METRIFYR_API_KEY: process.env.METRIFYR_API_KEY,
},
});
const client = new Client(
{
name: 'my-client',
version: '1.0.0',
},
{
capabilities: {
tools: {},
},
}
);
await client.connect(transport);Environment Variables
You can configure the MCP server using environment variables:
| Variable | Required | Description |
|---|---|---|
METRIFYR_API_KEY | Yes | Your Metrifyr API key |
METRIFYR_BASE_URL | No | Custom API base URL (default: https://metrifyr.cloud) |
LOG_LEVEL | No | Logging level: debug, info, warn, error (default: info) |
Example with custom base URL:
{
"mcpServers": {
"metrifyr": {
"command": "npx",
"args": ["-y", "@metrifyr/mcp-server@latest"],
"env": {
"METRIFYR_API_KEY": "your-api-key-here",
"METRIFYR_BASE_URL": "https://custom.metrifyr.cloud",
"LOG_LEVEL": "debug"
}
}
}
}Verifying Installation
After installation, verify the server is working:
- Restart your MCP client
- Open a new chat/session
- Type: "List my Google Analytics properties"
If you see your GA4 properties, the installation is successful! 🎉
Troubleshooting
"Command not found: npx"
Install Node.js 18 or later from nodejs.org
"MCP server failed to start"
Check the logs in your client. Common issues:
- Invalid API key format
- Network connectivity problems
- Node.js version too old
"No tools available"
Make sure you've:
- Connected your Google account in Dashboard
- Enabled tools for your API key
- Restarted your MCP client after configuration
See full troubleshooting guide