Documentation
¶
Overview ¶
Package mcpserver is the local MCP server behind `audd mcp`. It speaks MCP over stdio and runs each tool as the matching audd command in the same process, so tools use the same token, profile, cache, limits, and stream store as the CLI.
Index ¶
Constants ¶
const Instructions = `` /* 906-byte string literal not displayed */
Instructions tell the client's model how to use the tools.
const NoConsentFlag = "--no-consent-prompt"
NoConsentFlag is the hidden billing flag that fails with instructions instead of opening a browser to approve payment access.
Variables ¶
var Providers = []string{"apple_music", "spotify", "deezer", "musicbrainz"}
Providers are the valid values of recognize's "return".
var TokenRotateInstructions = map[string]any{ "action_required": "Rotating the API token disables the current token at once, so only the user can do it. Ask them to run the command below in a terminal. If audd is signed in, it stores the new token for audd automatically; other places that use the old token need the new one.", "command": "audd token rotate", "done": false, }
TokenRotateInstructions is what token_rotate returns.
Functions ¶
func Serve ¶
func Serve(ctx context.Context, opts Options, in io.ReadCloser, out io.WriteCloser) error
Serve runs the server on in/out until the client disconnects or ctx ends.
Types ¶
type Options ¶
type Options struct {
// Run executes audd commands. Required.
Run Runner
// Version is reported to clients.
Version string
// Stat checks local paths; defaults to os.Stat.
Stat func(string) (os.FileInfo, error)
}
Options configure the server.
type Runner ¶
Runner runs an audd command (arguments without the program name) with JSON output and no terminal.