Swagger Faker

Generate mocker services automatically through Swagger or OpenAPI.

Installation

Installing for Claude Desktop

Option 1: One-Command Installation

npx mcpbar@latest install Pingtouges/swagger-faker -c claude

This command will automatically install and configure the Swagger Faker MCP server for your selected client.

Option 2: Manual Configuration

Run the command below to open your configuration file:

npx mcpbar@latest edit -c claude

After opening your configuration file, copy and paste this configuration:

View JSON configuration
{
  "mcpServers": {
    "Swagger Faker": {
      "command": "npx",
      "args": [
        "-y",
        "swagger-faker"
      ],
      "env": {}
    }
  }
}

Swagger Faker

Build Status codecov License NPM

Swagger Faker is a tool which can help you generate fake data from your swagger.json file, then it will start a mock server automatically with the generated fake data.

How to Use

  1. Install
npm i swagger-faker -g
  1. Init config file by command:
swagger-faker init

Then it will generate a config file swagger-faker.config.json in current path, update that config file:

{
  "sourcePaths": ["./source/openapi.json"],
  "outputFolder": "mock-server",
  "timeout": 180000,
  "port": 8081
}
  • sourcePaths: required, put your swagger/openapi file path here
  • outputFolder: optional
  • timeout: optional,
  • port: optional
  1. Generate fake data
swagger-faker gen
  1. Start the mock server
swagger-faker run

Examples

git clone https://github.com/reeli/swagger-faker-examples.git
cd  swagger-faker-examples
npm install
npm start

Then you'll see:

  1. A mock-server folder has been generated in your current path, and all mock data is setting in mock-server/data folder, you can customize them if needed.
  2. A mock server has been started in http://localhost:8081, you can open your browser and visit one of the mock API by http://localhost:8081/api/v2/store/order/1 (The mock data is setting in: mock-server/data/getOrderById.json)
Share:
Details:
  • Stars


    0
  • Forks


    0
  • Last commit


    3 years ago
  • Repository age


    3 years
View Repository

Auto-fetched from GitHub .

MCP servers similar to Swagger Faker:

 

 
 
  • Stars


  • Forks


  • Last commit


 

 
 
  • Stars


  • Forks


  • Last commit


 

 
 
  • Stars


  • Forks


  • Last commit


Swagger Faker: MCP Server – MCP.Bar