• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

dangernoodle-io / mcpkit / 29140408409

11 Jul 2026 04:56AM UTC coverage: 73.478%. First build
29140408409

push

github

web-flow
feat: bootstrap mcpkit module + mcpx seam + capability/host interfaces + composition root (#1)

- module + tooling: go.mod (go 1.26, go-sdk v1.6.1), Makefile, CI workflow,
  README, .gitignore
- mcpx: the sole go-sdk seam (Server, Client, Transport, AddTool, Stdio,
  InMemoryPair)
- host: Adapter interface + generic/claudecode/cursor stub impls
- mcpkit: composition root (Info, Capability, Registrar, App, New, Run)
- testkit: in-memory test harness (Harness, ResultText, DecodeToolResult,
  EventuallyContains, AssertToolSet)
- examples/minimal: hello-tool server over stdio
- tests across all packages, e2e seam proof in mcpkit_test.go

Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>

169 of 230 new or added lines in 10 files covered. (73.48%)

169 of 230 relevant lines covered (73.48%)

0.79 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

96.0
/testkit/assert.go
1
package testkit
2

3
import (
4
        "context"
5
        "encoding/json"
6
        "testing"
7
        "time"
8

9
        "github.com/dangernoodle-io/mcpkit/mcpx"
10
        "github.com/stretchr/testify/assert"
11
        "github.com/stretchr/testify/require"
12
)
13

14
// ResultText concatenates the text content of a CallToolResult.
15
var ResultText = mcpx.ResultText
16

17
// DecodeToolResult json-unmarshals a tool result's text content into T,
18
// failing the test on decode error.
19
func DecodeToolResult[T any](t testing.TB, res *mcpx.CallToolResult) T {
1✔
20
        t.Helper()
1✔
21
        var out T
1✔
22
        err := json.Unmarshal([]byte(mcpx.ResultText(res)), &out)
1✔
23
        require.NoError(t, err, "decode tool result")
1✔
24
        return out
1✔
25
}
1✔
26

27
// EventuallyContains polls fn until it returns a slice containing want, or
28
// fails the test after timeout.
29
func EventuallyContains(t testing.TB, timeout, interval time.Duration, fn func() []string, want string) {
1✔
30
        t.Helper()
1✔
31
        require.Eventually(t, func() bool {
2✔
32
                for _, got := range fn() {
2✔
33
                        if got == want {
2✔
34
                                return true
1✔
35
                        }
1✔
36
                }
NEW
37
                return false
×
38
        }, timeout, interval, "expected %q to eventually appear", want)
39
}
40

41
// AssertToolSet asserts that the app's advertised tools/list is exactly
42
// want, guarding against silent drift.
43
func AssertToolSet(t testing.TB, h *Harness, want ...string) {
1✔
44
        t.Helper()
1✔
45
        res, err := h.ListTools(context.Background())
1✔
46
        require.NoError(t, err, "list tools")
1✔
47

1✔
48
        got := make([]string, 0, len(res.Tools))
1✔
49
        for _, tool := range res.Tools {
2✔
50
                got = append(got, tool.Name)
1✔
51
        }
1✔
52
        assert.ElementsMatch(t, want, got, "tool set drift")
1✔
53
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE TRIAL · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc