@amplitude/mcp-analyticsSAFE
Amplitude MCP Analytics SDK - MCP tracking for Amplitude Analytics. :sparkles: :calendar: Book a session with us :arrow_down:
Overview
From the repository's own README, as read at the audited commit. Badges and raw HTML are left out.
Amplitude MCP Analytics SDK — Model Context Protocol server usage tracking for Amplitude Analytics.
Status: Preview. Server and tool instrumentation, the default event set, identity resolution, and custom events are available now. Transport and correlation handling (stdio and Streamable HTTP, across protocol revisions) is handled for you under the hood.
Install
There are two ways to set up: let a coding agent do it, or follow this README manually.
Option 1 — agent-assisted Install the `instrument-mcp-server` skill (part of the builder-skills engineering-skills plugin) and ask your agent to instrument your MCP server — it walks through this README for you, plus the recommended rationale and UTM steps.
Option 2 — manual
pnpm add @amplitude/mcp-analytics @amplitude/analytics-node @modelcontextprotocol/sdk
@amplitude/analytics-node and @modelcontextprotocol/sdk are peer dependencies — your MCP server already depends on the latter. Any @modelcontextprotocol/sdk from 1.14.0 up is supported, including versions 1.21.0+, which changed how McpServer reports a failed tools/call; the default events mean the same thing across that whole range.
Quick start
import { createMcpAnalytics } from '@amplitude/mcp-analytics';
const analytics = createMcpAnalytics({
apiKey: process.env.AMPLITUDE_API_KEY!,
serverName: 'my-mcp-server',
serverVersion: '1.0.0',
});
// Bind the server (enables analytics + emits connection events), then wrap your
// tool handlers. Order matters: instrumentServer() must run before connect().
analytics.instrumentServer(server, { authType: 'oauth' });
server.tool(
'search_docs',
schema,
analytics.instrumentTool(
async (args, extra) => doSearch(args), // your handler, unchanged
{ name: 'search_docs'c4afb25e31f0OBSERVED · 2026-10-12Connect
Built from this server's own package name, version and transport as found in its source — not copied from anyone's documentation, so it cannot drift against a page we do not control. Replace the environment placeholders with a token scoped to the least it needs.
claude mcp add mcp-analytics --env AMPLITUDE_API_KEY=${AMPLITUDE_API_KEY} -- npx -y @amplitude/[email protected]{
"mcpServers": {
"mcp-analytics": {
"command": "npx",
"args": [
"-y",
"@amplitude/[email protected]"
],
"env": {
"AMPLITUDE_API_KEY": "${AMPLITUDE_API_KEY}"
}
}
}
}Exposed tools (8)
8 read · 0 write · 0 destructive.
| Tool | Risk | Description |
|---|---|---|
echo | read | Return the message you were given. Include rationale when you know why you are calling this tool. |
fails | read | |
legacy | read | |
off | read | |
ping | read | |
search | read | |
uninstrumented | read | |
whoami | read | Report the playground user id and attach it to analytics for this call. |
Trust audit
SAFEgrade B · trust 87/100 Nothing in the source contradicts what it says it does. Grade A is reserved for packages that have also passed the behavioural sandbox.
| Layer | What it checks | Result |
|---|---|---|
| L0 | Provenance & inventory | PASS |
| L1 | Static analysis of the code | PASS |
| L2 | Instruction surface (what it tells the agent) | PASS |
| L3 | Class-specific surface | PASS |
| L4 | Behavioural (sandbox) | SKIPPED |
What the source does
- Filesystem
- declared (2 observation(s))
- Network
- none-observed
- Shell
- none-observed
- Dependencies
- not all pinned
- Secrets in source
- none-found
Findings (15)
.release-please-manifest.json
const hash = createHash('sha1').update(nsBytes).update(name).digest();const wrong = createHash('sha1').update(DNS).update('python.org').digest();import { createMcpAnalytics, type AmplitudeMCPAnalytics } from '../../src/client.js';import type { AmplitudeClientLike } from '../../src/types.js';const path = fileURLToPath(new URL('../../package.json', import.meta.url));import type { MCPAnalyticsConfig } from '../../config.js';import type { AmplitudeClientLike, AmplitudeEvent } from '../../types.js';It listens on `http://127.0.0.1:8787/mcp`.
"url": "http://127.0.0.1:8787/mcp"
const pathname = new URL(req.url ?? '/', 'http://127.0.0.1').pathname;
const url = new URL(`http://127.0.0.1:${address.port}${PLAYGROUND_HTTP_PATH}`);serverUrl: `http://127.0.0.1:${address.port}/2/httpapi`,@types/node, fast-check
Gates applied: no_behavioural_pass, no_license.
c4afb25e31f0full audit observations/trust-audit/mcp-server/amplitude__amplitude-mcp-analytics-node.json · Report an issue / request a re-scanAudit history
Every audit this server has had. A grade with a past is a grade somebody is still checking.
| Date | Source | Verdict | Grade | Score | Change |
|---|---|---|---|---|---|
| 2026-10-12 | c4afb25e31f0 | SAFE | B | 87 | first audit |
Questions
What is the @amplitude/mcp-analytics MCP server?
Amplitude MCP Analytics SDK - MCP tracking for Amplitude Analytics. :sparkles: :calendar: Book a session with us :arrow_down:
What tools does @amplitude/mcp-analytics expose?
8 in total: 8 read-only, 0 that write, and 0 that can delete or overwrite. Every one is listed on this page with its risk.
Is @amplitude/mcp-analytics safe to connect to an agent?
The audit found nothing in the source that contradicts what it says it does, and graded it B (87/100). Grade A is held back for packages that have also passed a sandboxed behavioural run, which is why a clean server reads B.
What credentials does @amplitude/mcp-analytics need?
It reads AMPLITUDE_API_KEY from the environment. Give it a token scoped to the least it needs — an agent that can be talked into calling a tool can be talked into calling it with your credentials.
How does @amplitude/mcp-analytics run?
It speaks stdio and streamable-http, so it runs as a local process your client starts. It is published on npm as @amplitude/mcp-analytics at 0.5.2.
How current is this page?
The grade is for one exact copy of the source (c4afb25e31f0), read on 2026-10-12. The repository is watched and re-audited when it changes.