cli
foo(param1=typer.Argument(..., help='Primeiro parâmetro do comando FOO.'), param2=typer.Argument(..., help='Segundo parâmetro do comando FOO.'))
¶
Executes the FOO command with two required parameters.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
param1
|
str
|
First parameter for the FOO command. |
Argument(..., help='Primeiro parâmetro do comando FOO.')
|
param2
|
str
|
Second parameter for the FOO command. |
Argument(..., help='Segundo parâmetro do comando FOO.')
|
Returns:
Name | Type | Description |
---|---|---|
None |
None
|
This function does not return any value. |
Source code in src/mcpgateway_client/cli.py
94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 |
|
main_callback(ctx, version=typer.Option(None, '--version', help='Exibe a versão do pacote e sai.', is_eager=True, callback=lambda value: show_version_and_exit() if value else None))
¶
Main callback for the CLI application. Displays the main panel if no subcommand is invoked.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
ctx
|
Context
|
The Typer context object for the CLI invocation. |
required |
Returns:
Name | Type | Description |
---|---|---|
None |
None
|
This function does not return any value. |
Source code in src/mcpgateway_client/cli.py
60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 |
|
register(gateway_url=typer.Option(..., '--gateway-url', '-g', help='Gateway URL to connect to. Ex: ws://localhost:8765/mcp/register'), gateway_auth_token=typer.Option(None, '--auth-token', '-a', help='Set the auth token for the gateway. Ex: Bearer abcdef123456'), stdio=typer.Option(..., '--stdio', '-i', help='Subprocess command to start. Ex: npx -y @modelcontextprotocol/server-filesystem ./'), server_name=typer.Option(..., '--server-name', '-n', help='Server name for registration. Ex: local-mcpserver-001'), header=HEADER_OPTION, log_level=LOG_LEVEL, dry_run=DRY_RUN)
¶
Executes the REGISTER command with required and optional parameters.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
gateway_url
|
str
|
URL do gateway para conexão. |
Option(..., '--gateway-url', '-g', help='Gateway URL to connect to. Ex: ws://localhost:8765/mcp/register')
|
gateway_auth_token
|
str
|
Token de autenticação. |
Option(None, '--auth-token', '-a', help='Set the auth token for the gateway. Ex: Bearer abcdef123456')
|
stdio
|
str
|
Comando subprocesso. |
Option(..., '--stdio', '-i', help='Subprocess command to start. Ex: npx -y @modelcontextprotocol/server-filesystem ./')
|
server_name
|
str
|
Nome do servidor. |
Option(..., '--server-name', '-n', help='Server name for registration. Ex: local-mcpserver-001')
|
header
|
str
|
Headers HTTP. |
HEADER_OPTION
|
Usage Examples
cli register \ --gateway-url https://gateway.snapby.com \ --auth-token "Bearer abcdef123456" \ --stdio "/usr/local/bin/mcpserve" \ --server-name "snapby-server-001"
cli register -g https://localhost:8080 -i ./run.sh -n dev-env \ -h "Authorization: Bearer devtoken" -h "X-Custom-Header: test"
Returns:
Name | Type | Description |
---|---|---|
None |
None
|
Esta função não retorna valor. |
Source code in src/mcpgateway_client/cli.py
112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 |
|
show_version_and_exit()
¶
Exibe versão usando Rich e sai.
Source code in src/mcpgateway_client/cli.py
47 48 49 50 51 52 53 54 55 56 57 |
|