Uniprof

io.github.indragiek由 GitHub 账号 indragiek 发布v0.3.4更新于 Oct 24, 2026

Universal CPU profiler designed for humans and AI agents

已验证STDIO仅桌面开发者工具数据与分析

概览

AI 生成的概览

Uniprof 是一个本地 CPU 性能分析 MCP 服务器,让助手对多种语言运行时的应用进行性能分析并定位热点。

可以做什么
无需修改代码或添加依赖,即可对 Python、Node.js、Ruby、PHP、JVM、.NET、BEAM 和原生代码进行性能分析,并根据所执行的命令自动选择分析器。将性能数据记录到文件以便后续使用。分析已记录的性能数据以找出热点。在浏览器中以火焰图可视化结果。检查环境并为受支持的客户端安装 MCP 服务器。
适用场景
适合需要助手排查应用为何变慢、定位 CPU 热点,或针对不同语言运行时的脚本和服务采集并比较性能数据的场景。
运行要求
通过 npm(npx uniprof mcp run)作为本地进程运行,支持 macOS 或 Linux;Windows 仅能通过 WSL2 使用。推荐安装 Docker,容器化分析默认使用 Docker;主机模式需要自行安装各分析器。原生代码分析需要构建中包含调试信息和帧指针。
安装前请注意
性能分析工具可能需要提升权限;容器模式会将工作区挂载到 Docker 容器并在其中执行程序。它会在分析器下运行目标应用,因此只应分析你信任的代码。未声明任何凭据或 API 密钥。

安装

在 SourceWeft 中

  1. 打开 控制台中的 Uniprof,将其添加到工作区。
  2. 为需要使用其工具的对话启用该服务。

Desktop only,通过 STDIO。 STDIO 服务会启动本地进程,因此需要 SourceWeft 桌面宿主。

其他 MCP 客户端

参照 仓库 中的启动说明。

README

uniprof

uniprof simplifies CPU profiling for humans and AI agents. Profile any application without code changes or added dependencies.

bash
# Profile and analyze any app in one stepnpx uniprof python script.py

Table of Contents

Supported Platforms

uniprof implements a common interface over multiple profilers that specialize in different platforms and runtimes. It automatically detects which profiler to use based on the command being executed, runs the profiler, transforms the varying output formats into a single format, and runs statistical analysis on the data to identify hotspots.

PlatformProfilerContainerHostMin Version
Pythonpy-spy✅✅Python 3.7+
Node.js0x✅✅Node 14+
Rubyrbspy✅✅Ruby 2.5+
PHPExcimer✅✅PHP 7.2+
JVMasync-profiler✅✅Java 8+
.NETdotnet-trace✅✅.NET 5+
BEAMperf✅✅*OTP 24+
Native (macOS)Instruments❌✅Xcode 14.3+
Native (Linux)perf✅✅Linux 2.6.31+

* Linux only for host mode

System Requirements

tl;dr: macOS or Linux with Docker installed

uniprof is designed to run on macOS and Linux but has primarily been developed & tested on macOS. If you find any bugs when running on Linux, please report them. Running on a Windows host is currenly not supported, but you can run on Linux installed on Windows via WSL2. Note that when using uniprof via WSL2, profiling native Windows executables is not supported, but you can still use the profilers for the higher level language runtimes like Python and Node.js.

Profiling tools are often non-trivial to set up correctly and can require elevated privileges. To simplify set up and provide better isolation for the profiled code, uniprof defaults to using Docker containers for each runtime that are pre-configured to run specific profiling tools. uniprof mounts your workspace in the container and executes the program with the profiler attached. uniprof also supports profiling outside the container if the host system has the profiling tools installed by running with the --mode host flag. The only case where containerized execution is not supported is when profiling a native Mach-O binary on macOS, since Apple Instruments cannot run inside a container.

Installation

bash
npm install -g uniprof

MCP Server

bash
# Install uniprof MCP server automaticallyuniprof mcp install claudecodeuniprof mcp install cursoruniprof mcp install vscode

Supported clients for auto-installation: amp, claudecode, codex, cursor, gemini, vscode, zed

If auto-installation is not supported for your client, add an MCP server using the stdio transport with the command npx -y uniprof mcp run.

For detailed MCP documentation see docs/mcp.md.

Quick Start

Profile and analyze in one step:

bash
# Profile most languages and get immediate analysisuniprof python app.pyuniprof node server.jsuniprof ruby script.rbuniprof java -jar myapp.jaruniprof dotnet MyApp.dlluniprof ./my-native-app
# Profile and visualize flamegraph in browseruniprof --visualize python app.py

