dunemcp

package
v0.1.23 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 20, 2026 License: MIT Imports: 8 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package dunemcp calls tools on the Dune MCP server with the CLI's API key.

The CLI uses it for capabilities that the Dune MCP server offers and the REST API does not, so those commands behave exactly like the MCP tools.

Index

Constants

View Source
const Path = "/mcp/v1"

Path is where the Dune API host serves the MCP server.

Variables

This section is empty.

Functions

func Result

func Result(tool string, res *mcp.CallToolResult) (json.RawMessage, error)

Result returns the structured content of a tool result as JSON, or the error the tool reported. A result without structured content falls back to its first text block, which Dune tools fill with the same JSON.

func ToolError added in v0.1.22

func ToolError(tool string, res *mcp.CallToolResult) error

ToolError returns the error a tool result reports, or nil when it reports none.

Types

type Caller

type Caller interface {
	// Call runs a tool and returns its structured result as JSON.
	Call(ctx context.Context, tool string, args map[string]any) (json.RawMessage, error)
}

Caller calls tools on the Dune MCP server.

type Client

type Client struct {
	// contains filtered or unexported fields
}

Client is a Caller that opens one MCP session per call.

func New

func New(host, apiKey string, headers map[string]string, version string) *Client

New returns a Client for the Dune API at host. The API key and headers are sent on every request.

func (*Client) Call

func (c *Client) Call(ctx context.Context, tool string, args map[string]any) (json.RawMessage, error)

Call runs tool with args. A tool that reports an error returns it as a Go error carrying the server's message.

Directories

Path Synopsis
Package dunemcptest provides a fake Dune MCP server for command tests.
Package dunemcptest provides a fake Dune MCP server for command tests.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL