Skip to main content
Glama
souvikdu

perfonext-profiler-mcp

perfonext-profiler-mcp

Analyze V8 and Chrome CPU profiles to find hotspots in Next.js servers and scripts.

npm npm downloads license

perfonext-profiler-mcp is a Model Context Protocol (MCP) server that gives GitHub Copilot, Claude Desktop, Claude Code, and other MCP clients structured CPU profiling data for Next.js performance work. It loads V8 and Chrome CPU profiles and turns them into hotspot rankings, per-package costs, and source-annotated hot lines — evidence agents can reason over instead of ingesting multi-megabyte profile dumps.

Quick Start

perfonext-profiler-mcp is a standard MCP stdio server, so it works with any MCP-compatible client (GitHub Copilot in VS Code, Claude Desktop, Claude Code, Cursor, and others). Run it directly with npx:

npx -y @perfonext/profiler-mcp

Or install globally:

npm install -g @perfonext/profiler-mcp

The executable command remains perfonext-profiler-mcp after installation.

VS Code

Add the server to .vscode/mcp.json (the workspace MCP configuration file):

{
  "servers": {
    "perfonext-profiler": {
      "type": "stdio",
      "command": "npx",
      "args": ["-y", "@perfonext/profiler-mcp"]
    }
  }
}

Reload the VS Code window and run MCP: List Servers to start it, or accept the trust prompt when it appears.

Claude Desktop

Add the server to claude_desktop_config.json:

{
  "mcpServers": {
    "perfonext-profiler": {
      "command": "npx",
      "args": ["-y", "@perfonext/profiler-mcp"]
    }
  }
}

Restart Claude Desktop to pick up the new server.

Claude Code

Add the server with the CLI:

claude mcp add perfonext-profiler -- npx -y @perfonext/profiler-mcp

Or add the same mcpServers entry to .mcp.json.

Other MCP clients

Any client that supports stdio MCP servers can launch npx -y @perfonext/profiler-mcp. Consult your client's documentation for its MCP server configuration format.

For a locally-built checkout, point command/args at node and the repo's dist/index.js instead.

Related MCP server: Debugger MCP Server

Troubleshooting

spawn npx ENOENT / spawn node ENOENT on macOS with nvm

If the server fails to start with this error, your GUI MCP client likely cannot see nvm. GUI apps on macOS do not load shell config (.zshrc/.bashrc), so nvm-installed npx/node are not on PATH. Use an absolute npx path and include the same Node directory in PATH:

{
  "servers": {
    "perfonext-profiler": {
      "type": "stdio",
      "command": "/Users/YOU/.nvm/versions/node/v<version>/bin/npx",
      "args": ["-y", "@perfonext/profiler-mcp"],
      "env": {
        "PATH": "/Users/YOU/.nvm/versions/node/v<version>/bin:/usr/bin:/bin"
      }
    }
  }
}

Merge these fields into your client's server entry, under servers for VS Code or mcpServers for Claude Desktop/Code. Then ask your assistant: "How do I capture a CPU profile of my Next.js server?"

What It Does

  • loads .cpuprofile files and Chrome trace exports that contain CPU profile data

  • identifies the hottest functions by self time, annotated with the originating npm package

  • explains caller and callee relationships for a selected function

  • reads actual source code for hot functions and annotates each line with V8 sample counts (v0.2.0)

  • aggregates CPU self-time per npm package to find expensive third-party dependencies (v0.3.0)

  • compares two profiles to surface regressions and improvements

  • returns deterministic optimization suggestions for common hotspots

  • summarizes loaded profiles so an MCP client can keep context tight

Tools

Tool

Description

how_to_collect

Return a ready-to-run command and step-by-step recipe for capturing a .cpuprofile, then loading it. Use this when you don't have a profile yet

load_profile

Parse and load a .cpuprofile file or Chrome trace export from disk

get_hotspots

Find top functions by self-time. Each entry includes a package field identifying the npm package or (user code)

explain_function

Explain a function's timing, callers, and callees. Pass includeSource: true to attach annotated source lines

read_source_context

Read the actual source file for a hot function and annotate each line with tick counts from positionTicks

get_package_costs

Aggregate CPU self-time by npm package — shows which dependencies are most expensive

compare_profiles

Compare two profiles and highlight regressions

suggest_optimizations

Generate structured, multi-pattern optimization suggestions for hot functions. Detects high fan-in, recursion, dominant callers, and V8-specific patterns. Deduplicates functions split across multiple call sites

get_profile_summary

Summarize one profile or list all loaded profiles

Every tool result carries a nextStep breadcrumb pointing at the natural follow-up call, so an MCP client can walk the collect → analyze → fix loop without guessing.

Example Prompts

  • "How do I capture a CPU profile of my Next.js server?"

  • "Load the CPU profile at ./profile.cpuprofile and show me the top hotspots."

  • "Which npm packages are consuming the most CPU in this profile?"

  • "Explain why processData is expensive in the loaded profile."

  • "Show me the actual source lines for processData and mark which lines are hottest."

  • "Explain transformResult and include the annotated source code."

  • "Compare my baseline and current CPU profiles and tell me what got slower."

  • "Suggest optimizations for the top three hotspots."

Deep Tool Reference

how_to_collect details

// Input
{ "scenario": "next-server" } // or "script"; defaults to "next-server"

// Output
{
  "scenario": "next-server",
  "summary": "Profile a production Next.js server while it handles a single request. ...",
  "command": "node --cpu-prof --cpu-prof-dir=./.perf-profiles ./node_modules/next/dist/bin/next start",
  "steps": [ "...", "load_profile({ filePath: \"./.perf-profiles/<file>.cpuprofile\" })" ],
  "outputDir": "./.perf-profiles",
  "nextStep": "After stopping the server, call load_profile with the .cpuprofile ..."
}

next-server profiles a production Next.js server while it serves a single request. If next start says standalone output is unsupported, use the script scenario with .next/standalone/server.js. script profiles that standalone server (or another Node entry). Keep the scenario to one route and one hit. Node writes one .cpuprofile per process/worker thread into the output directory. The Next server command uses Node CLI flags (not NODE_OPTIONS) so it is the same on Unix and Windows.

read_source_context details

// Input
{ "profileId": "<id>", "functionName": "myFn", "contextLines": 10 }

// Output (per line)
{
  "lineNumber": 42,
  "content": "  for (let i = 0; i < items.length; i++) {",
  "ticks": 18,      // V8 samples that landed on this line
  "isHot": true     // true when ticks >= 50% of peak ticks for this function
}

The returned window is sized to cover the function's actual hot lines, not just a fixed radius around its declaration — a function's real bottleneck is often well past its function line. contextLines (default 10) sets the minimum padding around both the declaration and the hot lines; if any ticks still fall outside the returned window, the top-level result includes hiddenTicks (a count) and a warning telling you to retry with a larger contextLines. explain_function also accepts contextLines when called with includeSource: true.

Only files inside the current working directory can be read. file:// URLs and absolute paths are both handled; http://, node: builtins, and paths outside the project root are rejected.

suggest_optimizations details

// Input
{ "profileId": "<id>", "limit": 5 }

// Output (per function)
{
  "function": "processData",
  "file": "file:///app/src/processor.js",
  "line": 10,
  "selfPercent": "18.2%",
  "patterns": [
    {
      "pattern": "high-fan-in",
      "detail": "Called from 6 distinct call sites (e.g. renderRow, buildTree, …)",
      "suggestion": "This function is a shared hot path. Ensure it is well-optimised and monomorphic …"
    },
    {
      "pattern": "hot-caller",
      "detail": "84% of calls come from \"renderRow\"",
      "suggestion": "Focus optimisation effort on \"renderRow\" rather than this function …"
    }
  ],
  "topSuggestion": "This function is a shared hot path …"
}

Patterns detected (multiple can fire for the same function):

Pattern

Trigger

gc-pressure

Function name matches GC/Scavenge/MarkCompact

json-serialization

JSON.parse / JSON.stringify

regex-cost

RegExp / exec / test calls

v8-deopt

Compile / Recompile / Optimize / Deoptimize

high-fan-in

≥ 3 distinct parent call sites

recursion

Function appears in its own descendant sub-tree

hot-caller

One caller accounts for ≥ 80% of call-site occurrences

cpu-bound

Fallback when no other pattern matches

Functions that appear at multiple call sites are automatically merged before ranking so the same logical function is only reported once.

get_package_costs details

// Input
{ "profileId": "<id>", "limit": 10 }

// Output (per package)
{
  "rank": 1,
  "package": "lodash",
  "selfTime": "42.3ms",
  "selfPercent": "14.1%",
  "totalTimeIncludingCallbacks": "58.0ms",
  "totalPercentIncludingCallbacks": "19.3%",
  "topFunctions": [
    { "function": "chunk", "file": "lodash/chunk.js", "line": 41, "selfTime": "28.0ms", "selfPercent": "9.3%" }
  ]
}

selfTime is the time spent inside the package's own code. totalTimeIncludingCallbacks also counts everything the package called into — including your own callbacks handed back to it — so it can exceed what removing the package would actually save.

Scoped packages (@babel/core, @next/env, etc.) are handled correctly. User code and native builtins (no node_modules in the path) are excluded.

Generating a CPU Profile

Ask Copilot to call how_to_collect for a ready-to-run recipe, or generate one manually:

Next.js production server (profile a single request):

node --cpu-prof --cpu-prof-dir=./.perf-profiles ./node_modules/next/dist/bin/next start
# hit the route once, then stop the process so it can exit and write the profile

If next start reports that standalone output is unsupported:

node --cpu-prof --cpu-prof-dir=./.perf-profiles .next/standalone/server.js

Chrome DevTools:

  1. Open DevTools and go to the Performance tab.

  2. Record the scenario you want to inspect.

  3. Stop recording and save the result as a .cpuprofile export.

Development

npm install
npm run build
npm test

The repository already includes sample fixtures under tests/fixtures/ for local validation.

License

MIT

Available Tools

9 tools
compare_profilesCompare ProfilesA

Compare two loaded CPU profiles side-by-side. Shows functions that got slower/faster and new/removed hotspots.

ParametersJSON Schema
NameRequiredDescriptionDefault
limitNoNumber of top changes to show
baseProfileIdYesProfile ID of the baseline (before)
compareProfileIdYesProfile ID to compare (after)

TDQS

A4.2/5.0
Behavior4/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations provided, the description carries the behavioral disclosure burden. It does so well by describing the comparison behavior and the categories of results ('slower/faster', 'new/removed hotspots'), which also implies a read-only analysis operation. It does not detail error behavior or exact result ordering, but the core behavior is transparent.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Two short sentences, no fluff, and the most important information is front-loaded. Every word earns its place, and the description is easy to parse quickly.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a simple two-required-parameter comparison tool, the description plus complete schema covers the necessary invocation details. It explains the high-level output even without an output schema. It could marginally improve by noting it requires profiles already loaded via load_profile, but the description already says 'loaded'.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100%, so the input schema already documents baseProfileId, compareProfileId, and limit. The description adds only the concept of a baseline and comparison profile through side-by-side language, which is useful but does not go beyond the schema in describing parameter semantics.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description uses a specific verb ('Compare') with a clear resource ('two loaded CPU profiles') and states the concrete output: slower/faster functions and new/removed hotspots. This makes the tool's purpose immediately distinguishable from sibling tools like get_hotspots, which focuses on a single profile.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The phrase 'two loaded CPU profiles' clearly indicates the required precondition and typical use case: the agent should call this tool only after two profiles are loaded. It does not explicitly name alternatives or state when not to use it, but the context is clear enough for routing.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

explain_functionExplain FunctionA

Returns detailed timing info for a specific function: self-time, total-time, callers, and callees. Use this to understand why a function is slow.

ParametersJSON Schema
NameRequiredDescriptionDefault
profileIdYesProfile ID returned by load_profile
contextLinesNoOnly used with includeSource: minimum lines of padding around the declaration and hot lines (default: 10)
functionNameYesExact function name to look up
includeSourceNoWhen true, include annotated source code lines with per-line tick counts (default: false)

TDQS

A3.8/5.0
Behavior3/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations provided, the description carries the full burden for behavioral disclosure. It does convey that the tool is read-only by saying 'Returns' and lists the main output categories, but it does not disclose behavior around absent functions, optional source annotation, or any prerequisites beyond what the schema already states.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is two compact sentences with no filler. The first sentence front-loads the core output, and the second gives actionable usage guidance, so every sentence earns its place.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

The description covers the main return categories and the intended use, while the schema fully documents parameters. Since there is no output schema, a bit more detail about the exact response structure would be helpful, but the description is otherwise adequate for a focused analysis tool.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100%, so the schema already explains all four parameters. The description adds no extra detail about contextLines or includeSource, and only indirectly references function lookup; it does not compensate beyond the schema baseline.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states a specific verb and resource: 'Returns detailed timing info for a specific function: self-time, total-time, callers, and callees.' This distinguishes it from broader tools like get_hotspots, though it does not explicitly name sibling alternatives.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The phrase 'Use this to understand why a function is slow' gives clear intended usage context. However, it does not mention when not to use it or point to alternatives such as get_hotspots or suggest_optimizations, so it stops short of a full 5.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

get_hotspotsGet HotspotsA

Returns the top N functions by self-time (CPU time spent directly in the function, not its callees). Use this to find performance bottlenecks.

ParametersJSON Schema
NameRequiredDescriptionDefault
limitNoNumber of hotspots to return (default: 10)
profileIdYesProfile ID returned by load_profile

TDQS

A4.2/5.0
Behavior4/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations provided, the description carries the full burden. It adds meaningful behavioral nuance by defining self-time and clarifying that callee time is excluded, which is a key detail beyond the tool name. It does not detail return structure or edge cases, but for a read operation, the core behavior is well disclosed.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Two sentences with zero filler. The first sentence states the core output and definition; the second states the use case. Information is front-loaded and every word earns its place.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a simple list-retrieval tool with no output schema, the description provides enough context to call the tool correctly: what it returns, how the metric is defined, and a typical use case. It could mention ordering or return format, but these are strongly implied by 'top N by self-time' and the overall simplicity of the tool.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100%, so the schema already documents both parameters fully. The description's phrase 'top N' loosely maps to the limit parameter but adds no semantics beyond the schema's own 'Number of hotspots to return'. Thus a baseline score of 3 is appropriate.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states a specific verb ('Returns') and resource ('top N functions by self-time'), and defines the key concept of self-time as 'CPU time spent directly in the function, not its callees'. This distinguishes the tool from siblings like explain_function or get_profile_summary, and leaves no ambiguity about what it does.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description explicitly states when to use it: 'Use this to find performance bottlenecks.' This is clear contextual guidance, but it does not mention exclusions or alternatives (e.g., when to prefer suggest_optimizations or get_profile_summary), so it falls short of the highest bar.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

get_package_costsGet Package CostsA

Aggregate CPU self-time by npm package. Identifies which third-party dependencies are consuming the most CPU, by parsing node_modules paths from the profile. Useful for deciding which packages to replace, lazy-load, or avoid. Scoped packages (e.g. @babel/core) are handled correctly.

ParametersJSON Schema
NameRequiredDescriptionDefault
limitNoMaximum number of packages to return, sorted by self-time (default: 10)
profileIdYesProfile ID returned by load_profile

TDQS

A4.2/5.0
Behavior4/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations, the description carries the behavioral disclosure burden. It does this well by revealing the implementation approach ('parsing node_modules paths from the profile') and a meaningful edge case ('Scoped packages (e.g. @babel/core) are handled correctly'). It does not explicitly state that the operation is read-only, but the language 'aggregate' and 'identifies' strongly implies a non-mutating analysis.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Three sentences with no filler. The core function is stated first, followed by practical use cases, and a concise note on scoped package handling. Every sentence earns its place and the structure makes the tool easy to scan.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a simple tool with one required parameter and no output schema, the description covers the essential purpose, use cases, input source, and an edge case. It stops short of describing the exact return format (e.g., sorted list, object keys), which is slightly notable given no output schema exists.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100%, so the schema already documents both parameters (profileId and limit). The description does not add significant parameter-level detail beyond noting that parsing occurs on the profile, which is already implied by the schema description 'Profile ID returned by load_profile'. Baseline 3 is appropriate.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the tool's function: 'Aggregate CPU self-time by npm package.' This is a specific verb-resource pair that distinguishes it from siblings like get_hotspots (which likely targets functions/lines) and profile summary tools. The mention of 'third-party dependencies' and 'node_modules paths' further clarifies the exact scope.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description gives explicit use-case context: 'Useful for deciding which packages to replace, lazy-load, or avoid.' This tells an agent when to invoke the tool. However, it does not name specific sibling alternatives or explain when not to use it, so it falls short of full routing guidance.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

get_profile_summaryGet Profile SummaryA

Returns an overview of a loaded profile: duration, sample count, top-level call tree (filtered to functions >0.1% of total time), and idle time percentage. For large profiles, the call tree is limited to depth 2 and top 20 children per node to keep output manageable. Also lists all loaded profiles if no ID is given.

ParametersJSON Schema
NameRequiredDescriptionDefault
profileIdNoProfile ID. If omitted, lists all loaded profiles.
treeDepthNoDepth of call tree to include (default: 2, max: 5)

TDQS

A3.8/5.0
Behavior4/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations provided, the description carries the full burden of behavioral disclosure. It does this well by revealing special truncation behavior for large profiles, the 0.1% filter threshold, and the fallback behavior of listing all profiles when no ID is supplied. It does not mention error cases or auth requirements, but for a read-only summary tool the disclosed behavior is substantial.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is three sentences with no filler. The main output contents are front-loaded, followed by important size-limiting behavior, and then the no-ID fallback. Every sentence contributes meaningful information.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a tool with no output schema, the description explains the return contents and special behaviors well. It covers optional parameters indirectly via the profileId fallback and large-profile truncation behavior. It could mention what happens with an invalid profile ID or the exact output format, but for this complexity level the description is largely complete.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100%, so the schema already documents both parameters. The description reinforces the profileId fallback behavior but adds little beyond the schema for treeDepth, which is fully documented with default, minimum, and maximum. This meets the baseline for a well-covered schema without adding extra semantic value.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the tool returns an overview of a loaded profile and enumerates the specific contents: duration, sample count, top-level call tree, and idle time percentage. It is specific about the resource and action, but it does not explicitly distinguish itself from sibling tools like get_hotspots, which could also expose profile timing data.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description implies when to use the tool: when an overview or summary of a loaded profile is needed, and when no profile ID is provided to list loaded profiles. However, it gives no explicit guidance about when to prefer this over siblings such as get_hotspots or compare_profiles, and no exclusion criteria are stated.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

how_to_collectHow To Collect a CPU ProfileA

Returns a ready-to-run command and step-by-step recipe for capturing a V8 CPU profile, then loading it with load_profile. Use this when you do not yet have a .cpuprofile file. Choose the scenario that matches how the code runs.

ParametersJSON Schema
NameRequiredDescriptionDefault
scenarioNoHow the code under test runs. "next-server" (default) profiles a Next.js production server; "script" profiles a Next.js standalone server.js (or another Node entry).

TDQS

A4.3/5.0
Behavior4/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations, the description carries the full behavioral burden. It clearly discloses that the tool returns instructions rather than performing profiling itself, and it notes the relationship to load_profile. It does not detail output structure, but that is less critical for a how-to recipe tool.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Three compact sentences fully convey purpose, trigger condition, and usage direction. Key information is front-loaded and there is no filler.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a simple tool with one optional enum parameter and no output schema, the description is complete: it says what is returned, when to call it, and how to choose the parameter. The sibling tool reference helps the agent understand the overall workflow.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The schema already provides 100% coverage for the single 'scenario' parameter, including enum descriptions. The description reinforces selecting the scenario that matches execution, but does not meaningfully add beyond the schema.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the tool returns a ready-to-run command and step-by-step recipe for capturing a V8 CPU profile and loading it with load_profile. It identifies the resource and action precisely, and the 'when you do not yet have a .cpuprofile file' condition distinguishes it from analysis tools.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description explicitly says to use this tool when no .cpuprofile file exists, and tells the agent to choose the scenario matching how the code runs. It also references load_profile as the follow-up tool, though it does not explicitly enumerate all sibling exclusions.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

load_profileLoad CPU ProfileA

Parse and load a V8/Chrome CPU profile from disk. Supports both .cpuprofile files and Chrome DevTools Trace JSON exports. Returns a profile ID for use with other tools.

ParametersJSON Schema
NameRequiredDescriptionDefault
filePathYesAbsolute or relative path to the .cpuprofile or Chrome trace .json file

TDQS

A4.2/5.0
Behavior3/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations provided, the description carries full behavioral disclosure responsibility. It states the input formats, the action (loading from disk), and the output (profile ID). However, it does not disclose potential side effects, such as whether loading replaces an existing profile, how errors on invalid files are surfaced, or whether the profile ID is session-scoped. For a simple loader this is adequate but not rich.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Two sentences with no filler. The first sentence front-loads the core action and resource, the second covers supported formats and the return value. Every clause earns its place, and the structure is ideal for quick comprehension.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

The tool is simple: one required parameter, no nested objects, no output schema. The description explains the parameter, supported file types, and the return value (a profile ID), which is enough for correct invocation. It could briefly mention its relationship to the sibling tools, but the 'for use with other tools' hint already covers the basic workflow.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The schema provides 100% coverage for the filePath parameter, so the baseline is 3. The description adds meaningful value by clarifying the two supported file types (.cpuprofile and Chrome DevTools Trace JSON), which directly refines the meaning of the filePath parameter beyond what the schema alone states.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the verb ('Parse and load'), resource ('V8/Chrome CPU profile from disk'), and the tool's role as the entry point for the sibling analysis tools. The line 'Returns a profile ID for use with other tools' differentiates it from the analytical siblings like get_hotspots and compare_profiles, which would consume that ID rather than load files.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides clear context that this tool is to be used first to load a profile and obtain an ID for subsequent tools. It does not, however, explicitly name any sibling alternatives or list exclusions, such as when to use how_to_collect instead. The implied workflow is strong but not fully explicit.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

read_source_contextRead Source ContextA

Read the actual source code for a hot function and annotate each line with sampled tick counts from positionTicks. The returned window is sized to cover the function's actual hot lines, not just the area around its declaration; if any ticks still fall outside it, a warning field reports how many and suggests a larger contextLines. Only reads files within the project root.

ParametersJSON Schema
NameRequiredDescriptionDefault
profileIdYesProfile ID returned by load_profile
contextLinesNoMinimum lines of padding around the function declaration and its hot lines (default: 10)
functionNameYesExact function name to look up

TDQS

A4/5.0
Behavior4/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, so the description carries the full behavioral disclosure burden. It reveals that the tool only reads files inside the project root, that the returned window is sized to cover hot lines, and that a warning field may report off-window ticks and suggest a larger contextLines. This adds meaningful behavioral detail beyond the schema.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Two sentences, both information-dense and free of filler. The primary action and resource are front-loaded, followed by caveats about window sizing, warning behavior, and file-scope restrictions in a logical order.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a read-only source inspection tool with no annotations and no output schema, the description covers the core behavior, the returned window logic, the warning field, and the project-root restriction. It does not describe error handling for missing functions or the exact output shape, but these are minor given the clear purpose and well-documented parameters.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100%, so the baseline is 3. The description adds context around window sizing and the warning field's relationship to contextLines, but it does not materially expand on the parameter semantics already documented in the input schema.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description states a specific verb ('Read'), resource ('actual source code for a hot function'), and outcome ('annotate each line with sampled tick counts'). It is clearly distinguishable from sibling tools such as get_hotspots, which likely lists hotspots without source context, and explain_function, which likely provides explanations rather than annotated code.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description conveys when the tool is appropriate: when the agent needs source code annotated with tick counts for a hot function. However, it does not explicitly state when not to use it or name alternative tools that might be better suited for related but different tasks.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

