Swaggerhub MCP for AI Agents

Securely connect your AI agents and chatbots (Claude, ChatGPT, Cursor, etc) with Swaggerhub MCP or direct API to create APIs, update documentation, manage API versions, and collaborate on API design through natural language.

Swaggerhub logoSwaggerhub
Api Key

Swaggerhub is a collaborative API design and documentation platform built on OpenAPI. It accelerates API delivery, quality, and teamwork with powerful standards and workflow tools.

49 Tools

Try Swaggerhub now

Type what you want done — sign in and watch it run live in the Tool Router playground.

TOOL ROUTER PLAYGROUND
Swaggerhub
Try asking
TOOLS

Supported Tools

Every Swaggerhub action and event your agent gets out of the box.

Add Access Control for Teams

Tool to assign access control roles to teams on a SwaggerHub resource.

Add Access Control for Users

Tool to assign access control roles to users on a SwaggerHub resource.

Delete Table of Contents Entry

Tool to delete a table of contents entry from SwaggerHub portal.

Get Access Control Users

Tool to retrieve the list of users assigned access control on a SwaggerHub resource.

Get API Default Version

Tool to get the default version identifier of a SwaggerHub API.

Get API Versions

Tool to retrieve a list of API versions for a specific API in SwaggerHub.

Get Consumer Products

Tool to get a list of products that are visible to the consumer in a SwaggerHub portal.

Get API Definition

Tool to get the OpenAPI definition of a specified API version from SwaggerHub.

Get Domain Default Version

Tool to retrieve the default version identifier of a SwaggerHub domain.

Get domain definition

Tool to retrieve the OpenAPI definition of a specified domain version from SwaggerHub.

Get Domain JSON Definition

Tool to retrieve the OpenAPI definition for a specified domain version in JSON format.

Get Domain Lifecycle Settings

Tool to get the published status for a specific domain and version in SwaggerHub.

Get Domain Private Settings

Tool to retrieve the visibility (public or private) of a domain version in SwaggerHub.

Get Domain Versions

Tool to get a list of domain versions from SwaggerHub.

Get Domain YAML Definition

Tool to retrieve the OpenAPI definition for a specified domain version in YAML format from SwaggerHub.

Get JSON API Definition

Tool to download OpenAPI definition as a JSON file from SwaggerHub Portal API.

Get JSON Definition

Tool to get the OpenAPI definition for a specified API version in JSON format.

Get lifecycle settings

Tool to get the published status for the specified API and version.

Get Organization Members

Tool to retrieve a list of organization members and their roles from SwaggerHub.

Get User Organizations

Tool to get organizations for a user.

Get Organization Projects V2

Tool to get all projects of an organization in SwaggerHub.

Get Owner APIs

Tool to get a list of APIs for a specified owner in SwaggerHub.

Get owner domains

Tool to retrieve domains owned by a specific SwaggerHub user or organization.

Get Portal

Tool to retrieve information about a portal.

Get Portal Access Requests

Tool to retrieve access requests for a portal in SwaggerHub.

Get Portal Attachment

Tool to get informational attachment metadata from SwaggerHub Portal.

Get Portal Product

Tool to retrieve detailed information about a specific product resource.

Get Portal Products

Tool to get products for a specific portal that match your criteria.

Get Portals

Tool to search for available portals.

Get Portal Templates

Tool to get templates for a specific portal that match your criteria.

Get API Version Private Settings

Tool to get the visibility (public or private) of an API version.

List Resource Types and Roles

Tool to list available resource types and assignable roles for each in a SwaggerHub organization.

Get Templates

Tool to retrieve a list of templates for an owner in SwaggerHub.

Get User Roles

Tool to retrieve all roles assigned to a user across organization resources in SwaggerHub.

Get YAML API Definition

Tool to download OpenAPI definition as a YAML file from SwaggerHub Portal API.

Get YAML Definition

Tool to get the OpenAPI definition in YAML format for the specified API version from SwaggerHub.

List Attachments

Tool to retrieve all attachments for a portal or product.

Remove Access Control for Teams

Tool to remove access control for teams from a SwaggerHub resource.

Remove Access Control For Users

Tool to remove access control for users from a SwaggerHub organizational resource.

Remove Organization Members

Tool to remove members from a SwaggerHub organization.

Search APIs

Tool to search SwaggerHub APIs.

Search APIs and Domains

