Skip to content

Commit 3dc6e9e

Browse files
Add AI tools integration documentation and configuration
This change introduces comprehensive AI-assisted development support: - Add AI Tools Integration Guide documenting available tools and setup - Configure MCP servers for Datadog CI Visibility integration - Add Claude CLI configuration files - Update AGENTS.md with developer tools guidance (MCP, GitHub CLI, GitLab CLI) - Update CONTRIBUTING.md with link to AI tools documentation Made-with: Cursor
1 parent 1c44c6f commit 3dc6e9e

5 files changed

Lines changed: 193 additions & 0 deletions

File tree

.claude/settings.json

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{
2+
"defaultMode": "acceptEdits",
3+
"enabledMcpjsonServers": [
4+
"datadog"
5+
],
6+
"enableAllProjectMcpServers": true
7+
}

.mcp.json

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
{
2+
"mcpServers": {
3+
"datadog": {
4+
"type": "http",
5+
"url": "https://mcp.datadoghq.com/api/unstable/mcp-server/mcp?toolsets=software-delivery"
6+
}
7+
}
8+
}

AGENTS.md

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,3 +78,26 @@ Code running in the agent's `premain` phase must **not** use:
7878
- `javax.management.*` — causes class loading issues
7979

8080
See [docs/bootstrap_design_guidelines.md](docs/bootstrap_design_guidelines.md) for details and alternatives.
81+
82+
## Developer Tools
83+
84+
### MCP Tools
85+
86+
* Datadog MCP defaults: When using Datadog MCP tools (CI pipelines, tests, flaky tests, coverage, PR insights), default to the repository `github.com/DataDog/dd-trace-java` (or `https://github.com/DataDog/dd-trace-java` for PR-related tools) unless the user specifies a different repository. Use the current git branch and latest commit SHA as context when relevant.
87+
88+
### GitHub Tools
89+
90+
- When interacting with GitHub (github.com), ALWAYS use `gh` on the command line.
91+
- If `gh` CLI is not installed or there are authentication or configuration problems, check the document: [AI Tools Integration Guide - GitHub CLI](docs/ai-tools-integration-guide.md#github-cli-gh)
92+
93+
### GitLab Tools
94+
95+
- When interacting with GitLab (gitlab.ddbuild.io), ALWAYS use `glab` on the command line.
96+
- If `glab` CLI is not installed or there are authentication or configuration problems, check the document: [AI Tools Integration Guide - GitLab CLI](docs/ai-tools-integration-guide.md#gitlab-cli-glab)
97+
98+
### Handling the Pull Request and CI
99+
100+
- To create and monitor PR data, use the gh client (GitHub Tools).
101+
- If the request relates to CI status for a branch or PR, MUST ALWAYS try the Datadog MCP first.
102+
- Use local GitLab/GitHub tools as a fallback/support for the Datadog MCP when interacting with GitLab/GitHub CI.
103+

CONTRIBUTING.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,15 @@ For IntelliJ IDEA, we suggest the following settings and plugin.
8181
* Switch to `IntelliJ IDEA CE 2021.2.3`.
8282
</details>
8383

84+
## AI-assisted development
85+
86+
This project includes documentation and configurations to help you use AI coding assistants effectively.
87+
88+
Check [AI Tools Integration Guide](docs/ai-tools-integration-guide.md) for information about:
89+
* Project-specific AI context and conventions
90+
* How to use AI tools with dd-trace-java
91+
* Best practices for AI-assisted contributions
92+
8493
## Pull request guidelines
8594

8695
### Draft first

docs/ai-tools-integration-guide.md

Lines changed: 146 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,146 @@
1+
# AI Tools Integration Guide
2+
3+
> **Note**: This document is currently under development and will be populated with guidance on using AI coding assistants effectively with dd-trace-java.
4+
5+
## The AI tools
6+
7+
This section describes the AI tools and integrations available for dd-trace-java development.
8+
9+
**Index:**
10+
- [MCP Servers Integration (Beta)](#mcp-servers-integration-beta)
11+
- [Datadog MCP Server Setup](#datadog-mcp-server-setup-for-dd-trace-java)
12+
- [Claude CLI](#claude-cli)
13+
- [GitHub CLI (gh)](#github-cli-gh)
14+
- [GitLab CLI (glab)](#gitlab-cli-glab)
15+
16+
17+
### MCP Servers Integration (Beta)
18+
19+
Model Context Protocol (MCP) servers extend AI capabilities with specialized tools and integrations. The dd-trace-java repository provides several MCP server configurations to enhance your development workflow. MCP servers can be used with any compatible AI tool, including Cursor and Claude CLI.
20+
21+
**Available MCP Servers:**
22+
23+
- **Datadog MCP Server**: Provides CI Visibility integration including pipeline event search and aggregation, test event analysis, flaky test detection, code coverage summaries, and PR insights. Pre-configured in the repository via `.cursor/mcp.json` (for Cursor) and `.mcp.json` (for Claude CLI and other compatible tools). See [Datadog MCP Server Setup](datadog-mcp-server.md) for detailed setup and usage instructions.
24+
25+
To set up MCP servers, follow the specific setup guides for each server. All MCP servers integrate seamlessly with compatible AI tools, providing enhanced context and capabilities for working with the dd-trace-java repository.
26+
27+
#### Datadog MCP Server Setup for dd-trace-java
28+
29+
The Datadog MCP server connects Cursor's AI assistant to Datadog's CI Visibility platform, letting you query pipeline events, test results, flaky tests, code coverage, and PR insights directly from the chat.
30+
31+
##### Setup
32+
33+
**1. Repository Configuration (Pre-configured)**
34+
35+
The repository already includes the MCP server configuration in `.cursor/mcp.json`:
36+
37+
```json
38+
{
39+
"mcpServers": {
40+
"datadog": {
41+
"url": "https://mcp.datadoghq.com/api/unstable/mcp-server/mcp?toolsets=software-delivery",
42+
"headers": {}
43+
}
44+
}
45+
}
46+
```
47+
48+
**2. Authentication via SSO**
49+
50+
The Datadog MCP server uses SSO for authentication. No API or App keys are required.
51+
52+
1. Open Cursor IDE in the dd-trace-java repository
53+
2. Go to the MCP settings panel and trigger the **login** command on the `datadog` server
54+
For the in terminal agent use `/mcp login`.
55+
3. A browser tab opens automatically for Datadog SSO login
56+
4. Complete the login in your browser — Cursor picks up the session automatically
57+
58+
After logging in, the MCP tools are immediately available in the AI chat.
59+
60+
##### Available Tools
61+
62+
The repository configuration enables the **software-delivery** toolset. See the [official Datadog MCP toolsets documentation](https://docs.datadoghq.com/bits_ai/mcp_server/#toolsets:~:text=MCP%20Server.-,Toolsets,-The%20Datadog%20MCP) for the full list of available tools.
63+
64+
##### Example Prompts
65+
66+
```
67+
Show me the latest failed CI jobs on the main branch of DataDog/dd-trace-java
68+
```
69+
70+
```
71+
Find the top 10 flaky tests in dd-trace-java sorted by failure rate
72+
```
73+
74+
```
75+
What issues are blocking PR #1234 in DataDog/dd-trace-java?
76+
```
77+
78+
```
79+
What's the P95 pipeline duration for dd-trace-java over the last 30 days?
80+
```
81+
82+
### Claude CLI
83+
84+
The dd-trace-java repository provides native support for **Claude CLI** (Anthropic's command-line interface for Claude) through a dedicated configuration in the `.claude/` directory.
85+
86+
#### Configuration Files
87+
88+
```
89+
.claude/
90+
├── CLAUDE.md # Claude-specific instructions and rules pointer
91+
├── settings.json # Claude CLI settings (permissions, environment, MCP enablement)
92+
93+
.mcp.json # MCP server configuration (shared across AI tools)
94+
```
95+
96+
* **`.claude/CLAUDE.md`**: Contains Claude-specific instructions and points to the shared rules in `AGENTS.md`
97+
* **`.claude/settings.json`**: Configures Claude CLI behavior, including default permission mode, environment variables, and MCP server enablement (e.g., the Datadog MCP server)
98+
* **`.mcp.json`**: Defines MCP server connections at the repository root. Claude CLI automatically discovers this file and makes the configured servers available. Currently includes the Datadog MCP server for CI Visibility integration
99+
100+
### GitHub CLI (gh)
101+
102+
The AI tools are configured to use the **GitHub CLI** (`gh`) for all interactions with GitHub (github.com), including repository management, pull requests, issues, and CI/CD operations. The AI assistant will automatically use `gh` commands when performing GitHub-related tasks.
103+
104+
#### Installation
105+
106+
```bash
107+
brew install gh
108+
```
109+
110+
#### Authentication
111+
112+
```bash
113+
gh auth login
114+
```
115+
116+
To verify your authentication status:
117+
118+
```bash
119+
gh auth status
120+
```
121+
122+
### GitLab CLI (glab)
123+
124+
The AI tools are configured to use the **GitLab CLI** (`glab`) for all interactions with GitLab (gitlab.ddbuild.io), including pipeline management, merge requests, and CI/CD operations. The AI assistant will automatically use `glab` commands when performing GitLab-related tasks.
125+
126+
#### Installation
127+
128+
```bash
129+
brew install glab
130+
```
131+
132+
#### Authentication
133+
134+
You will need a **personal access token** to authenticate with GitLab. You can create one from your GitLab profile at **Settings > Access Tokens** on `gitlab.ddbuild.io`.
135+
136+
Once you have your token, authenticate:
137+
138+
```bash
139+
glab auth login --hostname gitlab.ddbuild.io
140+
```
141+
142+
To set the default host:
143+
144+
```bash
145+
glab config set host gitlab.ddbuild.io
146+
```

0 commit comments

Comments
 (0)