Content
# datadog-docs-askai-mcp
**Languages:** [English](README.md) | [日本語](README.ja.md)
MCP server that talks to [Datadog Docs Ask AI](https://docs.datadoghq.com/) from Cursor, Claude Code, and other MCP clients.
This uses the same public Docs AI HTTP API as **[Ask AI](https://docs.datadoghq.com/)** on the [docs site](https://docs.datadoghq.com/) (and the [datadog-docs-askai](https://github.com/kyoppe/tampermonkey-scripts/tree/main/datadog-docs-askai) Tampermonkey userscript). You do not need a personal Datadog API key.
## Benefits
`ask_datadog_docs` is the tool you use to have the agent ask **[Ask AI](https://docs.datadoghq.com/)** on the [docs site](https://docs.datadoghq.com/).
On Datadog product questions, an agent on its own often skips citations, uses stale details, or gets names wrong. This MCP uses the **same backend as [Ask AI](https://docs.datadoghq.com/) on the docs site** and returns answers with source links.
Good fits: official explanations of features, metric names and retention, citations before you change an integration.
The agent can chain this with `pup`, Datadog MCP, code edits, and shell commands in the same session. For example: ask Docs Ask AI about APM Trace Metrics, check live metrics with `pup`, then update a monitor.
| | Without `ask_datadog_docs` | With `ask_datadog_docs` |
|---|---------------------------|-------------------------|
| Official citations | Often missing | Same source URLs as Docs Ask AI |
| Product facts | Can drift | Based on Docs Ask AI answers |
| Org data (`pup`, Datadog MCP) | Yes | Yes, same session |
| Code and commands | Yes | Yes, same session |
## Usage
Register this MCP in your client first ([Install](#install)). After that, talk to your agent as usual. You do not need to open **[Ask AI](https://docs.datadoghq.com/)** on the docs site in a browser.
When official documentation would help, the agent calls `ask_datadog_docs` and returns an answer with source links.
**Example prompts:**
- "Use Docs Ask AI to explain APM Trace Metrics and summarize in Japanese."
- "Check the Datadog docs for how to install the Agent on Linux."
- "Look up SLO setup in the docs and compare with our monitor Terraform."
For follow-up questions, the agent can pass `conversation_id` to continue the same Docs Ask AI thread. You can also combine this with `pup`, Datadog MCP, code edits, and shell commands in the same session.
## Tool
### `ask_datadog_docs`
| Parameter | Required | Description |
|-----------|----------|-------------|
| `question` | yes | Question for Docs Ask AI |
| `conversation_id` | no | Continue an existing chat |
| `anchor_url` | no | Docs page URL for extra context |
| `history` | no | Prior `{ role, content }` messages |
| `rewrite_query` | no | Ask Docs AI to rewrite the first query |
## Install
### 1. Build
```bash
git clone https://github.com/kyoppe/datadog-docs-askai-mcp.git
cd datadog-docs-askai-mcp
npm install
npm run build
chmod +x scripts/*.sh
```
### 2. Register in your MCP client
```bash
./scripts/install-mcp.sh cursor # Cursor only
./scripts/install-mcp.sh claude # Claude Code only
./scripts/install-mcp.sh all # both
# or
npm run install:mcp
```
The script detects the clone path automatically and registers `datadog-docs-askai` in `mcpServers` in your user config (overwrites an existing entry with the same name). It backs up the config file first.
| Client | Config file |
|--------|-------------|
| Cursor | `~/.cursor/mcp.json` |
| Claude Code | `~/.claude.json` |
After registration: **restart Cursor** or **start a new Claude Code session**.
This MCP runs locally in Claude Code. It does **not** appear in cloud Connectors or Customize → Developer. Verify:
```bash
claude mcp list
claude mcp get datadog-docs-askai
```
## Manual setup
If `install-mcp.sh` fails or you prefer not to use the script, register by hand. [`examples/`](./examples/) match what `install-mcp.sh` writes.
1. Open the config file (see table above)
2. Add `datadog-docs-askai` under `mcpServers` (mind JSON commas if adding after another entry)
3. Set `env.DATADOG_DOCS_ASKAI_MCP_ROOT` to the **absolute path to your clone**
4. Restart Cursor or start a new Claude Code session
### Cursor
Add the `datadog-docs-askai` block from [`examples/cursor-mcp.json`](./examples/cursor-mcp.json) to `mcpServers` in `~/.cursor/mcp.json`:
```json
"datadog-docs-askai": {
"command": "bash",
"args": [
"-c",
"exec \"$DATADOG_DOCS_ASKAI_MCP_ROOT/scripts/run-mcp.sh\""
],
"env": {
"DATADOG_DOCS_ASKAI_MCP_ROOT": "/path/to/datadog-docs-askai-mcp"
}
}
```
### Claude Code
Add the `datadog-docs-askai` block from [`examples/claude-code.json`](./examples/claude-code.json) to `mcpServers` in `~/.claude.json`:
```json
"datadog-docs-askai": {
"type": "stdio",
"command": "bash",
"args": [
"-c",
"exec \"$DATADOG_DOCS_ASKAI_MCP_ROOT/scripts/run-mcp.sh\""
],
"env": {
"DATADOG_DOCS_ASKAI_MCP_ROOT": "/path/to/datadog-docs-askai-mcp"
}
}
```
## Related
- Tampermonkey userscript: [kyoppe/tampermonkey-scripts/datadog-docs-askai](https://github.com/kyoppe/tampermonkey-scripts/tree/main/datadog-docs-askai)
## License
MIT