# Swaggerhub — how to use (mcp.ai)

Connect your Swaggerhub account and use 44 tools for developer tools straight from your AI agent. Connect with your own API key. Accelerating API delivery and quality through standards and collaboration, built on OpenAPI.

## Option A — via MCP (recommended)
Remote MCP endpoint (HTTP, streamable): `https://api.mcp.ai/p_swaggerhub?ms=1787293500000`
Add it as a custom/remote MCP connector in your client (Claude, Cursor, VS Code…), then authenticate when prompted. Once connected, ask the agent to use the server's tools (e.g. `swaggerhub_add_access_control_for_teams`).

## Option B — via direct REST API
Base URL: `https://api.mcp.ai/api/swaggerhub`
Auth: `Authorization: Bearer sk_live_…` — create a workspace API key at https://mcp.ai/settings/api-keys
Discover endpoints: `GET https://api.mcp.ai/api/swaggerhub/_endpoints`

### Endpoints
- `POST https://api.mcp.ai/api/swaggerhub/add/access/control/for/teams` — Tool to assign access control roles to teams on a SwaggerHub resource. Use when you need to grant team permissions (OWNER, DESIGNER, CONSUMER) for APIs, domains, projects, or portal products.
  - body: { owner: string, teams: object[], resourceName: string, resourceType: string }
- `POST https://api.mcp.ai/api/swaggerhub/add/access/control/for/users` — Tool to assign access control roles to users on a SwaggerHub resource. Use when you need to grant user permissions (owner, designer, consumer) for APIs, domains, projects, organizations, teams, or por
  - body: { owner: string, users: object[], resourceName: string, resourceType: string }
- `POST https://api.mcp.ai/api/swaggerhub/delete/table/of/contents/entry` — Tool to delete a table of contents entry from SwaggerHub portal. Use when you need to remove a table of contents entry by its ID. Optionally supports recursive deletion of nested entries.
  - body: { recursive?: boolean, table_of_contents_id: string }
- `POST https://api.mcp.ai/api/swaggerhub/get/access/control/users` — Tool to retrieve the list of users assigned access control on a SwaggerHub resource. Use when you need to check who has access to an API, domain, project, organization, team, or portal product.
  - body: { page?: integer, owner: string, pageSize?: integer, resourceName: string, resourceType: string, statusFilter?: string }
- `POST https://api.mcp.ai/api/swaggerhub/get/api/default/version` — Tool to get the default version identifier of a SwaggerHub API. Use when you need to know which version is marked as default for an API. This returns only the version identifier; to get the full API d
  - body: { api: string, owner: string }
- `POST https://api.mcp.ai/api/swaggerhub/get/api/versions` — Tool to retrieve a list of API versions for a specific API in SwaggerHub. Use when you need to get all versions of an API owned by an organization or user. Returns 404 if the specified API is not foun
  - body: { api: string, owner: string }
- `POST https://api.mcp.ai/api/swaggerhub/get/consumer/products` — Tool to get a list of products that are visible to the consumer in a SwaggerHub portal. Use when you need to retrieve products from a portal, including both accessible and inaccessible products. This 
  - body: { page?: integer, size?: integer, embed?: string[], portalId: string, canAccess?: boolean }
- `POST https://api.mcp.ai/api/swaggerhub/get/definition` — Tool to get the OpenAPI definition of a specified API version from SwaggerHub. Use when you need to retrieve the complete API specification including endpoints, schemas, and documentation for a specif
  - body: { api: string, owner: string, flatten?: boolean, version: string, resolved?: boolean }
- `POST https://api.mcp.ai/api/swaggerhub/get/domain/default/version` — Tool to retrieve the default version identifier of a SwaggerHub domain. Use when you need to know which version is set as default for a domain before fetching its definition.
  - body: { owner: string, domain: string }
- `POST https://api.mcp.ai/api/swaggerhub/get/domain/definition` — Tool to retrieve the OpenAPI definition of a specified domain version from SwaggerHub. Use when you need to access reusable domain components, schemas, or parameters.
  - body: { owner: string, domain: string, version: string }
- `POST https://api.mcp.ai/api/swaggerhub/get/domain/json/definition` — Tool to retrieve the OpenAPI definition for a specified domain version in JSON format. Use when you need to access the domain definition document from SwaggerHub.
  - body: { owner: string, domain: string, version: string }
- `POST https://api.mcp.ai/api/swaggerhub/get/domain/lifecycle/settings` — Tool to get the published status for a specific domain and version in SwaggerHub. Use when you need to check if a domain version is published or unpublished.
  - body: { owner: string, domain: string, version: string }
- `POST https://api.mcp.ai/api/swaggerhub/get/domain/private/settings` — Tool to retrieve the visibility (public or private) of a domain version in SwaggerHub. Use when you need to check whether a specific domain version is accessible publicly or restricted to private acce
  - body: { owner: string, domain: string, version: string }
- `POST https://api.mcp.ai/api/swaggerhub/get/domain/versions` — Tool to get a list of domain versions from SwaggerHub. Use when you need to retrieve all versions of a domain definition and see which APIs reference it. The domain must exist and be accessible with t
  - body: { owner: string, domain: string }
- `POST https://api.mcp.ai/api/swaggerhub/get/domain/yaml/definition` — Tool to retrieve the OpenAPI definition for a specified domain version in YAML format from SwaggerHub. Use when you need to fetch domain schemas or API specifications in YAML format.
  - body: { owner: string, domain: string, version: string }
- `POST https://api.mcp.ai/api/swaggerhub/get/lifecycle/settings` — Tool to get the published status for the specified API and version. Use when you need to check if an API version is published or unpublished.
  - body: { api: string, owner: string, version: string }
- `POST https://api.mcp.ai/api/swaggerhub/get/org/projects/v2` — Tool to get all projects of an organization in SwaggerHub. Use when you need to retrieve projects belonging to a specific organization. Projects organize APIs and domains into logical groups. Returns 
  - body: { page?: integer, limit?: integer, order?: string, owner: string, nameOnly?: boolean }
- `POST https://api.mcp.ai/api/swaggerhub/get/organization/members` — Tool to retrieve a list of organization members and their roles from SwaggerHub. Use when you need to view member details including email addresses, roles, and last activity. The authenticating user m
  - body: { q?: string, page?: integer, order?: string, owner: string, sortBy?: string, pageSize?: integer }
- `POST https://api.mcp.ai/api/swaggerhub/get/organizations` — Tool to get organizations for a user. Use when you need to retrieve all organizations that the authenticating user is a member of. Results can be filtered by name using the q parameter, sorted by name
  - body: { q?: string, page?: integer, order?: string, sortBy?: string, pageSize?: integer }
- `POST https://api.mcp.ai/api/swaggerhub/get/owner/apis` — Tool to get a list of APIs for a specified owner in SwaggerHub. Use when you need to retrieve all APIs belonging to a specific user or organization. Results are returned in APIs.json format and can be
  - body: { page?: integer, sort?: string, limit?: integer, order?: string, owner: string }
- `POST https://api.mcp.ai/api/swaggerhub/get/owner/domains` — Tool to retrieve domains owned by a specific SwaggerHub user or organization. Use when you need to list all domains associated with an owner.
  - body: { page?: integer, sort?: string, limit?: integer, order?: string, owner: string }
- `POST https://api.mcp.ai/api/swaggerhub/get/portal` — Tool to retrieve information about a portal. Use when you need to fetch details about a specific SwaggerHub portal by its UUID or subdomain.
  - body: { embed?: string[], portalId: string }
- `POST https://api.mcp.ai/api/swaggerhub/get/portal/access/requests` — Tool to retrieve access requests for a portal in SwaggerHub. Use when you need to list all users who have requested access to a portal's products, with optional filtering by status or search query. Re
  - body: { q?: string, page?: integer, size?: integer, status?: string[], portalId: string }
- `POST https://api.mcp.ai/api/swaggerhub/get/portal/attachment` — Tool to get informational attachment metadata from SwaggerHub Portal. Use when you need to retrieve details about a specific attachment by its UUID. This endpoint supports both authenticated and unaut
  - body: { attachment_id: string }
- `POST https://api.mcp.ai/api/swaggerhub/get/portal/product` — Tool to retrieve detailed information about a specific product resource. Use when you need to fetch complete details about a product using its UUID or portal-subdomain:product-slug identifier.
  - body: { embed?: string[], productId: string }
- `POST https://api.mcp.ai/api/swaggerhub/get/portal/products` — Tool to get products for a specific portal that match your criteria. Use when you need to retrieve a list of products from a portal, with optional filtering by name or slug and pagination support.
  - body: { name?: string, page?: integer, size?: integer, slug?: string, embed?: string[], portalId: string }
- `POST https://api.mcp.ai/api/swaggerhub/get/portal/templates` — Tool to get templates for a specific portal that match your criteria. Use when you need to list or search for templates within a portal by name or other filters. Supports pagination for large result s
  - body: { name?: string, page?: integer, size?: integer, embed?: string[], portalId: string }
- `POST https://api.mcp.ai/api/swaggerhub/get/portals` — Tool to search for available portals. Returns portals where you have a designer role, either at the product level or organization level.
  - body: { page?: integer, size?: integer, embed?: string[], subdomain?: string }
- `POST https://api.mcp.ai/api/swaggerhub/get/private/settings` — Tool to get the visibility (public or private) of an API version. Use when you need to check whether a specific API version is publicly accessible or private.
  - body: { api: string, owner: string, version: string }
- `POST https://api.mcp.ai/api/swaggerhub/get/resource/types` — Tool to list available resource types and assignable roles for each in a SwaggerHub organization. Use when you need to understand what roles can be assigned to different resource types like APIs, doma
  - body: { owner_id: string }
