Skip to content

Commit 7b5883a

Browse files
authored
Merge pull request #76 from koriym/readme-cli-discoverability
docs: clarify README and demo smoke test scope
2 parents 70afd2c + 327f93f commit 7b5883a

2 files changed

Lines changed: 18 additions & 12 deletions

File tree

README.md

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
**Debug PHP with Runtime Data — No var_dump(), No Guesswork**
66

7-
Trace-based debugging for PHP, built on Xdebug. Drive the tools from the CLI, or let an AI assistant run them for you.
7+
Trace-based debugging for PHP, built on Xdebug. Drive the tools from the CLI, or let an AI assistant run the core tools through plugin, Skill, or MCP integration.
88

99
[![AI Native](https://img.shields.io/badge/AI_Native-YES-green)](https://github.com/koriym/xdebug-mcp)
1010
[![Runtime Data](https://img.shields.io/badge/Runtime_Data-YES-green)](https://github.com/koriym/xdebug-mcp)
@@ -32,13 +32,13 @@ Just tell your AI assistant what you want:
3232
"UserServiceのテストカバレッジを確認して"
3333
```
3434

35-
The AI automatically selects the appropriate tool, executes it, and analyzes the results.
35+
When connected through the plugin, Skill, or an MCP-capable client, the AI can select the appropriate tool, execute it, and analyze the results.
3636

3737
## Requirements
3838

3939
- PHP 8.2+
4040
- [Xdebug 3.x](https://xdebug.org/docs/install) extension (installed, but **not** enabled by default)
41-
- Optional: an AI assistant (Claude Code plugin, or any MCP-capable client)
41+
- Optional: an AI assistant (Claude Code plugin, Codex Skill, or any MCP-capable client)
4242

4343
> **💡 Performance Tip:** Keep Xdebug disabled in php.ini for daily use. This tool loads Xdebug on-demand only when needed.
4444
@@ -146,6 +146,8 @@ flowchart LR
146146
| `xback` | Call stack at breakpoint | "Show me how we got to this error" |
147147
| `xcompare` | Compare variable states across two runs | "Compare input 10 vs 0" or "Compare with main branch" |
148148

149+
All tools in this table are available as CLI commands. MCP currently exposes the core one-shot analysis tools: `xtrace`, `xprofile`, `xstep`, `xcoverage`, and `xback`. `xcompare` is CLI-only.
150+
149151
## CLI Usage
150152

151153
For direct command-line usage without AI:
@@ -203,7 +205,7 @@ Schemas live under [docs/schemas/](docs/schemas/). AI assistants — and humans
203205

204206
## MCP Configuration
205207

206-
For any MCP-capable client, register `xdebug-mcp` in that client's MCP config (e.g. `.mcp.json`):
208+
For any MCP-capable client, register `xdebug-mcp` in that client's MCP config (e.g. `.mcp.json`). MCP exposes `xtrace`, `xprofile`, `xstep`, `xcoverage`, and `xback`:
207209

208210
```json
209211
{
@@ -304,7 +306,7 @@ Looking for a different approach? [kpanuragh/xdebug-mcp](https://github.com/kpan
304306

305307
## Why "xdebug-mcp"?
306308

307-
This project started as an MCP (Model Context Protocol) server for AI-powered PHP debugging. MCP is still supported for any MCP-capable client, but the CLI is now the primary interface — the tools (`xstep`, `xtrace`, `xprofile`, `xcoverage`, `xback`, `xcompare`) work on their own, with or without MCP.
309+
This project started as an MCP (Model Context Protocol) server for AI-powered PHP debugging. MCP is still supported for any MCP-capable client, but the CLI is now the primary interface. The core MCP tools (`xstep`, `xtrace`, `xprofile`, `xcoverage`, `xback`) also work as standalone CLI commands; `xcompare` and `xrepl` are CLI-only tools.
308310

309311
## Resources
310312

demo/run-demo.sh

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,10 @@
11
#!/usr/bin/env bash
2-
# Run every CLI command documented in README.md against the demo scripts
3-
# and report PASS/FAIL for each. Used both as a developer smoke test
4-
# (`composer demo`) and as a hands-on tour of every tool.
2+
# Run the non-interactive CLI tools documented in README.md against the
3+
# demo scripts and report PASS/FAIL for each. Used both as a developer
4+
# smoke test (`composer demo`) and as a hands-on tour of the tools
5+
# exercised here. The interactive REPL (`xrepl`) and the long-running
6+
# MCP server (`xdebug-mcp`) are out of scope for this script — only
7+
# `xrepl --help` is invoked as a presence check.
58

69
set -u
710

@@ -21,12 +24,13 @@ run() {
2124
shift
2225
printf '\n=== %s ===\n' "$label"
2326
printf ' $ %s\n' "$*"
24-
if "$@" >"$LOG" 2>&1; then
27+
"$@" >"$LOG" 2>&1
28+
local code=$?
29+
if [ "$code" -eq 0 ]; then
2530
printf ' PASS\n'
2631
PASS=$((PASS + 1))
2732
return 0
2833
fi
29-
local code=$?
3034
printf ' FAIL (exit %d)\n' "$code"
3135
sed 's/^/ /' "$LOG" | tail -10
3236
FAIL=$((FAIL + 1))
@@ -60,10 +64,10 @@ run "xcompare: compare two runs" \
6064
--run-a="php demo/buggy.php" \
6165
--run-b="php demo/buggy.php"
6266

63-
run "xrepl: CLI availability (--help smoke check)" \
67+
run "xrepl: presence check (--help)" \
6468
./bin/xrepl --help
6569

66-
printf '\n=========================\n'
70+
printf '\n-------------------------\n'
6771
printf 'PASS: %d FAIL: %d\n' "$PASS" "$FAIL"
6872
if [ "$FAIL" -gt 0 ]; then
6973
printf 'Failed:\n'

0 commit comments

Comments
 (0)