mirror of
https://github.com/invariantlabs-ai/invariant-gateway.git
synced 2026-07-06 19:07:50 +02:00
Rename dataset-name flag for MCP to project-name and change CLI command to run mcp
This commit is contained in:
@@ -35,9 +35,9 @@ You need to:
|
||||
"--refresh",
|
||||
"--from",
|
||||
"/ABSOLUTE/PATH/TO/INVARIANT_GATEWAY_REPO/dist/invariant_gateway-0.0.1-py3-none-any.whl",
|
||||
"invariant-gateway",
|
||||
"run",
|
||||
"mcp",
|
||||
"--dataset-name",
|
||||
"--project-name",
|
||||
"weather-testing",
|
||||
"--push-explorer",
|
||||
"--exec",
|
||||
@@ -59,5 +59,5 @@ This moves the original `command` and `args` to the `args` list after the `--exe
|
||||
|
||||
All args before the `--exec` flag are relevant to the Invariant MCP gateway. These include:
|
||||
|
||||
- `--dataset-name`: With this you can specify the name of the dataset. The guardrails are pulled from this dataset.
|
||||
- `--push-explorer`: With this you can specify if you want to push the annotated traces to the Invariant Explorer.
|
||||
- `--project-name`: With this you can specify the name of the Invariant Explorer project (dataset). The guardrails are pulled from this.
|
||||
- `--push-explorer`: With this you can specify if you want to push the annotated traces to the Invariant Explorer. The annotated traces are pushed to the project name provided above.
|
||||
|
||||
@@ -28,7 +28,8 @@ class McpContext:
|
||||
return
|
||||
|
||||
config = self._parse_cli_args(cli_args)
|
||||
self.explorer_dataset = config.dataset_name
|
||||
# The project name is used to identify the dataset in Invariant Explorer.
|
||||
self.explorer_dataset = config.project_name
|
||||
self.push_explorer = config.push_explorer
|
||||
self.trace = []
|
||||
self.tools = []
|
||||
@@ -47,8 +48,8 @@ class McpContext:
|
||||
"""Parse command line arguments."""
|
||||
parser = argparse.ArgumentParser(description="MCP Gateway")
|
||||
parser.add_argument(
|
||||
"--dataset-name",
|
||||
help="Name of the dataset where we want to push the MCP traces",
|
||||
"--project-name",
|
||||
help="Name of the Project from Invariant Explorer where we want to push the MCP traces. The guardrails are pulled from this project.",
|
||||
type=str,
|
||||
default=f"mcp-capture-{random.randint(1, 100)}",
|
||||
)
|
||||
|
||||
+1
-1
@@ -17,7 +17,7 @@ where = ["."]
|
||||
exclude = ["tests", "tests.*"]
|
||||
|
||||
[project.scripts]
|
||||
invariant-gateway = "gateway.__main__:main"
|
||||
run = "gateway.__main__:main"
|
||||
|
||||
[build-system]
|
||||
requires = ["setuptools>=61.0", "wheel"]
|
||||
|
||||
Reference in New Issue
Block a user