mcp

package
v1.7.0 Latest Latest
Warning

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

Go to latest
Published: Jun 14, 2026 License: Apache-2.0 Imports: 20 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Command = &cobra.Command{
	Use:   "mcp",
	Short: "Run a Model Context Protocol server backed by Synthient",
	Long:  "Run a Model Context Protocol (MCP) server that exposes Synthient lookups as tools for MCP-compatible clients. The server communicates over stdio.",
	Args:  cobra.NoArgs,
	Run: func(cmd *cobra.Command, args []string) {
		config, err := conf.Read()
		if err != nil {
			app.Fatal(err, "failed to read configuration file")
		}

		client, err := auth.SynthientClient(config)
		if err != nil {
			app.Fatal(err, "failed to create synthient client")
		}
		config.ApplyToClient(&client)

		if flags.transport != "stdio" {
			timber.FatalMsg("unsupported transport", timber.A("value", flags.transport), timber.A("valid", "stdio"))
		}

		err = run(cmd.Context(), config, client)
		if err != nil && !errors.Is(err, io.EOF) && !errors.Is(err, context.Canceled) {
			app.Fatal(err, "mcp server exited with an error")
		}
	},
}

Functions

This section is empty.

Types

This section is empty.

Jump to

Keyboard shortcuts

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