mcp_server

package
v0.1.8 Latest Latest
Warning

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

Go to latest
Published: Jan 7, 2026 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CreateMCPServerRequest

type CreateMCPServerRequest struct {
	Name     string     `json:"name" validate:"required,min=1,max=255"`
	Endpoint string     `json:"endpoint" validate:"required,min=1,max=500,url"`
	Headers  HeadersMap `json:"headers" validate:"omitempty"`
}

CreateMCPServerRequest represents the request to create a new MCP server

type HeadersMap

type HeadersMap map[string]string

HeadersMap represents a map of headers that can be stored in JSONB

func (HeadersMap) MarshalJSON

func (h HeadersMap) MarshalJSON() ([]byte, error)

MarshalJSON implements json.Marshaler

func (*HeadersMap) Scan

func (h *HeadersMap) Scan(value interface{}) error

Scan implements the sql.Scanner interface for database/sql

func (*HeadersMap) UnmarshalJSON

func (h *HeadersMap) UnmarshalJSON(data []byte) error

UnmarshalJSON implements json.Unmarshaler

func (HeadersMap) Value

func (h HeadersMap) Value() (driver.Value, error)

Value implements the driver.Valuer interface for database/sql

type MCPServer

type MCPServer struct {
	ID        uuid.UUID  `json:"id" db:"id"`
	Name      string     `json:"name" db:"name"`
	Endpoint  string     `json:"endpoint" db:"endpoint"`
	Headers   HeadersMap `json:"headers" db:"headers"`
	ProjectID uuid.UUID  `json:"project_id" db:"project_id"`
	CreatedAt time.Time  `json:"created_at" db:"created_at"`
	UpdatedAt time.Time  `json:"updated_at" db:"updated_at"`
}

MCPServer represents an MCP server configuration

type MCPServerRepo

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

MCPServerRepo handles database operations for MCP servers

func NewMCPServerRepo

func NewMCPServerRepo(db *sqlx.DB) *MCPServerRepo

NewMCPServerRepo creates a new MCP server repository

func (*MCPServerRepo) Create

func (r *MCPServerRepo) Create(ctx context.Context, projectId uuid.UUID, req *CreateMCPServerRequest) (*MCPServer, error)

Create creates a new MCP server

func (*MCPServerRepo) Delete

func (r *MCPServerRepo) Delete(ctx context.Context, projectId uuid.UUID, id uuid.UUID) error

Delete deletes an MCP server

func (*MCPServerRepo) GetByID

func (r *MCPServerRepo) GetByID(ctx context.Context, projectId uuid.UUID, id uuid.UUID) (*MCPServer, error)

GetByID retrieves an MCP server by ID

func (*MCPServerRepo) GetByIDs

func (r *MCPServerRepo) GetByIDs(ctx context.Context, projectId uuid.UUID, ids []uuid.UUID) (map[uuid.UUID]*MCPServer, error)

GetByIDs retrieves multiple MCP servers by IDs in a single query

func (*MCPServerRepo) GetByName

func (r *MCPServerRepo) GetByName(ctx context.Context, projectId uuid.UUID, name string) (*MCPServer, error)

GetByName retrieves an MCP server by name

func (*MCPServerRepo) List

func (r *MCPServerRepo) List(ctx context.Context, projectId uuid.UUID) ([]*MCPServer, error)

List retrieves all MCP servers

func (*MCPServerRepo) Update

func (r *MCPServerRepo) Update(ctx context.Context, projectId uuid.UUID, id uuid.UUID, req *UpdateMCPServerRequest) (*MCPServer, error)

Update updates an MCP server

type MCPServerService

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

MCPServerService handles business logic for MCP servers

func NewMCPServerService

func NewMCPServerService(repo *MCPServerRepo) *MCPServerService

NewMCPServerService creates a new MCP server service

func (*MCPServerService) Create

func (s *MCPServerService) Create(ctx context.Context, projectID uuid.UUID, req *CreateMCPServerRequest) (*MCPServer, error)

Create creates a new MCP server

func (*MCPServerService) Delete

func (s *MCPServerService) Delete(ctx context.Context, projectID uuid.UUID, id uuid.UUID) error

Delete deletes an MCP server

func (*MCPServerService) GetByID

func (s *MCPServerService) GetByID(ctx context.Context, projectID uuid.UUID, id uuid.UUID) (*MCPServer, error)

GetByID retrieves an MCP server by ID

func (*MCPServerService) GetByIDs

func (s *MCPServerService) GetByIDs(ctx context.Context, projectID uuid.UUID, ids []uuid.UUID) (map[uuid.UUID]*MCPServer, error)

GetByIDs retrieves multiple MCP servers by IDs in a single query

func (*MCPServerService) GetByName

func (s *MCPServerService) GetByName(ctx context.Context, projectID uuid.UUID, name string) (*MCPServer, error)

GetByName retrieves an MCP server by name

func (*MCPServerService) List

func (s *MCPServerService) List(ctx context.Context, projectID uuid.UUID) ([]*MCPServer, error)

List retrieves all MCP servers

func (*MCPServerService) Update

func (s *MCPServerService) Update(ctx context.Context, projectID uuid.UUID, id uuid.UUID, req *UpdateMCPServerRequest) (*MCPServer, error)

Update updates an MCP server

type UpdateMCPServerRequest

type UpdateMCPServerRequest struct {
	Name     *string     `json:"name,omitempty" validate:"omitempty,min=1,max=255"`
	Endpoint *string     `json:"endpoint,omitempty" validate:"omitempty,min=1,max=500,url"`
	Headers  *HeadersMap `json:"headers,omitempty"`
}

UpdateMCPServerRequest represents the request to update an MCP server

Jump to

Keyboard shortcuts

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