mcpField
S
Swagger Faker

Swagger Faker

Local
reeli.github.ioDeveloper Tools0Updated 238w ago

About Swagger Faker

Swagger Faker is a command-line tool that reads Swagger or OpenAPI files, generates mock data, and starts a mock server. It is intended for developers who need mock API responses from an API specification.

Key features

  1. 01Reads Swagger and OpenAPI files
  2. 02Generates fake data
  3. 03Starts a mock server
  4. 04Supports configurable source and output paths

Use cases

  1. 01Mock API endpoints during development
  2. 02Generate local responses from an API specification

Configuration

Local server config is the same for every client. Copy it into your client’s MCP config file.

No install method listed yet

We haven’t collected a package or remote endpoint for this server. Follow the instructions in the project README.

Repository

Tools

No tool list yet

Local servers expose tools only once running on your machine, and the maintainer has not provided a tool list.

Details

From the project README

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)

Comments

Markdown supported

New to MCP?

From what the protocol is to installing your first server, these answers cover most first questions.

An open protocol that defines how AI applications connect to external tools and data in a uniform way. Clients talk to the model; MCP servers provide tools, resources and prompt templates. They exchange standard messages, so one server can be reused by many clients.