- `POST https://api.mcp.ai/api/swaggerhub/get/templates` — Tool to retrieve a list of templates for an owner in SwaggerHub. Use when you need to get available templates for creating new API definitions or domain models.
  - body: { owner?: string }
- `POST https://api.mcp.ai/api/swaggerhub/get/user/roles` — Tool to retrieve all roles assigned to a user across organization resources in SwaggerHub. Use when you need to check what permissions a user has across APIs, teams, domains, and other resources in an
  - body: { page?: integer, user: string, ownerId: string, pageSize?: integer }
- `POST https://api.mcp.ai/api/swaggerhub/get/yaml/definition` — Tool to get the OpenAPI definition in YAML format for the specified API version from SwaggerHub. Use when you need to retrieve the API specification as YAML text for parsing, storage, or processing.
  - body: { api: string, owner: string, flatten?: boolean, version: string, resolved?: boolean }
- `POST https://api.mcp.ai/api/swaggerhub/list/attachments` — Tool to retrieve all attachments for a portal or product. Use when you need to list attachments associated with either a specific portal or product. Provide either productId or portalId, not both.
  - body: { portalId?: string, productId?: string }
- `POST https://api.mcp.ai/api/swaggerhub/remove/access/control/for/teams` — Tool to remove access control for teams from a SwaggerHub resource. Use when you need to revoke team permissions from an API, domain, project, or portal product.
  - body: { owner: string, teams: string[], resourceName: string, resourceType: string }
- `POST https://api.mcp.ai/api/swaggerhub/remove/access/control/for/users` — Tool to remove access control for users from a SwaggerHub organizational resource. Use when you need to revoke user access to APIs, domains, projects, organizations, teams, or portal products.
  - body: { owner: string, users: string[], resourceName: string, resourceType: string }
- `POST https://api.mcp.ai/api/swaggerhub/remove/members` — Tool to remove members from a SwaggerHub organization. Use when you need to revoke membership for one or more users by their email addresses.
  - body: { user: string[], owner: string }
- `POST https://api.mcp.ai/api/swaggerhub/search/apis` — Tool to search SwaggerHub APIs. Use when you need to find API definitions in SwaggerHub by name, owner, or other criteria. This is a convenience alias for GET /specs?specType=API.
  - body: { page?: integer, sort?: string, limit?: integer, order?: string, query?: string, state?: string }
- `POST https://api.mcp.ai/api/swaggerhub/search/apis/and/domains` — Tool to search SwaggerHub APIs, domains, and templates. Use when you need to retrieve a list of currently defined APIs, domains, and/or templates in APIs.json format. Supports filtering by spec type, 
  - body: { page?: integer, sort?: string, limit?: integer, order?: string, owner?: string, query?: string, state?: string, specType?: string, visibility?: string }
- `POST https://api.mcp.ai/api/swaggerhub/search/domains` — Tool to search SwaggerHub domains. Use when you need to find domain definitions in SwaggerHub by name, owner, or other criteria. This is a convenience alias for GET /specs?specType=DOMAIN.
  - body: { page?: integer, sort?: string, limit?: integer, order?: string, query?: string, state?: string }
- `POST https://api.mcp.ai/api/swaggerhub/search/published/portal` — Tool to search published portal content. Use when you need to search for APIs, operations, schemas, or documents within a specific SwaggerHub portal. This endpoint does not require authentication for 
  - body: { q: string, page?: integer, size?: integer, portalId: string, resultType?: string[] }
- `POST https://api.mcp.ai/api/swaggerhub/update/access/control/for/teams` — Tool to update access control roles for teams on a SwaggerHub resource. Use when you need to assign or change team permissions (designer or consumer) for APIs, domains, projects, or portal products.
  - body: { orgId: string, teams: object[], resourceName: string, resourceType: string }
- `POST https://api.mcp.ai/api/swaggerhub/update/access/control/for/users` — Tool to update access control roles for users on a SwaggerHub resource. Use when you need to assign or change user permissions (owner, designer, consumer) for APIs, domains, projects, organizations, t
  - body: { owner: string, users: object[], resourceName: string, resourceType: string }
- `POST https://api.mcp.ai/api/swaggerhub/update/portal` — Tool to update specific portal information in SwaggerHub. Use when you need to modify portal settings such as name, branding, subdomain, or other configuration options.
  - body: { name?: string, footer?: object, gtmKey?: string, offline?: boolean, routing?: string, branding?: object, portalId: string, subdomain?: string, landingPage?: object, customDomain?: string, openapiRenderer?: string, pageContentFormat?: string, credentialsEnabled?: boolean }

## Example prompts
- "What can I do in Swaggerhub?"
- "Show me a summary of my Swaggerhub account"

## More
- Page: https://mcp.ai/swaggerhub
- Agent spec (llms.txt): https://mcp.ai/swaggerhub/llms.txt
- Postman collection: https://mcp.ai/swaggerhub/postman.json