suggest_optimizationsSuggest OptimizationsA

Analyzes the profile and returns structured optimization suggestions for the hottest functions. Detects high fan-in, recursion, dominant callers, V8-specific patterns, always reports CPU self-time cost for expensive functions, and deduplicates functions split across multiple call sites.

ParametersJSON Schema
NameRequiredDescriptionDefault
limitNoNumber of functions to analyze (default: 5)
profileIdYesProfile ID returned by load_profile

TDQS

A4/5.0
Behavior4/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations, the description carries the full behavioral burden and does so well, disclosing the analysis types, the 'always reports CPU self-time cost' invariant, and the deduplication behavior. It only stops short of stating side-effect status or return-shape details.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single dense sentence that front-loads the core purpose and then packs high-value behavioral details without repetition or filler. Each clause earns its place.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a no-annotation, no-output-schema tool, the description covers the key behaviors an agent needs to invoke it confidently: input, what is detected, and what is returned. It leans on the schema for parameter details and only lightly skips explicit sibling differentiation.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 100%, so the parameters are already fully documented. The description adds no parameter-level semantics, but none are required because profileId and limit are self-explanatory and described in the schema.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description opens with a specific action ('Analyzes the profile') and a concrete deliverable ('returns structured optimization suggestions for the hottest functions'), making the tool's purpose unmistakable. The detection details (fan-in, recursion, V8 patterns) further separate it from siblings like get_hotspots or get_profile_summary.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The intended use is implied: call this when you want actionable optimization guidance rather than raw hotspot data. However, it never explicitly states when to prefer this tool over get_hotspots or explain_function, and it offers no exclusions or preconditions.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections. Dates show when Glama detected each change.

  1. 9 tool updatesv0.7.2
    • First observedcompare_profiles
    • First observedexplain_function
    • First observedget_hotspots
    • First observedget_package_costs
    • First observedget_profile_summary
    • First observedhow_to_collect
    • First observedload_profile
    • First observedread_source_context
    • First observedsuggest_optimizations

TDQS

A4.2/5.0
Disambiguation5/5

Each tool maps to a distinct part of the profiling workflow: loading, summarizing, hotspot analysis, per-function detail, comparison, optimization, source inspection, package aggregation, and collection guidance. There is no meaningful overlap that would make an agent choose the wrong tool.

Naming Consistency4/5

Most tools follow a clear snake_case verb_noun pattern such as load_profile, get_hotspots, and compare_profiles. A few names like explain_function and how_to_collect deviate slightly from the predominant get_ style, but the naming is still predictable and readable.

Tool Count5/5

Nine tools is an ideal size for a profiler-analysis server: each tool serves a distinct analytical purpose and the set is neither bloated nor thin. The count feels appropriately scoped to the domain.

Completeness5/5

The tool surface covers the full workflow from capturing/loading profiles to summarizing, exploring hotspots, comparing profiles, reading source context, and identifying expensive packages. There are no obvious dead ends or missing operations that would prevent an agent from completing a typical profiling analysis.

Maintenance

ActivityActive
ResponsivenessNo issues

Related MCP Connectors

Related MCP Servers

  • F
    license
    Not graded
    quality
    D
    maintenance
    MCP server for Polar Signals Cloud continuous profiling platform, enabling AI assistants to analyze CPU performance, memory usage, and identify optimization opportunities in production systems.
    9
    -
  • F
    license
    Not graded
    quality
    D
    maintenance
    Provides real-time debugging, code quality monitoring, and performance insights for React/Next.js applications with features including Chrome DevTools integration, breakpoint management, complexity analysis, and live error streaming.
    13
    1
    -
  • A
    license
    A
    quality
    C
    maintenance
    Live .NET runtime diagnostics for AI assistants. Ask Claude to diagnose memory leaks, GC pressure, LOH fragmentation, and thread starvation in any running .NET process — no code changes required.
    7
    2
    MIT

Latest Blog Posts

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/souvikdu/perfonext-profiler-mcp'

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