mcp_api

package
v1.0.13 Latest Latest
Warning

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

Go to latest
Published: Aug 7, 2026 License: AGPL-3.0 Imports: 21 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ContentBlock

type ContentBlock struct {
	Type     string           `json:"type"`
	Text     string           `json:"text"`
	Data     string           `json:"data,omitempty"`
	MimeType string           `json:"mimeType,omitempty"`
	Resource *ResourceContent `json:"resource,omitempty"`
}

type McpHandler

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

func NewMcpHandler

func NewMcpHandler(mcpSvc service.McpService, momSvc service.MomService) *McpHandler

func (*McpHandler) ServeHTTP

func (h *McpHandler) ServeHTTP(writer http.ResponseWriter, request *http.Request)

type OAuthHandler

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

func NewOAuthHandler

func NewOAuthHandler(
	authSvc service.AuthService,
	vaultSvc service.VaultService,
	mcpSvc service.McpService,
	pendingCodes repository.PendingAuthCodes,
) *OAuthHandler

func (*OAuthHandler) ServeOAuthLogin

func (h *OAuthHandler) ServeOAuthLogin(writer http.ResponseWriter, request *http.Request)

ServeOAuthLogin handles POST /oauth/login — validates Telegram id_token, returns session + vaults.

func (*OAuthHandler) ServeOAuthVault

func (h *OAuthHandler) ServeOAuthVault(writer http.ResponseWriter, request *http.Request)

ServeOAuthVault handles POST /oauth/vault — creates MCP key and returns redirect URL.

func (*OAuthHandler) ServeOAuthVaults

func (h *OAuthHandler) ServeOAuthVaults(writer http.ResponseWriter, r *http.Request)

ServeOAuthVaults handles POST /oauth/vaults — validates existing session and returns vault list.

func (*OAuthHandler) ServeProtectedResourceMeta

func (h *OAuthHandler) ServeProtectedResourceMeta(w http.ResponseWriter, r *http.Request)

ServeProtectedResourceMeta serves GET /.well-known/oauth-protected-resource (RFC 9728).

func (*OAuthHandler) ServeRegistration

func (h *OAuthHandler) ServeRegistration(writer http.ResponseWriter, r *http.Request)

ServeRegistration handles POST /register (RFC 7591 dynamic client registration).

func (*OAuthHandler) ServeToken

func (h *OAuthHandler) ServeToken(writer http.ResponseWriter, r *http.Request)

ServeToken handles POST /token — PKCE verification and returns access token.

func (*OAuthHandler) WellKnown

func (h *OAuthHandler) WellKnown(w http.ResponseWriter, r *http.Request)

WellKnown serves GET /.well-known/oauth-authorization-server.

type ResourceContent

type ResourceContent struct {
	Uri      string `json:"uri"`
	MimeType string `json:"mimeType"`
	Blob     string `json:"blob"`
}

type ToolDef

type ToolDef struct {
	Name         string                 `json:"name"`
	Description  string                 `json:"description"`
	InputSchema  map[string]interface{} `json:"inputSchema"`
	OutputSchema map[string]interface{} `json:"outputSchema,omitempty"`
}

type ToolResult

type ToolResult struct {
	Content []ContentBlock `json:"content"`
}

Jump to

Keyboard shortcuts

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