MetorialDocs

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

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

metorial-admin portals create --name "Engineering" --description "Tools for the engineering team"
metorial-admin portals list --search engineering
metorial-admin portals get <portal-id>

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.

metorial-admin portals groups create <portal-id> --name "Developers" --description "Everyone who ships code"
metorial-admin portals groups list <portal-id>

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.

metorial-admin portals groups create <portal-id> --name "Everyone" --is-default

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:

metorial-admin portals access create <portal-id> \
  --consumer-group-id <consumer-group-id> \
  --name "GitHub" \
  --description "Issues and pull requests" \
  --body '{"access":{"type":"magic_mcp_server","magic_mcp_server_id":"<magic-mcp-server-id>"}}'

--name, --description and --readme set what people see in the portal catalog. The access object accepts these types, each with its own ID field:

typeID field
magic_mcp_servermagic_mcp_server_id
provider_templateprovider_template_id
skillskill_id
skill_groupskill_group_id
skill_templateskill_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:

metorial-admin portals access list <portal-id> --consumer-group-id <consumer-group-id>
metorial-admin portals access delete <portal-id> <access-id>

Invite a person

metorial-admin portals invites create <portal-id> \
  --name "<name>" \
  --email <email> \
  --message "Sign in to connect your tools"
metorial-admin portals invites list <portal-id> --status pending

--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:

metorial-admin fetch /portals/<portal-id>/consumer-profile --format json

Assign the group

metorial-admin fetch /portals/<portal-id>/consumer-profile/<consumer-profile-id>/assign-groups \
  -X POST \
  -d '{"group_ids":["<consumer-group-id>"]}'

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:

metorial-admin fetch /portals/<portal-id>/access-requests --format json
metorial-admin fetch /portals/<portal-id>/access-requests/<access-request-id> \
  -X PATCH \
  -d '{"status":"approved","consumer_group_id":"<consumer-group-id>"}'

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:

metorial-admin consumers list --email <email>
metorial-admin consumers get <consumer-id>

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.

Next steps