Skip to main content
Glama

Portainer MCP

Official
by portainer
zlib License
67
  • Linux
  • Apple
client_test.go1.44 kB
package client import ( "testing" "github.com/stretchr/testify/assert" ) func TestNewPortainerClient(t *testing.T) { tests := []struct { name string serverURL string token string opts []ClientOption expectError bool }{ { name: "creates client with default options", serverURL: "https://portainer.example.com", token: "test-token", opts: nil, }, { name: "creates client with skip TLS verify", serverURL: "https://portainer.example.com", token: "test-token", opts: []ClientOption{WithSkipTLSVerify(true)}, }, } for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { // Create client c := NewPortainerClient(tt.serverURL, tt.token, tt.opts...) // Assert client was created assert.NotNil(t, c) assert.NotNil(t, c.cli) }) } } func TestWithSkipTLSVerify(t *testing.T) { tests := []struct { name string skip bool expected bool }{ { name: "enables TLS verification skip", skip: true, expected: true, }, { name: "disables TLS verification skip", skip: false, expected: false, }, } for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { // Create options options := &clientOptions{} opt := WithSkipTLSVerify(tt.skip) opt(options) // Assert option was applied correctly assert.Equal(t, tt.expected, options.skipTLSVerify) }) } }

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/portainer/portainer-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server