diff --git a/pkg/probod/probod.go b/pkg/probod/probod.go index a77fdd655..dcec261ba 100644 --- a/pkg/probod/probod.go +++ b/pkg/probod/probod.go @@ -417,7 +417,7 @@ func (impl *Implm) Run( CookieSecure: impl.cfg.Auth.Cookie.Secure, }, MCPConfig: api.MCPConfig{ - Version: "1.0.0", + Version: "0.0.1", RequestTimeout: 30 * time.Second, MaxRequestSize: 10 * 1024 * 1024, // 10MB }, diff --git a/pkg/server/api/api.go b/pkg/server/api/api.go index bd87882cc..1d4336f88 100644 --- a/pkg/server/api/api.go +++ b/pkg/server/api/api.go @@ -72,7 +72,6 @@ type ( Logger *log.Logger } - // MCPConfig holds configuration for MCP MCPConfig struct { Version string RequestTimeout time.Duration diff --git a/pkg/server/api/mcp/v1/types.go b/pkg/server/api/mcp/v1/types.go index 94445888f..9567b814b 100644 --- a/pkg/server/api/mcp/v1/types.go +++ b/pkg/server/api/mcp/v1/types.go @@ -22,17 +22,12 @@ import ( ) type ( - // Config holds configuration for the MCP server Config struct { - // Version is the MCP server version - Version string - // RequestTimeout is the maximum duration for a request + Version string RequestTimeout time.Duration - // MaxRequestSize is the maximum size of a request body in bytes MaxRequestSize int64 } - // MCPContext holds the authenticated context for MCP requests MCPContext struct { UserID gid.GID TenantIDs []gid.TenantID @@ -45,18 +40,15 @@ var ( mcpContextKey = &ctxKey{name: "mcp_context"} ) -// MCPContextFromContext extracts the MCP context from the request context func MCPContextFromContext(ctx context.Context) *MCPContext { mcpCtx, _ := ctx.Value(mcpContextKey).(*MCPContext) return mcpCtx } -// ContextWithMCPContext adds the MCP context to the request context func ContextWithMCPContext(ctx context.Context, mcpCtx *MCPContext) context.Context { return context.WithValue(ctx, mcpContextKey, mcpCtx) } -// DefaultConfig returns a default MCP configuration func DefaultConfig() Config { return Config{ Version: "1.0.0", diff --git a/pkg/server/api/mcp/v1/types/organization.go b/pkg/server/api/mcp/v1/types/organization.go index f5ebf0531..b18e86fe3 100644 --- a/pkg/server/api/mcp/v1/types/organization.go +++ b/pkg/server/api/mcp/v1/types/organization.go @@ -14,11 +14,8 @@ package types -// ListOrganizationsInput defines the input parameters for listOrganizations tool -// Empty struct since no arguments are required type ListOrganizationsInput struct{} -// ListOrganizationsOutput defines the output structure for listOrganizations tool type ListOrganizationsOutput struct { Organizations []Organization `json:"organizations" jsonschema:"list of organizations the user has access to"` } diff --git a/pkg/server/api/mcp/v1/types/types.go b/pkg/server/api/mcp/v1/types/types.go index d9f864aa6..f9de9006a 100644 --- a/pkg/server/api/mcp/v1/types/types.go +++ b/pkg/server/api/mcp/v1/types/types.go @@ -16,14 +16,12 @@ package types import "go.probo.inc/probo/pkg/coredata" -// Organization represents a single organization in MCP responses type Organization struct { Name string `json:"name" jsonschema:"the organization name"` ID string `json:"id" jsonschema:"the organization ID"` TenantID string `json:"tenantID" jsonschema:"the tenant ID this organization belongs to"` } -// NewOrganization converts a coredata.Organization to an MCP Organization func NewOrganization(o *coredata.Organization) Organization { return Organization{ Name: o.Name, diff --git a/pkg/server/api/mcp/v1/types/vendor.go b/pkg/server/api/mcp/v1/types/vendor.go index 2ea95d5d5..9d5daa3b2 100644 --- a/pkg/server/api/mcp/v1/types/vendor.go +++ b/pkg/server/api/mcp/v1/types/vendor.go @@ -136,28 +136,28 @@ var ( VendorCategorySchema = &jsonschema.Schema{ Type: "string", Enum: []any{ - "ANALYTICS", - "CLOUD_MONITORING", - "CLOUD_PROVIDER", - "COLLABORATION", - "CUSTOMER_SUPPORT", - "DATA_STORAGE_AND_PROCESSING", - "DOCUMENT_MANAGEMENT", - "EMPLOYEE_MANAGEMENT", - "ENGINEERING", - "FINANCE", - "IDENTITY_PROVIDER", - "IT", - "MARKETING", - "OFFICE_OPERATIONS", - "OTHER", - "PASSWORD_MANAGEMENT", - "PRODUCT_AND_DESIGN", - "PROFESSIONAL_SERVICES", - "RECRUITING", - "SALES", - "SECURITY", - "VERSION_CONTROL", + coredata.VendorCategoryAnalytics.String(), + coredata.VendorCategoryCloudMonitoring.String(), + coredata.VendorCategoryCloudProvider.String(), + coredata.VendorCategoryCollaboration.String(), + coredata.VendorCategoryCustomerSupport.String(), + coredata.VendorCategoryDataStorageAndProcessing.String(), + coredata.VendorCategoryDocumentManagement.String(), + coredata.VendorCategoryEmployeeManagement.String(), + coredata.VendorCategoryEngineering.String(), + coredata.VendorCategoryFinance.String(), + coredata.VendorCategoryIdentityProvider.String(), + coredata.VendorCategoryIT.String(), + coredata.VendorCategoryMarketing.String(), + coredata.VendorCategoryOfficeOperations.String(), + coredata.VendorCategoryOther.String(), + coredata.VendorCategoryPasswordManagement.String(), + coredata.VendorCategoryProductAndDesign.String(), + coredata.VendorCategoryProfessionalServices.String(), + coredata.VendorCategoryRecruiting.String(), + coredata.VendorCategorySales.String(), + coredata.VendorCategorySecurity.String(), + coredata.VendorCategoryVersionControl.String(), }, }