代码可观测性服务

Digma Code Observability MCP Server 是一个用于代码可观测性和动态代码分析的模型上下文协议服务器实现,使代理能够访问运行时洞察。

  • by digma-ai
  • C#
  • 混合部署
  • 11 星标
  • 更新于
在 GitHub 查看 digma-ai/digma-mcp-server

使用说明

Digma代码可观察性MCP服务器

一种模型上下文协议(MCP)服务器实现,使代理能够使用 怒犯天条 用于代码可观测性和动态代码分析

主要特点🚀

  • 🗣️ 可观察性辅助代码审查: 检查PR分支是否存在预生产可观察性发现的任何问题。
  • 🔎 通过动态代码分析发现代码效率低下: 识别代码/查询中减缓应用程序速度的问题
  • 🔭 利用分布式跟踪中的代码运行时使用数据: 检查是否有突破性的变化或生成的相关测试

示例提示💬

  • help me review the code changes in this branch by looking at related runtime issues
  • I want to improve the performance of this app. What are the three most severe issues I can fix?
  • I'm making changes to this function, based on runtime data. What other services and code would be affected?
  • Are there any new issues in this code based on the Staging environment?
  • Which database queries have the most impact on the application performance?

看看它在行动📺


尽早访问👀

Digma对您的可观察性数据进行预处理,以识别问题、跟踪代码性能和运行时数据,从而进行动态代码分析。 访问我们的 MCP页面 注册以尽早访问我们的MCP服务器。

安装⚙️

配置您的MCP客户端(Claude、Cursor等)以包含Digma MCP。 Digma部署包括MCP SSE服务器。您可以使用客户端中的URL配置它,也可以使用MCP工具,如 超级网关 将其作为命令工具运行。 MCP URL路径由Digma API密钥组成,如下所示: https://<DIGMA_API_URL>/mcp/<DIGMA_API_TOKEN>>/sse

MCP XML示例

如果您的客户端支持SSE服务器,则可以使用以下语法:

{
  "mcpServers": {
    "digma": {
    "url": "https://<DIGMA_API_URL>/mcp/DIGMA_API_TOKEN>/sse",
   
      }
    // ... other servers might be here ...
  }
}

要将MCP服务器用作命令工具,请使用 超级网关 桥接到URL的工具,如下所示:

{
  "digma": {
    "command": "npx",
    "args": [
      "-y",
      "supergateway",
      "--sse",
      "https://<DIGMA_API_URL>/mcp/DIGMA_API_TOKEN>/sse"
    ]
  }
}

使用规则👨‍💼

代理是自主的,可以根据需要选择何时使用Digma提供的数据,但是,一些客户端允许设置规则和策略来设置更结构化的流程。 这是一个示例规则文件,您可以将其添加到光标中 .cursor/rules 目录

# Digma Memory File - Code Review Instructions

## Runtime Analysis Settings
- Environment: TEST

## Code Review Protocol
1. For any code or branch review request:
   - Get the list of changed files and methods in the current branch using `git diff`
   - Check for ALL runtime issues in TEST environment (not just for the method in context)
   - Check if any runtime issue may be related to the changed code
   - Check the runtime usage of the changed methods (based on the `git diff`)
   - Check if any of the changed methods (based on the `git diff`) have a high risk based on their performance impact 
   - Synthesize the data with standard code review analysis


## Note
This file is used by the AI assistant to maintain consistent review protocols across sessions. 

许可证📜

MIT许可证。看 许可证 文件。