mcp

package
v0.20.0 Latest Latest
Warning

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

Go to latest
Published: Jul 28, 2025 License: BSD-3-Clause Imports: 33 Imported by: 0

Documentation

Overview

Copyright 2025 The Go Authors. All rights reserved. Use of this source code is governed by a BSD-style license that can be found in the LICENSE file.

Copyright 2025 The Go Authors. All rights reserved. Use of this source code is governed by a BSD-style license that can be found in the LICENSE file.

Index

Constants

This section is empty.

Variables

View Source
var Instructions string

Functions

func HTTPHandler

func HTTPHandler(sessions Sessions, isDaemon bool) http.Handler

func Serve

func Serve(ctx context.Context, address string, sessions Sessions, isDaemon bool) error

Serve starts an MCP server serving at the input address. The server receives LSP session events on the specified channel, which the caller is responsible for closing. The server runs until the context is canceled.

func StartStdIO added in v0.20.0

func StartStdIO(ctx context.Context, session *cache.Session, server protocol.Server, rpcLog io.Writer) error

StartStdIO starts an MCP server over stdio.

Types

type ContextParams

type ContextParams struct {
	File string `json:"file"`
}

type Sessions added in v0.20.0

type Sessions interface {
	Session(id string) (*cache.Session, protocol.Server)
	FirstSession() (*cache.Session, protocol.Server)
	SetSessionExitFunc(func(string))
}

Sessions is the interface used to access gopls sessions.

Jump to

Keyboard shortcuts

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