Documentation
¶
Index ¶
- Constants
- type Factory
- type Function
- func (c *Function[A, B]) AllowAccessApiKey(api *scud.AuthorizerBasic)
- func (c *Function[A, B]) AllowAccessIAM(api *scud.AuthorizerIAM, principal awsiam.IGrantable)
- func (c *Function[A, B]) AllowAccessJWT(api *scud.AuthorizerJwt, scope ...string)
- func (c *Function[A, B]) AllowAccessPublic(api *scud.AuthorizerPublic)
- type FunctionProps
- type Gateway
- func (c *Gateway) AccessApiKey(access, secret string) *Gateway
- func (c *Gateway) AccessAwsCognito(cognitoArn string, clients ...string) *Gateway
- func (c *Gateway) AccessJWT(issuer string, audience ...string) *Gateway
- func (c *Gateway) AccessPublic() *Gateway
- func (c *Gateway) Build()
- func (c *Gateway) Gateway(props *scud.GatewayProps) *Gateway
- func (c *Gateway) Host(host, certificate string) *Gateway
- func (c *Gateway) Hostless() *Gateway
- type Lambda
- type Server
- type ServerProps
Constants ¶
const Version = "v0.0.1"
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Factory ¶
Factory is a function that constructs instance of MCP Server.
func HelloWorld() (*mcp.Server, error) {
server := mcp.NewServer(...)
mcp.AddTool(server, ...)
return server, nil
}
type Function ¶
type Function[A, B any] struct { Function awslambda.Function // contains filtered or unexported fields }
L3 Construct for MCP Tool Function as AWS Lambda function. This construct assumes a function is running as an instance of MCP Server.
func NewFunction ¶
func NewFunction[A, B any](scope constructs.Construct, id *string, spec *FunctionProps[A, B]) *Function[A, B]
Defines MCP Tool Function as a Lambda function.
func (*Function[A, B]) AllowAccessApiKey ¶
func (c *Function[A, B]) AllowAccessApiKey(api *scud.AuthorizerBasic)
Grants access to the function via given API key authorizer.
func (*Function[A, B]) AllowAccessIAM ¶
func (c *Function[A, B]) AllowAccessIAM(api *scud.AuthorizerIAM, principal awsiam.IGrantable)
Grants access to the function via given IAM authorizer.
func (*Function[A, B]) AllowAccessJWT ¶
func (c *Function[A, B]) AllowAccessJWT(api *scud.AuthorizerJwt, scope ...string)
Grants access to the function via given JWT authorizer.
func (*Function[A, B]) AllowAccessPublic ¶
func (c *Function[A, B]) AllowAccessPublic(api *scud.AuthorizerPublic)
Grants public access to the function via given public authorizer.
type FunctionProps ¶
type FunctionProps[A, B any] struct { *scud.FunctionGoProps Handler Lambda[A, B] About string AutoGen bool }
FunctionProps defines properties for MCP Tool Function as a Lambda function. The properties are type-safe declaration for MCP tool inptut and output types. The construct assumes a function is running as an instance of MCP Server, it performs automatic code generation for binding the function into MCP Server.
func NewFunctionProps ¶
func NewFunctionProps[A, B any](f Lambda[A, B], about string, props *scud.FunctionGoProps) *FunctionProps[A, B]
Helper for NewFunctionProps to support automatic inference of types from function
func (*FunctionProps[A, B]) ForceAutoGen ¶
func (f *FunctionProps[A, B]) ForceAutoGen() *FunctionProps[A, B]
Force regeneration of the function binding code on each deployment.
type Gateway ¶
type Gateway struct {
// contains filtered or unexported fields
}
Serverless MCP Gateway, wraps MCP Server as defined by official Go SDK into AWS API Gateway and Lambda deployment.
func (*Gateway) AccessApiKey ¶
Configures gateway with API Key access, using basic digest authentication with access and secret keys.
func (*Gateway) AccessAwsCognito ¶
Configures gateway with AWS Cognito access, using given user pool ARN and optional list of app clients.
func (*Gateway) AccessJWT ¶
Configures gateway with JWT access, using given issuer and optional list of audiences.
func (*Gateway) AccessPublic ¶
Configures gateway with public access (no authentication).
func (*Gateway) Gateway ¶
func (c *Gateway) Gateway(props *scud.GatewayProps) *Gateway
Configures gateway with custom properties.
type Lambda ¶
type Lambda[A, B any] = func(context.Context, *mcp.CallToolRequest, A) (*mcp.CallToolResult, B, error)
Signature for type-safe entry point to lambda function
type Server ¶
L3 Construct for MCP Server as AWS Lambda function. This construct assumes a function is running an instance of MCP Server.
func NewServer ¶
func NewServer(scope constructs.Construct, id *string, spec *ServerProps) *Server
Defines MCP Server as a Lambda function.
func (*Server) AllowAccessApiKey ¶
func (c *Server) AllowAccessApiKey(api *scud.AuthorizerBasic)
Grants access to the server via given API key authorizer.
func (*Server) AllowAccessIAM ¶
func (c *Server) AllowAccessIAM(api *scud.AuthorizerIAM, principal awsiam.IGrantable)
Grants access to the server via given IAM authorizer.
func (*Server) AllowAccessJWT ¶
func (c *Server) AllowAccessJWT(api *scud.AuthorizerJwt, scope ...string)
Grants access to the server via given JWT authorizer.
func (*Server) AllowAccessPublic ¶
func (c *Server) AllowAccessPublic(api *scud.AuthorizerPublic)
Grants public access to the server via given public authorizer.
type ServerProps ¶
type ServerProps struct {
*scud.FunctionGoProps
Factory Factory
AutoGen bool
}
ServerProps defines properties for MCP Server as a Lambda function. This construct assumes a function is running an instance of MCP Server.
func NewServerProps ¶
func NewServerProps(f Factory, props *scud.FunctionGoProps) *ServerProps
Helper utility to bind scud.FunctionGoProps with MCP Server Factory.
func (*ServerProps) ForceAutoGen ¶
func (f *ServerProps) ForceAutoGen() *ServerProps
Force regeneration of the server binding code on each deployment.
Directories
¶
| Path | Synopsis |
|---|---|
|
examples
|
|
|
helloworld
command
|
|
|
helloworld/server/autogen
command
DO NOT EDIT !!! THE FILE IS AUTO GENERATED BY github.com/fogfish/cloudmcp 2025-10-27 18:38:04.544025 +0200 EET m=+0.841218792
|
DO NOT EDIT !!! THE FILE IS AUTO GENERATED BY github.com/fogfish/cloudmcp 2025-10-27 18:38:04.544025 +0200 EET m=+0.841218792 |
|
serverless
command
|
|
|
serverless/sayer/autogen
command
DO NOT EDIT !!! THE FILE IS AUTO GENERATED BY github.com/fogfish/cloudmcp 2025-10-27 19:04:36.736371 +0200 EET m=+1.380776501
|
DO NOT EDIT !!! THE FILE IS AUTO GENERATED BY github.com/fogfish/cloudmcp 2025-10-27 19:04:36.736371 +0200 EET m=+1.380776501 |
|
internal
|
|