Skip to main content
Skip table of contents

MCP (Model Context Protocol)

What is MCP (Model Context Protocol)?

MCP allows your AI tools (Claude, Cursor, etc.) to directly access your Piano Analytics data through natural language queries. Instead of navigating dashboards, simply ask: "How many visitors did we have last week?" or "What are our top performing pages this month?"

Available tool: get_web_analytics_data - retrieves analytics data based on your natural language questions.

Concrete use cases:

Analytics data analysis: Bring your Piano Analytics data directly into your LLM for analysis and insights. Ask "Analyze my traffic trends and suggest optimization strategies" or "What patterns do you see in my conversion data?"

Automated workflows: Integrate the MCP into automation platforms like N8N, Zapier, or custom scripts to periodically fetch analytics data for reports, alerts, or data pipelines without manual intervention.

Augmented agents: Create specialized AI agents that leverage your Piano Analytics data to assist with specific tasks - like a marketing agent that monitors campaign performance or a content agent that tracks page engagement.

⚙️ Join the Beta Program

To participate in this private beta:

  1. Contact your CSM/KAM and request access to Piano Analytics MCP beta

  2. Specify if you need access for specific users or your entire organization

  3. Our team will whitelist your access within 2-3 business days

  4. Provide feedback after 30 days of testing via email

Beta limitations:

  • Single tool available (get_web_analytics_data)

  • No dedicated support - documentation only

  • Features may change based on feedback

  • Access can be revoked at any time


This guide helps you connect your AI tool (e.g., Claude Desktop) to Piano Analytics via the Model Context Protocol (MCP), enabling secure, live queries on your analytics data.

Prerequisites

  • A Piano Analytics account with personal API access key and secret key. Available here.

  • Node.js installed to run local MCP scripts. Download the installer for your OS: https://nodejs.org/fr/download .

  • Verify npx is available in your terminal: npx --version.

Recommended: STDIO (Local Server)

Best for Claude Desktop and most MCP clients that support a local server via npx.

  1. Open your AI tool (e.g., Claude Desktop) → SettingsDeveloperEdit config.

  2. Add the configuration below to your MCP config file (e.g., claude_desktop_config.json) and replace the placeholders with your credentials.

JSON
{
  "mcpServers": {
    "piano-analytics-mcp-server": {
      "command": "npx",
      "args": [
        "mcp-remote@0.1.18",
        "https://analytics-api-eu.piano.io/mcp/",
        "--header",
        "x-api-key:${ACCESS_KEY}_${SECRET_KEY}"
      ],
      "env": {
        "ACCESS_KEY": "XXXX",
        "SECRET_KEY": "XXXX"
      }
    }
  },
  "isUsingBuiltInNodeForMcp": true
}
  1. Save the file, close it, then restart your AI tool.

On Windows, after installing the MCP server on Claude Desktop, closing Claude is not enough. You must stop the process in Task Manager.

  1. Go back to Developer: the server should appear and start automatically as piano-analytics-mcp-server.

  2. Open a new chat and run AI queries against your Piano Analytics data.

Official MCP endpoint: Piano Analytics MCP ↗.

HTTP connection (if your client supports it)

Some MCP clients let you declare a remote HTTP server and attach headers. If yours supports custom headers at the MCP level, use the URL above and add the x-api-key header formatted as ACCESS_KEY_SECRET_KEY (joined by an underscore) in your client's configuration. If headers aren't supported, prefer STDIO.

Claude Code

You can also install our MCP server in Claude Code from the terminal:

BASH
export ANALYTICS_ACCESS_KEY="XXXX" 
export ANALYTICS_SECRET_KEY="XXXX"  

claude mcp add piano-analytics --scope user -- npx mcp-remote@0.1.18 https://analytics-api-eu.piano.io/mcp/ --header "x-api-key:${ANALYTICS_ACCESS_KEY}_${ANALYTICS_SECRET_KEY}"

Security best practices

  • Store API keys in environment variables or a secure vault.

  • Scope permissions to the minimum required and never share secrets.

  • Rotate/revoke keys if you suspect exposure.

Troubleshooting

  • npx not found: reinstall Node.js and verify npx --version.

  • MCP start error: check JSON syntax, presence of keys, and header format x-api-key:${ACCESS_KEY}_${SECRET_KEY}.

  • Network: allow outbound access to analytics-api-eu.piano.io.

  • Client lacks remote server support: STDIO via npx mcp-remote is widely compatible.

JavaScript errors detected

Please note, these errors can depend on your browser setup.

If this problem persists, please contact our support.