Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion cmd/thv/app/mcp.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@ import (
"text/tabwriter"
"time"

"github.com/mark3labs/mcp-go/mcp"
"github.com/spf13/cobra"

"github.com/stacklok/toolhive-core/mcpcompat/mcp"
thclient "github.com/stacklok/toolhive/pkg/mcp/client"
"github.com/stacklok/toolhive/pkg/workloads"
)
Expand Down
2 changes: 1 addition & 1 deletion cmd/thv/app/mcp_call.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@ import (
"os"
"time"

"github.com/mark3labs/mcp-go/mcp"
"github.com/spf13/cobra"

"github.com/stacklok/toolhive-core/mcpcompat/mcp"
thclient "github.com/stacklok/toolhive/pkg/mcp/client"
)

Expand Down
3 changes: 2 additions & 1 deletion cmd/thv/app/mcp_call_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,10 @@ import (
"strings"
"testing"

"github.com/mark3labs/mcp-go/mcp"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"

"github.com/stacklok/toolhive-core/mcpcompat/mcp"
)

func TestReadToolArgs(t *testing.T) {
Expand Down
5 changes: 3 additions & 2 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ require (
github.com/google/uuid v1.6.0
github.com/lestrrat-go/httprc/v3 v3.0.6
github.com/lestrrat-go/jwx/v3 v3.0.13
github.com/mark3labs/mcp-go v0.55.1
github.com/mark3labs/mcp-go v0.55.1 // indirect
github.com/moby/moby/client v0.4.1
github.com/modelcontextprotocol/registry v1.7.9
github.com/oauth2-proxy/mockoidc v0.0.0-20240214162133-caebfff84d25
Expand Down Expand Up @@ -89,8 +89,9 @@ require (
github.com/aws/aws-sdk-go-v2/internal/v4a v1.4.31 // indirect
github.com/go-openapi/runtime/server-middleware v0.30.0 // indirect
github.com/klauspost/cpuid/v2 v2.3.0 // indirect
github.com/modelcontextprotocol/go-sdk v1.6.1 // indirect
github.com/oklog/ulid/v2 v2.1.1 // indirect
github.com/santhosh-tekuri/jsonschema/v6 v6.0.2 // indirect
github.com/segmentio/encoding v0.5.4 // indirect
github.com/youmark/pkcs8 v0.0.0-20240726163527-a2c0da244d78 // indirect
)

Expand Down
8 changes: 4 additions & 4 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -183,8 +183,6 @@ github.com/digitorus/timestamp v0.0.0-20231217203849-220c5c2851b7 h1:lxmTCgmHE1G
github.com/digitorus/timestamp v0.0.0-20231217203849-220c5c2851b7/go.mod h1:GvWntX9qiTlOud0WkQ6ewFm0LPy5JUR1Xo0Ngbd1w6Y=
github.com/distribution/reference v0.6.0 h1:0IXCQ5g4/QMHHkarYzh5l+u8T3t73zM5QvfrDyIgxBk=
github.com/distribution/reference v0.6.0/go.mod h1:BbU0aIcezP1/5jX/8MP0YiH4SdvB5Y4f/wlDRiLyi3E=
github.com/dlclark/regexp2 v1.11.0 h1:G/nrcoOa7ZXlpoa/91N3X7mM3r8eIlMBBJZvsz/mxKI=
github.com/dlclark/regexp2 v1.11.0/go.mod h1:DHkYz0B9wPfa6wondMfaivmHpzrQ3v9q8cnmRbL6yW8=
github.com/docker/cli v29.6.0+incompatible h1:nw9himxMMZ7eIeherJNlKQq+acnlzGgHd+4uf10QRSc=
github.com/docker/cli v29.6.0+incompatible/go.mod h1:JLrzqnKDaYBop7H2jaqPtU4hHvMKP+vjCwu2uszcLI8=
github.com/docker/docker-credential-helpers v0.9.3 h1:gAm/VtF9wgqJMoxzT3Gj5p4AqIjCBS4wrsOh9yRqcz8=
Expand Down Expand Up @@ -607,6 +605,8 @@ github.com/moby/sys/userns v0.1.0 h1:tVLXkFOxVu9A64/yh59slHVv9ahO9UIev4JZusOLG/g
github.com/moby/sys/userns v0.1.0/go.mod h1:IHUYgu/kao6N8YZlp9Cf444ySSvCmDlmzUcYfDHOl28=
github.com/moby/term v0.5.2 h1:6qk3FJAFDs6i/q3W/pQ97SX192qKfZgGjCQqfCJkgzQ=
github.com/moby/term v0.5.2/go.mod h1:d3djjFCrjnB+fl8NJux+EJzu0msscUP+f8it8hPkFLc=
github.com/modelcontextprotocol/go-sdk v1.6.1 h1:0zOSupjKUxPKSocPT1Wtago+mUHU2/uZ4xSOY0FGReU=
github.com/modelcontextprotocol/go-sdk v1.6.1/go.mod h1:kzm3kzFL1/+AziGOE0nUs3gvPoNxMCvkxokMkuFapXQ=
github.com/modelcontextprotocol/registry v1.7.9 h1:vpPfx2A2egjhm6YlbwfkX8NkR2N0S2eYmvYXI8bXaBs=
github.com/modelcontextprotocol/registry v1.7.9/go.mod h1:y03zY98e+REsiCaj1sUKzXbk3qEp++Y3gzAnV83wrNs=
github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q=
Expand Down Expand Up @@ -718,8 +718,6 @@ github.com/ryanuber/go-glob v1.0.0 h1:iQh3xXAumdQ+4Ufa5b25cRpC5TYKlno6hsv6Cb3pkB
github.com/ryanuber/go-glob v1.0.0/go.mod h1:807d1WSdnB0XRJzKNil9Om6lcp/3a0v4qIHxIXzX/Yc=
github.com/sagikazarmark/locafero v0.11.0 h1:1iurJgmM9G3PA/I+wWYIOw/5SyBtxapeHDcg+AAIFXc=
github.com/sagikazarmark/locafero v0.11.0/go.mod h1:nVIGvgyzw595SUSUE6tvCp3YYTeHs15MvlmU87WwIik=
github.com/santhosh-tekuri/jsonschema/v6 v6.0.2 h1:KRzFb2m7YtdldCEkzs6KqmJw4nqEVZGK7IN2kJkjTuQ=
github.com/santhosh-tekuri/jsonschema/v6 v6.0.2/go.mod h1:JXeL+ps8p7/KNMjDQk3TCwPpBy0wYklyWTfbkIzdIFU=
github.com/sassoftware/relic v7.2.1+incompatible h1:Pwyh1F3I0r4clFJXkSI8bOyJINGqpgjJU3DYAZeI05A=
github.com/sassoftware/relic v7.2.1+incompatible/go.mod h1:CWfAxv73/iLZ17rbyhIEq3K9hs5w6FpNMdUT//qR+zk=
github.com/sassoftware/relic/v7 v7.6.2 h1:rS44Lbv9G9eXsukknS4mSjIAuuX+lMq/FnStgmZlUv4=
Expand All @@ -731,6 +729,8 @@ github.com/secure-systems-lab/go-securesystemslib v0.11.0 h1:iuCR9kcMFD4QurdKrGv
github.com/secure-systems-lab/go-securesystemslib v0.11.0/go.mod h1:+PMOTjUGwHj2vcZ+TFKlb1tXRbrdWE1LYDT5i9JC80Q=
github.com/segmentio/asm v1.2.1 h1:DTNbBqs57ioxAD4PrArqftgypG4/qNpXoJx8TVXxPR0=
github.com/segmentio/asm v1.2.1/go.mod h1:BqMnlJP91P8d+4ibuonYZw9mfnzI9HfxselHZr5aAcs=
github.com/segmentio/encoding v0.5.4 h1:OW1VRern8Nw6ITAtwSZ7Idrl3MXCFwXHPgqESYfvNt0=
github.com/segmentio/encoding v0.5.4/go.mod h1:HS1ZKa3kSN32ZHVZ7ZLPLXWvOVIiZtyJnO1gPH1sKt0=
github.com/sergi/go-diff v1.2.0/go.mod h1:STckp+ISIX8hZLjrqAeVduY0gWCT9IjLuqbuNXdaHfM=
github.com/sergi/go-diff v1.4.0 h1:n/SP9D5ad1fORl+llWyN+D6qoUETXNZARKjyY2/KVCw=
github.com/sergi/go-diff v1.4.0/go.mod h1:A0bzQcvG0E7Rwjx0REVgAGH58e96+X0MeOfepqsbeW4=
Expand Down
3 changes: 1 addition & 2 deletions pkg/authz/annotation_cache.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,7 @@ package authz
import (
"sync"

"github.com/mark3labs/mcp-go/mcp"

"github.com/stacklok/toolhive-core/mcpcompat/mcp"
"github.com/stacklok/toolhive/pkg/authz/authorizers"
)

Expand Down
2 changes: 1 addition & 1 deletion pkg/authz/annotation_cache_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@ import (
"sync"
"testing"

"github.com/mark3labs/mcp-go/mcp"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"

"github.com/stacklok/toolhive-core/mcpcompat/mcp"
"github.com/stacklok/toolhive/pkg/authz/authorizers"
)

Expand Down
2 changes: 1 addition & 1 deletion pkg/authz/integration_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,11 @@ import (
"testing"

"github.com/golang-jwt/jwt/v5"
"github.com/mark3labs/mcp-go/mcp"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
"golang.org/x/exp/jsonrpc2"

"github.com/stacklok/toolhive-core/mcpcompat/mcp"
"github.com/stacklok/toolhive/pkg/auth"
"github.com/stacklok/toolhive/pkg/authz/authorizers/cedar"
mcpparser "github.com/stacklok/toolhive/pkg/mcp"
Expand Down
2 changes: 1 addition & 1 deletion pkg/authz/middleware_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,12 @@ import (
"testing"

"github.com/golang-jwt/jwt/v5"
"github.com/mark3labs/mcp-go/mcp"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
"go.uber.org/mock/gomock"
"golang.org/x/exp/jsonrpc2"

"github.com/stacklok/toolhive-core/mcpcompat/mcp"
"github.com/stacklok/toolhive/pkg/auth"
"github.com/stacklok/toolhive/pkg/authz/authorizers"
"github.com/stacklok/toolhive/pkg/authz/authorizers/cedar"
Expand Down
2 changes: 1 addition & 1 deletion pkg/authz/response_filter.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@ import (
"net/http"
"strings"

"github.com/mark3labs/mcp-go/mcp"
"golang.org/x/exp/jsonrpc2"

"github.com/stacklok/toolhive-core/mcpcompat/mcp"
"github.com/stacklok/toolhive/pkg/authz/authorizers"
"github.com/stacklok/toolhive/pkg/vmcp/optimizer"
"github.com/stacklok/toolhive/pkg/vmcp/session/optimizerdec"
Expand Down
2 changes: 1 addition & 1 deletion pkg/authz/response_filter_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,11 @@ import (
"testing"

"github.com/golang-jwt/jwt/v5"
"github.com/mark3labs/mcp-go/mcp"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
"golang.org/x/exp/jsonrpc2"

"github.com/stacklok/toolhive-core/mcpcompat/mcp"
"github.com/stacklok/toolhive/pkg/auth"
"github.com/stacklok/toolhive/pkg/authz/authorizers/cedar"
mcpparser "github.com/stacklok/toolhive/pkg/mcp"
Expand Down
3 changes: 1 addition & 2 deletions pkg/authz/tool_filter.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,7 @@ import (
"context"
"log/slog"

"github.com/mark3labs/mcp-go/mcp"

"github.com/stacklok/toolhive-core/mcpcompat/mcp"
"github.com/stacklok/toolhive/pkg/authz/authorizers"
)

Expand Down
2 changes: 1 addition & 1 deletion pkg/authz/tool_filter_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,10 @@ import (
"errors"
"testing"

"github.com/mark3labs/mcp-go/mcp"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"

"github.com/stacklok/toolhive-core/mcpcompat/mcp"
"github.com/stacklok/toolhive/pkg/auth"
"github.com/stacklok/toolhive/pkg/authz/authorizers"
"github.com/stacklok/toolhive/pkg/authz/authorizers/cedar"
Expand Down
2 changes: 1 addition & 1 deletion pkg/mcp/client/call.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import (
"fmt"
"log/slog"

"github.com/mark3labs/mcp-go/mcp"
"github.com/stacklok/toolhive-core/mcpcompat/mcp"
)

// CallTool connects to the MCP server at serverURL, performs the initialize
Expand Down
5 changes: 2 additions & 3 deletions pkg/mcp/client/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,8 @@ import (
"net/url"
"strings"

mcpclient "github.com/mark3labs/mcp-go/client"
"github.com/mark3labs/mcp-go/mcp"

mcpclient "github.com/stacklok/toolhive-core/mcpcompat/client"
"github.com/stacklok/toolhive-core/mcpcompat/mcp"
"github.com/stacklok/toolhive/pkg/transport/ssecommon"
"github.com/stacklok/toolhive/pkg/transport/streamable"
"github.com/stacklok/toolhive/pkg/transport/types"
Expand Down
7 changes: 4 additions & 3 deletions pkg/mcp/parser_integration_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,12 @@ import (
"testing"
"time"

"github.com/mark3labs/mcp-go/client"
"github.com/mark3labs/mcp-go/mcp"
"github.com/mark3labs/mcp-go/server"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"

"github.com/stacklok/toolhive-core/mcpcompat/client"
"github.com/stacklok/toolhive-core/mcpcompat/mcp"
"github.com/stacklok/toolhive-core/mcpcompat/server"
)

// TestParsingMiddlewareWithRealMCPClients tests the parsing middleware with real MCP clients and servers
Expand Down
2 changes: 1 addition & 1 deletion pkg/script/executor.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@ import (
"fmt"
"strings"

"github.com/mark3labs/mcp-go/mcp"
"go.starlark.net/starlark"

"github.com/stacklok/toolhive-core/mcpcompat/mcp"
"github.com/stacklok/toolhive/pkg/script/internal/builtins"
"github.com/stacklok/toolhive/pkg/script/internal/conversions"
"github.com/stacklok/toolhive/pkg/script/internal/core"
Expand Down
2 changes: 1 addition & 1 deletion pkg/script/internal/builtins/builtins.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@ import (
"context"
"log/slog"

"github.com/mark3labs/mcp-go/mcp"
"go.starlark.net/starlark"

"github.com/stacklok/toolhive-core/mcpcompat/mcp"
"github.com/stacklok/toolhive/pkg/script/internal/conversions"
)

Expand Down
2 changes: 1 addition & 1 deletion pkg/script/internal/builtins/builtins_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,10 @@ import (
"testing"
"time"

"github.com/mark3labs/mcp-go/mcp"
"github.com/stretchr/testify/require"
"go.starlark.net/starlark"

"github.com/stacklok/toolhive-core/mcpcompat/mcp"
"github.com/stacklok/toolhive/pkg/script/internal/core"
)

Expand Down
2 changes: 1 addition & 1 deletion pkg/script/internal/builtins/tools.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@ import (
"context"
"fmt"

"github.com/mark3labs/mcp-go/mcp"
"go.starlark.net/starlark"

"github.com/stacklok/toolhive-core/mcpcompat/mcp"
"github.com/stacklok/toolhive/pkg/script/internal/conversions"
)

Expand Down
2 changes: 1 addition & 1 deletion pkg/script/internal/conversions/result.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import (
"fmt"
"log/slog"

"github.com/mark3labs/mcp-go/mcp"
"github.com/stacklok/toolhive-core/mcpcompat/mcp"
)

// ParseToolResult converts an mcp.CallToolResult into a Go value suitable
Expand Down
3 changes: 2 additions & 1 deletion pkg/script/internal/conversions/result_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,9 @@ package conversions
import (
"testing"

"github.com/mark3labs/mcp-go/mcp"
"github.com/stretchr/testify/require"

"github.com/stacklok/toolhive-core/mcpcompat/mcp"
)

func TestParseToolResult(t *testing.T) {
Expand Down
2 changes: 1 addition & 1 deletion pkg/script/script.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ package script
import (
"context"

"github.com/mark3labs/mcp-go/mcp"
"github.com/stacklok/toolhive-core/mcpcompat/mcp"
)

// DefaultStepLimit is the default maximum number of Starlark execution steps.
Expand Down
3 changes: 2 additions & 1 deletion pkg/script/script_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,9 @@ import (
"fmt"
"testing"

"github.com/mark3labs/mcp-go/mcp"
"github.com/stretchr/testify/require"

"github.com/stacklok/toolhive-core/mcpcompat/mcp"
)

func TestExecutor(t *testing.T) {
Expand Down
2 changes: 1 addition & 1 deletion pkg/telemetry/middleware.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,14 @@ import (
"strings"
"time"

"github.com/mark3labs/mcp-go/mcp"
"go.opentelemetry.io/otel"
"go.opentelemetry.io/otel/attribute"
"go.opentelemetry.io/otel/codes"
"go.opentelemetry.io/otel/metric"
"go.opentelemetry.io/otel/propagation"
"go.opentelemetry.io/otel/trace"

"github.com/stacklok/toolhive-core/mcpcompat/mcp"
mcpparser "github.com/stacklok/toolhive/pkg/mcp"
"github.com/stacklok/toolhive/pkg/transport/types"
)
Expand Down
9 changes: 4 additions & 5 deletions pkg/transport/bridge.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,10 @@ import (
"strings"
"sync"

"github.com/mark3labs/mcp-go/client"
"github.com/mark3labs/mcp-go/client/transport"
"github.com/mark3labs/mcp-go/mcp"
"github.com/mark3labs/mcp-go/server"

"github.com/stacklok/toolhive-core/mcpcompat/client"
"github.com/stacklok/toolhive-core/mcpcompat/client/transport"
"github.com/stacklok/toolhive-core/mcpcompat/mcp"
"github.com/stacklok/toolhive-core/mcpcompat/server"
"github.com/stacklok/toolhive/pkg/transport/types"
"github.com/stacklok/toolhive/pkg/versions"
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,12 @@ import (
"testing"
"time"

"github.com/mark3labs/mcp-go/client"
"github.com/mark3labs/mcp-go/mcp"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
"golang.org/x/exp/jsonrpc2"

"github.com/stacklok/toolhive-core/mcpcompat/client"
"github.com/stacklok/toolhive-core/mcpcompat/mcp"
)

const (
Expand Down
4 changes: 2 additions & 2 deletions pkg/tui/inspector.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@ import (

"github.com/charmbracelet/bubbles/textinput"
tea "github.com/charmbracelet/bubbletea"
mcpclient "github.com/mark3labs/mcp-go/client"
"github.com/mark3labs/mcp-go/mcp"

mcpclient "github.com/stacklok/toolhive-core/mcpcompat/client"
"github.com/stacklok/toolhive-core/mcpcompat/mcp"
"github.com/stacklok/toolhive/pkg/core"
)

Expand Down
2 changes: 1 addition & 1 deletion pkg/tui/inspector_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@ import (
"testing"

"github.com/charmbracelet/bubbles/textinput"
"github.com/mark3labs/mcp-go/mcp"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"

"github.com/stacklok/toolhive-core/mcpcompat/mcp"
"github.com/stacklok/toolhive/pkg/core"
)

Expand Down
4 changes: 2 additions & 2 deletions pkg/tui/model.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@ import (

"github.com/charmbracelet/bubbles/textinput"
"github.com/charmbracelet/bubbles/viewport"
mcpclient "github.com/mark3labs/mcp-go/client"
"github.com/mark3labs/mcp-go/mcp"

mcpclient "github.com/stacklok/toolhive-core/mcpcompat/client"
"github.com/stacklok/toolhive-core/mcpcompat/mcp"
regtypes "github.com/stacklok/toolhive-core/registry/types"
"github.com/stacklok/toolhive/pkg/core"
"github.com/stacklok/toolhive/pkg/registry"
Expand Down
Loading
Loading