New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

mcp-rest-api

Package Overview
Dependencies
Maintainers
1
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

mcp-rest-api

A CLI tool that serves as an MCP Server for REST API interactions

latest
Source
npmnpm
Version
0.0.8
Version published
Maintainers
1
Created
Source

🚀 MCP REST API Server

License: ISC TypeScript Node.js npm version

🔧 A powerful, type-safe, configurable CLI tool that transforms any REST API into MCP (Model Context Protocol) tools for LLM agents

🌟 What is this?

The MCP REST API Server is a generic bridge that allows you to wrap any REST API and expose it as callable tools for AI assistants and LLM agents through the Model Context Protocol. Simply provide a JSON configuration file, and your API becomes instantly accessible to AI tools!

✨ The easiest way to get started is with npx -y mcp-rest-api - no installation required!

🤖 AI-Powered Config Generator

🚀 NEW: Generate configs instantly with AI! Visit api-mcp-generator.vercel.app to automatically generate JSON configurations from any REST API documentation. Just paste your API docs and let AI create the perfect MCP config for you!

🎯 Key Features

  • 🔄 Universal REST API Wrapper - Works with any REST API
  • 📝 JSON Configuration Driven - No coding required, just configure
  • 🛡️ Type-Safe & Validated - Full TypeScript support with runtime validation
  • 🔑 Smart Parameter Binding - Support for {args.param} and {env.VAR} expressions
  • 🚀 CLI Ready - Install globally or use with npx
  • 🔧 Developer Friendly - Hot reload, linting, and comprehensive tooling
  • 🌍 Environment Aware - Seamless environment variable integration
  • 📋 Flexible Logging - Silent, console, or file-based logging options
  • Robust Validation - Comprehensive config validation with helpful error messages

📦 Installation & Usage

  • Visit: api-mcp-generator.vercel.app
  • Input: Describe your REST API by pasting the url/documentation test in prompt
  • Generate: AI analyzes the docs and creates a perfect JSON configuration
  • Copy & Run: Copy MCP configuration and use it in your preferred AI tool (claude code, cursor, windsurf etc.)

Perfect for: Any API with existing documentation - the AI understands various API doc formats and generates comprehensive, production-ready configurations.

# Run directly without installation (most convenient)
npx -y mcp-rest-api --config /path/to/your/config.json

# The -y flag skips confirmation prompts for faster execution

Global Installation (Alternative)

npm install -g mcp-rest-api
mcp-rest-api --config /path/to/your/config.json

Development Setup

git clone https://github.com/MCP-Generator/mcp-rest-api.git
cd mcp-rest-api
npm install
npm run build

CLI Options

# Required: Specify configuration file
npx -y mcp-rest-api --config /path/to/config.json

# Optional: Control logging output
npx -y mcp-rest-api --config config.json --log stdio        # Log to console
npx -y mcp-rest-api --config config.json --log /path/file   # Log to file
npx -y mcp-rest-api --config config.json --log none        # No logging (default)

🚀 Two Ways to Create Configuration

✍️ Method 2: Manual Configuration

Create a JSON config file manually for full control. See the Configuration Deep Dive section below for detailed examples and parameter binding options.

🏗️ Architecture Overview

The system follows a clean three-layer architecture:

┌─────────────────────────┐
│   🎯 CLI/Config Layer   │  ← Entry point & config loading (cli.ts)
├─────────────────────────┤
│   🔧 MCP Server Layer   │  ← Protocol implementation & tool registry (McpServer.ts)
├─────────────────────────┤
│   📡 HTTP Client Layer  │  ← REST API communication & parameter binding (RequestHandler.ts)
└─────────────────────────┘

🔧 Configuration Deep Dive

Parameter Binding Magic ✨

The system supports powerful expression binding:

{
  "pathParams": {
    "id": "{args.user_id}"           // Maps to input parameter
  },
  "queryParams": {
    "limit": "{args.limit || 25}",   // Default value fallback
    "token": "{env.API_TOKEN}"       // Environment variable
  },
  "headers": {
    "Authorization": "Bearer {env.TOKEN}"
  }
}

🤝 Contributing

  • 🍴 Fork the repository
  • 🌿 Create your feature branch (git checkout -b feature/amazing-feature)
  • ✅ Run tests and linting (npm run check)
  • 📝 Commit your changes (git commit -m 'Add amazing feature')
  • 🚀 Push to the branch (git push origin feature/amazing-feature)
  • 📬 Open a Pull Request

📜 License

This project is licensed under the ISC License.

🎯 Transform any REST API into AI-ready tools with just JSON configuration!

✨ Get started in seconds: Generate configs with AI at api-mcp-generator.vercel.appnpx -y mcp-rest-api --config your-config.json

Made with ❤️ for the LLM community

🎯 Why Use This Tool?

  • 🤖 AI-Powered Generation: Use api-mcp-generator.vercel.app to generate configs from API docs instantly
  • 🚀 Zero Installation Required: Use npx -y mcp-rest-api to run immediately
  • ⚡ Instant Setup: From REST API to AI tool in minutes, not hours
  • 🔧 No Coding: Pure JSON configuration - no programming required
  • 🌐 Universal: Works with any REST API (PagerDuty, GitHub, Slack, custom APIs)
  • 🛡️ Production Ready: Type-safe, validated, with proper error handling
  • 🔍 MCP Standard: Full Model Context Protocol compliance for maximum compatibility

Keywords

mcp

FAQs

Package last updated on 28 Sep 2025

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts