mcp

package
v0.0.0-...-812ebae Latest Latest
Warning

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

Go to latest
Published: Sep 7, 2025 License: MIT Imports: 4 Imported by: 0

Documentation

Overview

Package mcp provides the core MCP server implementation.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	Name        string
	Version     string
	Description string
	LogLevel    slog.Level
}

Config represents the configuration for the MCP server

func DefaultConfig

func DefaultConfig() *Config

DefaultConfig returns a default configuration for the MCP server

type Server

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

Server wraps the MCP SDK server with additional functionality

func NewServer

func NewServer(config *Config) *Server

NewServer creates a new MCP server instance with the given configuration

func (*Server) AddBasicCapabilities

func (s *Server) AddBasicCapabilities() error

AddBasicCapabilities adds basic server capabilities and tools

func (*Server) Close

func (s *Server) Close() error

Close gracefully shuts down the server

func (*Server) GetConfig

func (s *Server) GetConfig() *Config

GetConfig returns the server configuration

func (*Server) GetServer

func (s *Server) GetServer() *mcp.Server

GetServer returns the underlying MCP server instance

func (*Server) Run

func (s *Server) Run(ctx context.Context, transport mcp.Transport) error

Run starts the server with the specified transport

func (*Server) RunStdio

func (s *Server) RunStdio(ctx context.Context) error

RunStdio starts the server with stdio transport (most common for MCP)

Jump to

Keyboard shortcuts

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