Create a portal, groups and invites from the terminal
Use metorial-admin portals to create a portal, add an access group, share a Magic MCP server with it and invite a person, without opening the dashboard.
metorial-admin portals covers the Workforce setup an admin usually clicks through: create the portal, add an access group, share a resource with that group, and invite people. The sequence below takes an organization with nothing in it to one invited person who can use one shared server. Two steps have no dedicated command yet and use metorial-admin fetch.
What you'll learn
- How to create a portal and an access group
- How to share a Magic MCP server with a group
- How to invite a person and put them in a group
Before you start
- The
metorial-adminCLI, signed in as an organization member who can manage Workforce (install and sign in) - A Magic MCP server to share (Magic MCP from the terminal)
Add --format json to any command to get the full object, including IDs, in a form you can pipe to jq. If your profile can reach more than one instance, add --instance <instance-id>.
Create the portal
create returns the portal with its ID, its sign-in URLs and its magic_mcp_url. Use the ID in every command below. To change a portal later, run metorial-admin portals update <portal-id> with the same flags. --session-expiry-time-in-seconds sets how long a portal sign-in lasts.
Add an access group
A group bundles accounts and decides which resources they can use.
Add --is-default when every new account should join the group automatically. That is the simplest way to give invited people access, because an invite cannot name a group.
Share a resource with the group
An access rule connects one resource to one group. The group goes in --consumer-group-id and the resource goes in --body as JSON. To share a Magic MCP server:
--name, --description and --readme set what people see in the portal catalog. The access object accepts these types, each with its own ID field:
type | ID field |
|---|---|
magic_mcp_server | magic_mcp_server_id |
provider_template | provider_template_id |
skill | skill_id |
skill_group | skill_group_id |
skill_template | skill_template_id |
A provider_template is an integration that each person connects with their own account. The CLI has no command to create one. Create it in the dashboard under Workforce, Shared Resources, Share a Resource, New Integration.
To review or remove rules:
Invite a person
--name and --email are required. The response includes the invite's status (pending or accepted), the portal_url the person signs in at, and a consumer_profile with the ID of their account in this portal. New accounts join every default group.
Put an account in a group
There is no portals subcommand for group membership. Call the API through fetch, which sends the request with your CLI sign-in.
Find the account's profile ID
Take consumer_profile.id from the invite response, or list the portal's accounts:
Assign the group
To take the account out again, send the same body to /unassign-groups.
Review access requests
When a person asks for an integration they cannot use yet, the request waits for an admin. List and answer requests with fetch:
Use "status":"rejected" to decline. resolution_message adds a note for the person who asked.
Look up people
metorial-admin consumers works across the instance, not one portal:
Check it worked
Run metorial-admin portals access list <portal-id> and confirm the rule for your group is there. Then ask the invited person to sign in to the portal and run metorial catalog list. The shared server should appear as a shared integration.
In the dashboard, the same objects are under Workforce: Access Groups, Shared Resources, Access Requests, and Accounts with its Invites tab.