Skip to content

Commit 4a7ab7b

Browse files
committed
Merge branch 'claude/hookdeck-gateway-mcp-Xe6WQ' of https://github.com/hookdeck/hookdeck-cli into claude/hookdeck-gateway-mcp-Xe6WQ
2 parents a439d2e + ac7fc64 commit 4a7ab7b

3 files changed

Lines changed: 19 additions & 18 deletions

File tree

AGENTS.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -351,6 +351,9 @@ if apiErr, ok := err.(*hookdeck.APIError); ok {
351351
- **Always run tests** when changing code. Run unit tests (`go test ./pkg/...`) and, for CLI-facing changes, acceptance tests (`go test ./test/acceptance/...`). If tests fail due to TLS/network/sandbox (e.g. `x509`, `operation not permitted`), prompt the user and re-run with elevated permissions (e.g. `required_permissions: ["all"]`) so tests can pass.
352352
- **Create tests for new functionality.** Add unit tests for validation and business logic; add acceptance tests for flows that use the CLI as a user or agent would (success and failure paths). Acceptance tests must pass or fail—no skipping to avoid failures.
353353
354+
### Acceptance Test Setup
355+
Acceptance tests require a Hookdeck API key. See [`test/acceptance/README.md`](test/acceptance/README.md) for full details. Quick setup: create `test/acceptance/.env` with `HOOKDECK_CLI_TESTING_API_KEY=<key>`. The `.env` file is git-ignored and must never be committed.
356+
354357
### Unit Testing
355358
- Test validation logic thoroughly
356359
- Mock API calls for command tests

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "hookdeck-cli",
3-
"version": "1.10.0-beta.1",
3+
"version": "1.10.0-beta.2",
44
"description": "Hookdeck CLI",
55
"repository": {
66
"type": "git",

plans/hookdeck_mcp_detailed_implementation_plan.md

Lines changed: 15 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -12,19 +12,17 @@ This document maps the high-level MCP build-out plan against the existing hookde
1212

1313
---
1414

15-
## Current Status (updated 2026-03-09)
15+
## Current Status (updated 2026-03-10)
1616

1717
| Part | Description | Status |
1818
|------|-------------|--------|
1919
| Part 1 | Issues CLI Backfill (prerequisite) | **COMPLETE** |
2020
| Part 2 | Metrics CLI Consolidation (prerequisite) | **COMPLETE** |
2121
| Part 3 | MCP Server Skeleton | **COMPLETE** |
2222
| Part 4 | MCP Tool Implementations | **COMPLETE** |
23-
| Part 5 | Integration Testing & Polish | PENDING |
23+
| Part 5 | Integration Testing & Polish | **COMPLETE** |
2424

25-
**What's done:** Parts 1–4 are complete. The MCP server is fully functional with all 11 resource tools and the `hookdeck_login` tool implemented. All tools have been manually tested against the live Hookdeck API (sources, connections, destinations, transformations, requests, events, attempts, issues, metrics, projects, help). Both auth paths verified: pre-authenticated via `--api-key` flag (11 tools, no login) and unauthenticated startup (12 tools including `hookdeck_login`, resource tools return auth error).
26-
27-
**What's next:** Part 5 — integration testing and polish. Two schema/UX issues were found and fixed during testing: `measures` was not marked required in `hookdeck_metrics` (caused confusing 422), and `hookdeck_help` gave a poor error for non-tool-name topics.
25+
**What's done:** All 5 parts are complete. The MCP server is fully functional with all 11 resource tools and the `hookdeck_login` tool. 80 unit/integration tests cover all tools, actions, error scenarios (404, 422, 429), auth guards, and project switching. Acceptance test suite passes with no regressions from MCP changes (transient 502s and listen-test timeouts are pre-existing issues). Tool descriptions have been polished for accuracy (event-centric terminology, destination types: HTTP/CLI/MOCK). AGENTS.md updated with acceptance test setup guidance.
2826

2927
---
3028

@@ -107,20 +105,20 @@ hookdeck metrics transformations --measures count,error_rate --dimensions connec
107105
- [x] `pkg/cmd/mcp.go` — removed `ValidateAPIKey()` gate; passes config to `NewServer()`
108106
- [x] `pkg/gateway/mcp/server.go` — accepts `*config.Config`; conditionally registers `hookdeck_login` tool
109107

110-
### Part 5: Integration Testing & Polish
108+
### Part 5: Integration Testing & Polish — COMPLETE
111109

112110
**CLI Acceptance Tests** (ensure all CLI changes are covered in `test/acceptance/`):
113-
- [ ] Run full acceptance test suite: `go test ./test/acceptance/ -v`
114-
- [ ] Verify no regressions in existing tests (gateway, connection, source, destination, etc.)
115-
- [ ] Verify `hookdeck gateway --help` lists `mcp` as a subcommand
116-
117-
**MCP Integration Tests** (end-to-end via stdio transport):
118-
- [ ] End-to-end test: start MCP server, send tool calls, verify responses
119-
- [ ] Verify all 11 tools return well-formed JSON
120-
- [ ] Test error scenarios (404, 422, rate limiting)
121-
- [ ] Test unauthenticated startup: server starts, `hookdeck_login` tool is listed, resource tools return auth error
122-
- [ ] Test authenticated startup: server starts, only resource tools are listed, no `hookdeck_login`
123-
- [ ] Test project switching within an MCP session
111+
- [x] Run full acceptance test suite: `go test ./test/acceptance/ -v`
112+
- [x] Verify no regressions in existing tests (gateway, connection, source, destination, etc.)
113+
- [x] Verify `hookdeck gateway --help` lists `mcp` as a subcommand
114+
115+
**MCP Integration Tests** (end-to-end via in-memory transport in `pkg/gateway/mcp/server_test.go`, 80 tests):
116+
- [x] End-to-end test: start MCP server, send tool calls, verify responses (`connectInMemory` helper)
117+
- [x] Verify all 11 tools return well-formed JSON (every tool has `*_Success` tests)
118+
- [x] Test error scenarios (404, 422, rate limiting)`TestSourcesList_404Error`, `_422ValidationError`, `_429RateLimitError`, `TestEventsGet_APIError`, `TestTranslateAPIError`
119+
- [x] Test unauthenticated startup: server starts, `hookdeck_login` tool is listed, resource tools return auth error`TestListTools_Unauthenticated`, `TestAuthGuard_UnauthenticatedReturnsError`
120+
- [x] Test authenticated startup: server starts, only resource tools are listed, no `hookdeck_login``TestListTools_Authenticated`
121+
- [x] Test project switching within an MCP session`TestProjectsUse_Success`
124122

125123
---
126124

0 commit comments

Comments
 (0)