diff --git a/README.md b/README.md index bc61631..d74c2ff 100644 --- a/README.md +++ b/README.md @@ -149,6 +149,16 @@ To set up MCP in Cursor, follow their guide: 👉 [Cursor Documentation on Model Context Protocol](https://docs.cursor.com/context/model-context-protocol) +> [!IMPORTANT] +> Cursor **does not support MCP resources** yet. +This MCP server uses resources heavily, so **it will not work in Cursor** unless you explicitly disable resource usage. + +To make it work, you **must** set the following environment variable: + +``` +FIREBOLT_MCP_DISABLE_RESOURCES=true +``` + #### Using SSE Transport By default, the MCP Server uses STDIO as the transport mechanism. diff --git a/pkg/server/server.go b/pkg/server/server.go index 73651e0..3eb227a 100644 --- a/pkg/server/server.go +++ b/pkg/server/server.go @@ -89,7 +89,6 @@ func NewServer( "tool call finished", slog.Any("id", id), slog.String("tool", message.Params.Name), - slog.Any("any", result.Result), ) }) hooks.AddOnError(func(ctx context.Context, id any, method mcp.MCPMethod, message any, err error) { diff --git a/pkg/tools/docs.go b/pkg/tools/docs.go index bb4bdce..ff8fd04 100644 --- a/pkg/tools/docs.go +++ b/pkg/tools/docs.go @@ -75,8 +75,10 @@ func (t *Docs) Handler(ctx context.Context, request mcp.CallToolRequest) (*mcp.C val, ok := request.GetArguments()["articles"] if ok && val != nil { articleIDs = val.([]any) - } else { - // Default articles to return if none specified + } + + // Default articles to return if none specified + if len(articleIDs) == 0 { articleIDs = append( articleIDs, resources.DocsArticleOverview, // General Firebolt overview diff --git a/pkg/tools/tools.go b/pkg/tools/tools.go index b162732..f97ec18 100644 --- a/pkg/tools/tools.go +++ b/pkg/tools/tools.go @@ -1,14 +1,18 @@ package tools -import "github.com/mark3labs/mcp-go/mcp" +import ( + "github.com/mark3labs/mcp-go/mcp" +) // textOrResourceContent returns a text content if disableResources is true, otherwise returns an embedded resource. func textOrResourceContent(disableResources bool, i mcp.ResourceContents) mcp.Content { if disableResources { - textResource, ok := i.(mcp.TextResourceContents) - if ok { - return mcp.NewTextContent(textResource.Text) + switch resource := i.(type) { + case mcp.TextResourceContents: + return mcp.NewTextContent(resource.Text) + case *mcp.TextResourceContents: + return mcp.NewTextContent(resource.Text) } }