Add e2e test suite with MCP protocol compliance tests - #29
Merged
Conversation
Add a two-layer MCP protocol test suite using vitest: - Protocol compliance tests (10 tests, no InfluxDB needed) verify server startup, tool/resource/prompt registration, and error handling by spawning the real server as a child process via the MCP SDK client - Integration tests (3 tests, gated behind INFLUX_TEST_ENABLED) verify health_check, list_databases, and execute_query against a live instance Add CLAUDE.md with architecture overview, key patterns (product-type branching, dual-plane routing, tool schema duality), and conventions. Add Claude Code skills for developer workflows: - build-run-core-enterprise: build, configure, and run against Core/Enterprise - testing: run tests, analyze failures, extend the test suite
Contributor
There was a problem hiding this comment.
Pull request overview
This PR introduces a Vitest-based end-to-end test suite that validates MCP protocol compliance by spawning the built MCP server as a child process, plus optional live InfluxDB integration tests gated by an environment variable. It also adds repository-facing documentation for architecture and testing workflows (including Claude Code guidance).
Changes:
- Add Vitest configuration and a test harness that spawns
build/index.jsvia the MCP SDK stdio client transport. - Add protocol compliance tests (no InfluxDB required) and gated live integration tests.
- Add/extend documentation and “skills” references describing architecture and testing workflows.
Reviewed changes
Copilot reviewed 11 out of 12 changed files in this pull request and generated 7 comments.
Show a summary per file
| File | Description |
|---|---|
vitest.config.ts |
Adds Vitest config (include pattern, setup file, timeouts). |
tests/setup.ts |
Adds a pre-test guard requiring build/index.js to exist. |
tests/protocol.test.ts |
Adds MCP protocol compliance coverage (handshake, list tools/resources/prompts, ping, unknown tool error). |
tests/integration.test.ts |
Adds env-gated tests for health_check, list_databases, and execute_query against a live InfluxDB. |
tests/helpers/mcp-client.ts |
Adds a helper that spawns the built server via StdioClientTransport and connects an MCP SDK Client. |
package.json |
Replaces previous “build smoke test” with Vitest scripts; bumps MCP SDK; adds Vitest dependency. |
package-lock.json |
Updates lockfile for MCP SDK bump + Vitest/Vite dependency graph. |
CLAUDE.md |
Adds architecture overview and codebase conventions guidance. |
.claude/skills/testing/references/test-architecture.md |
Adds detailed reference docs for test approach/design decisions. |
.claude/skills/testing/SKILL.md |
Adds run/debug instructions for protocol + integration tests. |
.claude/skills/build-run-core-enterprise/references/mcp-client-configs.md |
Adds MCP client config examples for local/npx/docker. |
.claude/skills/build-run-core-enterprise/SKILL.md |
Adds build/run/testing workflow documentation for Core/Enterprise. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
- Add docker-compose.test.yml with Core using Docker secrets for admin token bootstrapping (--object-store memory, ephemeral containers) - Add CI workflow with protocol tests (always) and integration tests against Core via docker run with bind-mounted admin token file - Add env.test.example with exported vars for local integration testing - Add tests/fixtures/admin-token.json (static apiv3_ test token) - Add test:infra:up/down scripts for local Docker lifecycle - Raise minimum Node version to >=20.11.0 (vitest 4.x + import.meta.dirname) - Fix env.test.example: use export for shell sourcing compatibility - Revert process.env spread in test helper (SDK handles inheritance) - Update testing skill with Docker workflow and CI architecture docs - Add future Enterprise testing placeholder in CI workflow
The server-level catch block in CallToolRequest handler was returning error content without isError: true, inconsistent with handler-level catch blocks in individual tools. This caused MCP clients to treat unhandled tool errors as successful responses.
Synchronize version across package.json (was 1.0.0), config.ts (was 1.2.0), and CHANGELOG.md to 1.3.0. Add a check-versions CI job that extracts the version from all three sources and fails if they disagree, preventing future drift.
Merged
jstirnaman
added a commit
that referenced
this pull request
May 18, 2026
## Release v1.3.0 This is the first official release under the @influxdata scope and contains breaking changes, including the package name change to `@influxdata/influxdb3-mcp-server`. However, the MCP tools, resources, and prompts are unchanged. ### Added - **E2E test suite**: Protocol compliance tests (vitest) — 10 tests verifying server startup, MCP handshake, tool/resource/prompt registration, and error handling. No InfluxDB required. - **Integration tests**: Live InfluxDB tests for `health_check`, `list_databases`, and `execute_query`, gated behind `INFLUX_TEST_ENABLED` - **Error-path unit tests**: 7 tests with recorded error fixtures from live Core and Cloud Serverless covering JSON, plain-text, and `{code, message}` error formats - **CI workflow**: GitHub Actions with protocol tests on every PR, integration tests against Core via Docker, and Cloud Serverless tests via GitHub environment secrets - **Docker test infrastructure**: `docker-compose.test.yml` for local Core testing with preconfigured admin token - **Version consistency CI check**: Fails if `package.json`, `config.ts`, and `CHANGELOG.md` versions disagree - **CLAUDE.md**: Architecture overview and codebase conventions for Claude Code - **Claude Code skills**: Build/run workflow for Core/Enterprise and testing workflow ### Fixed - Server-level error catch now sets `isError: true`, consistent with handler-level error responses - Plain-text error responses from InfluxDB Core (HTTP 500) surfaced in all 4 services - Query error handler now checks `data.message` for Cloud Serverless `{code, message}` JSON errors - Query error handler extraction order aligned with other services (`data.message` before `data.error`) ### Changed - npm package renamed from `influxdb-mcp-server` to `@influxdata/influxdb3-mcp-server` - Minimum Node.js version raised to v20.11 (Node 18 is EOL) - `@modelcontextprotocol/sdk` updated from `^1.12.1` to `1.27.1` - All dependencies updated and pinned to exact versions (no caret ranges) - Version aligned to 1.3.0 across `package.json`, `config.ts`, and `CHANGELOG.md` ## Verified against live instances | Target | Tests | Result | |---|---|---| | Protocol (no InfluxDB) | 10 protocol + 7 error-path unit | All pass | | InfluxDB 3 Core (Docker) | 3 happy-path + 2 error-path | All pass | | InfluxDB Cloud Serverless | 3 happy-path | All pass | ## PRs included - #29 — E2E test suite, CLAUDE.md, Claude Code skills (merged) - #31 — fix: add data.message check to query error handler, add error-path tests (merged) - #24 — fix(query): surface plain-text error responses from InfluxDB Core - #20 — Bump axios from 1.12.2 to 1.13.5 - #10 — Bump js-yaml from 4.1.0 to 4.1.1 - #26 — Bump flatted from 3.3.3 to 3.4.2 - Dependency updates within semver ranges, then pinned to exact versions - Version alignment to 1.3.0 - npm package rename to `@influxdata/influxdb3-mcp-server` - CI workflow with version check, Core integration, and Cloud Serverless integration
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
by spawning it as a child process via the MCP SDK client
startup, tool/resource/prompt registration, ping, and error handling
INFLUX_TEST_ENABLED) verifyhealth_check,list_databases, andexecute_queryagainst a live instanceCLAUDE.mdwith architecture overview and codebase conventionsTest plan
npm run build && npm testpasses (10 protocol tests pass, 3 integration tests skip)docker-compose.test.ymlfor local Core testing and CI workflow