定制 killerwolf/mcp-profiler-bundle 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

killerwolf/mcp-profiler-bundle

最新稳定版本:0.2.0

Composer 安装命令:

composer require killerwolf/mcp-profiler-bundle

包简介

Allow access to symfony profiler data through MCP protocol

README 文档

README

The Symfony MCP Profiler Bundle mimics the WebProfiler Bundle. It bridges the gap between Profiler data and your favorite MCP-enabled AI-powered IDE.

Installation

composer require killerwolf/mcp-profiler-bundle:^0.1

Configuration

Add the bundle to your config/bundles.php:

return [
    // ...
    Killerwolf\MCPProfilerBundle\MCPProfilerBundle::class => ['dev' => true],
];

Built-in Tools

The bundle provides several tools for interacting with the Symfony Profiler:

  • profiler_list: Lists recent profiler entries
  • profiler_get_by_token: Gets a specific profiler entry by token
  • profiler_get_all_collector_by_token: Gets all collectors for a specific profiler entry
  • profiler_get_one_collector_by_token: Gets a specific collector for a profiler entry

Here are some examples of the MCP Inspector in action with different IDEs:

Claude MCP Inspector Capture d'écran de l'interface MCP Inspector intégrée avec Claude AI, montrant l'interaction avec le serveur MCP Symfony et l'accès aux données du Profiler.

Cline MCP Inspector Capture d'écran de Cline IDE avec l'inspecteur MCP, illustrant comment les outils du profiler Symfony sont exposés via le protocole MCP.

Cursor MCP Inspector Capture d'écran de Cursor IDE montrant l'inspecteur MCP en action, permettant d'explorer et d'interagir avec les données du Profiler Symfony.

Commands

The bundle provides the following commands:

Configure the MCP Server in your IDE (Cursor, Claude Code, Cline, etc.)

{
  "mcpServers": {
    "symfony-mcp": {
      "command": "/path/to/your/symfony/project/bin/console",
      "args": [
        "mcp:server:run"
      ]
    }
  }
}

Using the MCP Inspector

The MCP Inspector is a tool that allows you to interact with your MCP Server and test your tools and resources. You can use it with the following command:

npx --registry https://registry.npmjs.org @modelcontextprotocol/inspector

Interacting with the Symfony Profiler (for learning/debug purposes)

The bundle also provides a command-line interface for interacting with the Symfony Profiler directly:

# List recent profiler entries
bin/console mcp:profiler list --limit=20

# Show details for a specific profile
bin/console mcp:profiler show <token>
bin/console mcp:profiler show <token> --collector=request

How It Works

The bundle implements the MCP protocol directly, handling JSON-RPC requests and responses according to the specification. It exposes Symfony Profiler data through a set of tools that can be called by MCP clients (like AI assistants in your IDE).

The implementation includes:

  1. A command that runs the MCP server (mcp:server:run)
  2. A service that manages the server lifecycle
  3. Tool classes that implement specific functionality
  4. Integration with Symfony's dependency injection system

统计信息

  • 总下载量: 634
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 11
  • 点击次数: 0
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 11
  • Watchers: 3
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2025-03-28