Fire in da houseTop Tip:Paying $100+ per month for Perplexity, MidJourney, Runway, ChatGPT is crazy - get all your AI tools in one site starting at $15 per month with Galaxy AIFire in da houseCheck it out free

cli

MCP.Pizza Chef: usemodel-dev

The MCP CLI is a command-line interface tool designed to generate and run type-safe MCP servers based on OpenAPI specifications. It simplifies server code generation, configuration management, and server execution, enabling developers to quickly create MCP servers that integrate with MCP clients. The CLI also supports adding external configurations to MCP clients or IDEs with a single command, streamlining the setup process for MCP-based workflows.

Use This MCP client To

Generate MCP server code from OpenAPI specifications Run MCP servers directly from the command line Manage MCP client configurations via CLI commands Integrate external server configurations into MCP clients or IDEs Automate MCP server setup in development workflows

README

OpenAPI x MCP

OpenAPI-MCP Architecture

Generate a type-safe MCP (Model Context Protocol) server from an OpenAPI specification.

Overview

This package allows you to generate and run a type-safe MCP server from your OpenAPI specification. It provides CLI tools for server generation, configuration management, and server execution.

If you would like to use an external configuration for a server with your MCP client, you can also use the CLI to add it to your IDE / Client with a single command.

Installation

npx -y -p @usemodel-dev/cli@latest

Usage

1. Generate Server Code

Generate the MCP server code from your OpenAPI specification:

npx -y -p @usemodel-dev/cli@latest cli generate <ABSOLUTE_PATH_TO_SPEC_YAML_OR_JSON>

This will create the mcp server files in the cwd() directory.

Run server with npx

npx -y -p @usemodel-dev/cli@latest server

2. Configure MCP Client Settings

Add or Update Configuration on your MCP Client (Cursor, Windsurf et al.)

npx -y -p @usemodel-dev/cli@latest cli config add <client> '<config_json>'

Where:

  • <client> can be one of: cursor, windsurf, or claude
  • <config_json> is a JSON string containing your configuration

Example:

# Add or update a server configuration for Cursor
npx -y -p @usemodel-dev/cli@latest cli config add cursor '{"@yourorg/mcp": {"url": "http://localhost:3000", "env": { "apiKey": "XXX" } } }'

Remove Configuration

npx -y -p @usemodel-dev/cli@latest cli config remove <client> <servername>

Example:

# Remove a server configuration from Cursor
npx -y -p @usemodel-dev/cli@latest cli config remove cursor @yourorg/mcp

Configuration Storage

Configurations are stored in the following locations based on the client:

  • Cursor: ~/.cursor/mcp.json
  • Windsurf: ~/.codeium/windsurf/mcp_config.json
  • Claude: ~/Library/Application Support/Claude/claude_desktop_config.json

All configurations are stored under the mcpServers key in the config file. When adding new configurations, they will be merged with existing ones, and when updating existing configurations, they will be overwritten.

Local development

  1. Build the server:
pnpm build

Note: You need to run the generate command before building.

  1. Start the server:
pnpm start

This will start the server at http://localhost:3001

Environment Variables

The server uses dotenv for configuration. Create a .env file in your project root with the necessary environment variables.

Dependencies

  • @modelcontextprotocol/sdk: For MCP implementation
  • express: For the server framework
  • openapi-typescript: For TypeScript type generation
  • zod: For runtime type validation

Contributing

This project is hosted on GitHub at https://github.com/@usemodel-dev/cli.git. Feel free to open issues or submit pull requests.

License

MIT

Package Information

Current version: 0.0.1

cli FAQ

How do I generate an MCP server from an OpenAPI spec?
Use the CLI command 'cli generate <path_to_spec>' to create server files.
Can I run the generated MCP server without additional setup?
Yes, you can run it directly using 'npx -p @usemodel-dev/cli server'.
How do I add external configurations to an MCP client?
The CLI provides commands to add or update client configurations easily.
Is the MCP CLI compatible with different IDEs?
Yes, it supports adding configurations to various IDEs and MCP clients.
What installation method is recommended for the MCP CLI?
Install via npx with 'npx -y -p @usemodel-dev/cli@latest' for the latest version.
Does the CLI support both YAML and JSON OpenAPI specs?
Yes, it supports generating servers from both YAML and JSON formats.
Can the CLI be integrated into automated build or deployment pipelines?
Yes, its command-line nature makes it suitable for automation in CI/CD workflows.