Tool to search SwaggerHub APIs, domains, and templates.

Search Domains

Tool to search SwaggerHub domains.

Search Published Portal

Tool to search published portal content.

Update Access Control for Teams

Tool to update access control roles for teams on a SwaggerHub resource.

Update Access Control for Users

Tool to update access control roles for users on a SwaggerHub resource.

Update Access Control for Teams

Tool to update access control for teams on a SwaggerHub resource.

Update Access Control Users

Tool to update access control roles for users on a SwaggerHub resource.

Update Portal

Tool to update specific portal information in SwaggerHub.

SETUP GUIDE

Connect Swaggerhub MCP Tool with your Agent

1

Install Composio

typescript
npm install @composio/core ai @ai-sdk/openai @ai-sdk/mcp
Install the Composio SDK for Python or TypeScript
2

Initialize Client and Create Tool Router Session

typescript
import { Composio } from '@composio/core';

const composio = new Composio({ apiKey: 'your-api-key' });
const session = await composio.create('your-user-id');
console.log(`Tool Router session created: ${session.mcp.url}`);
Import and initialize the Composio client, then create a Tool Router session for Swaggerhub
3

Connect to AI Agent

typescript
import { openai } from '@ai-sdk/openai';
import { experimental_createMCPClient as createMCPClient } from '@ai-sdk/mcp';
import { generateText } from 'ai';

const client = await createMCPClient({
  transport: {
    type: 'http',
    url: session.mcp.url,
    headers: {
      'x-api-key': 'your-composio-api-key',
    },
  },
});

const tools = await client.tools();
const { text } = await generateText({
  model: openai('gpt-4o'),
  tools,
  messages: [{
    role: 'user',
    content: 'List all APIs I have access to in Swaggerhub.'
  }],
  maxSteps: 5,
});

console.log(`Agent: ${text}`);
Use the MCP server with your AI agent (Anthropic Claude or Mastra)
SETUP GUIDE

Connect Swaggerhub API Tool with your Agent

1

Install Composio

typescript
npm install @composio/openai
Install the Composio SDK
2

Initialize Composio and Create Tool Router Session

typescript
import OpenAI from 'openai';
import { Composio } from '@composio/core';
import { OpenAIResponsesProvider } from '@composio/openai';

const composio = new Composio({
  provider: new OpenAIResponsesProvider(),
});
const openai = new OpenAI({});
const session = await composio.create('your-user-id');
Import and initialize Composio client, then create a Tool Router session
3

Execute Swaggerhub Tools via Tool Router with Your Agent

typescript
const tools = session.tools;
const response = await openai.responses.create({
  model: 'gpt-4.1',
  tools: tools,
  input: [{
    role: 'user',
    content: 'List all APIs I have access to in Swaggerhub.'
  }],
});
const result = await composio.provider.handleToolCalls(
  'your-user-id',
  response.output
);
console.log(result);
Get tools from Tool Router session and execute Swaggerhub actions with your Agent

Why Use Composio?

AI Native Swaggerhub Integration

  • Supports both Swaggerhub MCP and direct API based integrations
  • Structured, LLM-friendly schemas for reliable tool execution
  • Rich coverage for reading, writing, and querying your Swaggerhub data

Managed Auth

  • Built-in OAuth handling with automatic token refresh and rotation
  • Central place to manage, scope, and revoke Swaggerhub access
  • Per user and per environment credentials instead of hard-coded keys

Agent Optimized Design

  • Tools are tuned using real error and success rates to improve reliability over time
  • Comprehensive execution logs so you always know what ran, when, and on whose behalf

Enterprise Grade Security

  • Fine-grained RBAC so you control which agents and users can access Swaggerhub
  • Scoped, least privilege access to Swaggerhub resources
  • Full audit trail of agent actions to support review and compliance
FAQ

Frequently asked questions

Yes, Swaggerhub requires you to configure your own API key credentials. Once set up, Composio handles secure credential storage and API request handling for you.

Yes! Composio's Tool Router enables agents to use multiple toolkits. Learn more.

Composio is SOC 2 and ISO 27001 compliant with all data encrypted in transit and at rest. Learn more.

Composio maintains and updates all toolkit integrations automatically, so your agents always work with the latest API versions.

Start with Swaggerhub.It takes 30 seconds.

Managed auth, hosted MCP servers, and every Swaggerhub tool your agent needs.Free to start.

Start building