Save profiles to analyze and visualize later:

bash
# 1. Check environment (optional)uniprof bootstrap
# 2. Record a profileuniprof record -o profile.json -- python app.pyuniprof record -o profile.json -- node server.jsuniprof record -o profile.json -- ruby script.rbuniprof record -o profile.json -- php script.phpuniprof record -o profile.json -- java -jar myapp.jaruniprof record -o profile.json -- ./gradlew rununiprof record -o profile.json -- ./mvnw spring-boot:rununiprof record -o profile.json -- dotnet MyApp.dlluniprof record -o profile.json -- elixir script.exsuniprof record -o profile.json -- mix rununiprof record -o profile.json -- ./my-native-appuniprof record -o profile.json -- /Applications/MyApp.app
# 3. Analyze profile data to find hotspotsuniprof analyze profile.json
# 4. Visualize flamegraph in the browseruniprof visualize profile.json

For detailed command line options documentation see docs/cli.md.

Host vs. Container Modes

Use the --mode option to control how profiling runs:

  • auto (default): Prefer container mode when Docker is available; otherwise use host.
    • Language runtimes (Python/Node.js/Ruby/PHP/BEAM/JVM/.NET) default to container for zero-setup.
    • Native on macOS with Mach-O binaries uses host (Instruments). ELF binaries on macOS are supported in container mode.
    • Native on Linux defaults to container; host can be used if you prefer your local perf setup.
  • host: Force host-installed profilers.
  • container: Force Docker containers (not supported for macOS Instruments/Mach-O binaries).
bash
# Auto mode (default)uniprof record -o profile.json -- python script.py
# Force host profilersuniprof record --mode host -o profile.json -- python script.py
# Force container modeuniprof record --mode container -o profile.json -- ./my-linux-app

Compiling with Debug Information

Native profiling requires debug information for meaningful results. Debug symbols enable the profiler to map memory addresses to function names, providing readable output instead of just hexadecimal addresses. Additionally, frame pointers improve call stack accuracy, especially for optimized code.

CompilerDWARF Debug InfoFrame PointersNotes
gccgcc -g -o myapp main.cgcc -fno-omit-frame-pointer -o myapp main.cUse -g3 for maximum debug info, -ggdb for GDB-specific extensions
clangclang -g -o myapp main.cppclang -fno-omit-frame-pointer -o myapp main.cppUse -gfull on macOS for complete debug info
swiftswiftc -g main.swiftswiftc -Xcc -fno-omit-frame-pointer main.swiftDebug builds include symbols by default with swift build
cargocargo build (debug mode)
cargo build --release + [profile.release]
debug = true
RUSTFLAGS="-C force-frame-pointers=yes" cargo buildDebug builds include DWARF by default; for release builds, add debug = true to Cargo.toml
gogo build -gcflags=all="-N -l"Built-in, always enabledGo includes debug info by default; -gcflags disables optimizations for better debugging
zigzig build-exe -O Debug main.zigzig build-exe -fno-omit-frame-pointer main.zigUse -O ReleaseSafe with debug info for optimized builds with symbols
ghcghc -g -rtsopts main.hsghc -fno-omit-frame-pointer main.hsUse -prof for profiling builds; -rtsopts enables runtime profiling options

Documentation

Credits

License

All uniprof source code in this repository is licensed under the MIT License. See LICENSE.

uniprof downloads and runs Docker images that bundle third-party software. The Dockerfiles used to build these images can be found in containers/. These images and their contents are not covered by the MIT license and are governed by their own licenses. uniprof does not grant rights to those components and does not relicense them.

来源:README.md,提交 e088547

工具

0
SourceWeft 尚未在沙箱中启动过该软件包,因此其工具未知。

版本历史

1
  1. v0.3.4最新Sep 16, 2026

评分

已满足适用检查项的 50%

该评分衡量此收录条目的完整程度,依据注册中心条目、端点与公开来源计算得出。它不是对服务器本身的评价,也不表示服务器安全或当前可用:可连通性是带日期的检查结果,评分也不包含安装量或用户评价。

  • 近 30 天内可连通25 分

    请保持端点能够响应 MCP 握手;SourceWeft 每 30 天探测一次。

  • 已声明认证方式10 分

    请在注册中心条目中声明凭据请求头,或保持端点能够响应探测,以便判定其认证方式。

  • 已列出工具15 分

    请让服务器在无凭据时响应 tools/list,或发布可在沙箱中无凭据启动的软件包。

  • 描述必需15 分
  • 图标10 分
  • 文档15 分
  • 许可证10 分