This repository was archived by the owner on May 18, 2026. It is now read-only.
docs: expand Gherkin coverage from README; slim README to pointer#4
Merged
Merged
Conversation
… schema
setRequestHandler() in @modelcontextprotocol/sdk requires a Zod schema as
its first argument (ListToolsRequestSchema / CallToolRequestSchema), not a
plain object like { method: 'tools/list' }. Passing a plain object caused
the SDK to throw 'Schema is missing a method literal' synchronously during
server construction, so the process exited immediately on every mcp-serve
invocation.
Fixes:
- Use ListToolsRequestSchema and CallToolRequestSchema from the SDK's
types module in both setRequestHandler calls.
- Extract server setup into createMcpServer({ Server, ListToolsRequestSchema,
CallToolRequestSchema }) so it can be unit-tested without a real stdio
transport.
- Remove the module-level startServer() auto-call; export startServer()
explicitly and call it from bin/cli.js so requiring the module in tests
is safe.
Tests added (docs/tool-retrieval-mcp.feature + step-definitions):
- Zod schema validation: asserts setRequestHandler is called with proper
Zod schemas (not plain objects) using a mock Server + safeParse checks.
- list-tools wire protocol: full Client<->Server round-trip via
InMemoryTransport; asserts search_tools appears in the manifest.
- call-tool wire protocol: same in-process transport; asserts a valid
CallToolResult envelope is returned (empty corpus path, no embedder needed).
All 53 scenarios pass (234 steps).
- Add 6 new docs/*.feature files covering every section of the old README that had no Gherkin spec: installation, mcp-env, tui-commands, mcp-servers, smoke-test, prerequisites - Scenarios that require live systems (tmux, real binary installs, network) are tagged @wip; cucumber.js now sets tags:'not @wip' so they are skipped by default in npm test - Add step definitions for the three unit-testable feature files: mcp-env.steps.js (file format, merge, update, dir creation), mcp-servers.steps.js (validates lib/opencode.json.template directly), prerequisites.steps.js (Node version + engines field check) - All 69 scenarios / 293 steps pass (16 new unit-testable scenarios added) - Rewrite README.md as a thin pointer: tagline, quick-start, table of links to every docs/*.feature file, and a one-liner on @wip semantics
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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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
installation,mcp-env,tui-commands,mcp-servers,smoke-test,prerequisites@wip;cucumber.jsskips them by default viatags: 'not @wip'docs/*.featurefileNew files
@wipdocs/installation.featuredocs/mcp-env.featuredocs/tui-commands.featuredocs/mcp-servers.featurelib/opencode.json.templatedocs/smoke-test.featuredocs/prerequisites.featureengines.nodefieldTest result
All previously passing scenarios still pass; 16 new unit-testable scenarios added.