swaggbot

swaggbot

Transforms Swagger/OpenAPI documented APIs into conversational interfaces, enabling natural language interaction with APIs through an MCP server for use with AI assistants.

Category
Visit Server

README

Swaggbot

License: MIT GitHub Stars

Transform Swagger/OpenAPI docs into conversational interfaces. Self-hosted, local-first, AI-powered API exploration.


Quick Start

# Docker (recommended)
git clone https://github.com/techbloom-ai/swaggbot.git
cd swaggbot && cp .env.example .env
# Generate SESSION_SECRET and add LLM API keys
docker-compose up -d

Open http://localhost:3003


What is Swaggbot?

Swaggbot converts any Swagger/OpenAPI documented API into a conversational interface. Built for developers who want to:

  • Explore APIs naturally β€” Chat instead of reading raw JSON
  • Automate workflows β€” Multi-step operations with data extraction
  • Stay in control β€” Self-hosted, data stays local
  • Integrate anywhere β€” Web UI, MCP server, or direct API

Features

  • πŸ€– Natural Language API Interaction β€” "List all users" β†’ GET /users
  • πŸ”„ Workflow Automation β€” Chain multiple API calls with dependency resolution
  • πŸ”Œ MCP Server β€” Use with Claude Desktop, Cursor, Windsurf
  • 🏠 Self-Hosted β€” Your data, your infrastructure
  • πŸ” Session Management β€” Encrypted auth tokens, per-session isolation
  • 🌐 Multi-Provider LLM β€” Moonshot, OpenAI, Anthropic, Ollama
  • πŸ“Š Array Filtering β€” [name=John].id syntax for data extraction
  • πŸ›‘οΈ Security β€” CSP headers, rate limiting, encrypted storage

Architecture

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚ Web UI  β”‚  β”‚  MCP    β”‚  β”‚  API    β”‚
β”‚ Next.js β”‚  β”‚ Server  β”‚  β”‚ Clients β”‚
β””β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”˜  β””β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”˜  β””β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”˜
     β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                   β–Ό
          β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
          β”‚  Chat Service   β”‚  Intent Classification
          β”‚  + LLM Provider β”‚  β†’ Curl Generation β†’ Execution
          β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                   β”‚
     β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
     β–Ό             β–Ό             β–Ό
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”   β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”   β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚SQLite  β”‚   β”‚Workflow β”‚   β”‚ Target   β”‚
β”‚(Local) β”‚   β”‚ Engine  β”‚   β”‚   API    β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”˜   β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜   β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

Installation

Prerequisites

  • Node.js 18+ or Docker
  • LLM API key (Moonshot, OpenAI, Anthropic, or Ollama)

Docker (Recommended)

# 1. Clone and configure
git clone https://github.com/techbloom-ai/swaggbot.git
cd swaggbot
cp .env.example .env

# 2. Set SESSION_SECRET (required for auth)
# Linux/macOS:
export SESSION_SECRET=$(openssl rand -base64 32)
# Or add to .env: SESSION_SECRET=your_random_secret_here

# 3. Add your LLM API key to .env
# MOONSHOT_API_KEY=your_key_here

# 4. Start
docker-compose up -d

Database migrations run automatically on first startup.

Local Development

git clone https://github.com/techbloom-ai/swaggbot.git
cd swaggbot
pnpm install
cp .env.example .env.local
# Edit .env.local with SESSION_SECRET and LLM API keys
pnpm db:migrate
pnpm dev

Configuration

Variable Required Default Description
SESSION_SECRET Yes β€” Random secret for session encryption (min 32 chars)
MOONSHOT_API_KEY Yes* β€” Moonshot AI API key
OPENAI_API_KEY Yes* β€” OpenAI API key
ANTHROPIC_API_KEY Yes* β€” Anthropic API key
OLLAMA_BASE_URL Yes* β€” Ollama server URL
LLM_PROVIDER No moonshot moonshot | openai | anthropic | ollama
DATABASE_URL No file:./data/swaggbot.db SQLite database path
NEXT_PUBLIC_APP_URL No http://localhost:3003 App base URL

*At least one LLM provider required

Generate SESSION_SECRET

# Linux/macOS
openssl rand -base64 32

# Or any random string (min 32 characters)

API Reference

REST API

All endpoints require authentication via session cookie.

Endpoint Method Description
/api/auth/login POST Authenticate and create session
/api/session POST Create API session from Swagger URL
/api/session GET List all sessions (paginated)
/api/chat POST Send message to API
/api/workflow POST Create multi-step workflow
/api/workflow/:id/execute POST Execute workflow

MCP Server

{
  "mcpServers": {
    "swaggbot": {
      "command": "docker",
      "args": ["compose", "run", "--rm", "swaggbot-mcp"],
      "env": {
        "SESSION_SECRET": "your_secret",
        "MOONSHOT_API_KEY": "your_key"
      }
    }
  }
}

Usage Examples

Web UI

  1. Navigate to login page
  2. Create a session with your Swagger URL
  3. Start chatting:
    "Create a user named John"
    "List all pets with status available"
    "Execute the login workflow"
    

API

# Authenticate
curl -X POST http://localhost:3003/api/auth/login \
  -H "Content-Type: application/json" \
  -d '{"password": "your_password"}' \
  -c cookies.txt

# Chat with API
curl -X POST http://localhost:3003/api/chat \
  -H "Content-Type: application/json" \
  -b cookies.txt \
  -d '{"sessionId": "...", "message": "List all users"}'

Technology Stack

Component Technology
Framework Next.js 16 (App Router)
Language TypeScript 5
Database SQLite (libSQL/Turso)
ORM Drizzle ORM
UI shadcn/ui + TailwindCSS 4
State Zustand
LLM SDK Vercel AI SDK patterns
MCP Model Context Protocol SDK
Testing Vitest
Container Docker + Docker Compose

Project Structure

swaggbot/
β”œβ”€β”€ app/                 # Next.js App Router
β”‚   β”œβ”€β”€ api/            # API routes
β”‚   β”œβ”€β”€ sessions/       # Session UI
β”‚   └── settings/       # Settings page
β”œβ”€β”€ components/         # shadcn/ui components
β”œβ”€β”€ lib/
β”‚   β”œβ”€β”€ db/            # Database schema & migrations
β”‚   β”œβ”€β”€ llm/           # LLM provider implementations
β”‚   β”œβ”€β”€ services/      # Business logic
β”‚   β”œβ”€β”€ auth/          # Session & encryption
β”‚   └── prompts/       # LLM prompt management
β”œβ”€β”€ scripts/           # MCP server & entrypoint
└── data/              # SQLite storage (Docker volume)

Security

  • Local-first: All data stored locally in SQLite
  • Encrypted tokens: Auth tokens encrypted with AES-256-GCM
  • Session-based auth: Password-protected access
  • CSP headers: Content Security Policy protection
  • Rate limiting: Per-endpoint limits configurable
  • No telemetry: Zero analytics or tracking

License

MIT Β© TechBloom

Recommended Servers

playwright-mcp

playwright-mcp

A Model Context Protocol server that enables LLMs to interact with web pages through structured accessibility snapshots without requiring vision models or screenshots.

Official
Featured
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

An AI-powered tool that generates modern UI components from natural language descriptions, integrating with popular IDEs to streamline UI development workflow.

Official
Featured
Local
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

Enables interaction with Audiense Insights accounts via the Model Context Protocol, facilitating the extraction and analysis of marketing insights and audience data including demographics, behavior, and influencer engagement.

Official
Featured
Local
TypeScript
VeyraX MCP

VeyraX MCP

Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.

Official
Featured
Local
graphlit-mcp-server

graphlit-mcp-server

The Model Context Protocol (MCP) Server enables integration between MCP clients and the Graphlit service. Ingest anything from Slack to Gmail to podcast feeds, in addition to web crawling, into a Graphlit project - and then retrieve relevant contents from the MCP client.

Official
Featured
TypeScript
Kagi MCP Server

Kagi MCP Server

An MCP server that integrates Kagi search capabilities with Claude AI, enabling Claude to perform real-time web searches when answering questions that require up-to-date information.

Official
Featured
Python
E2B

E2B

Using MCP to run code via e2b.

Official
Featured
Neon Database

Neon Database

MCP server for interacting with Neon Management API and databases

Official
Featured
Exa Search

Exa Search

A Model Context Protocol (MCP) server lets AI assistants like Claude use the Exa AI Search API for web searches. This setup allows AI models to get real-time web information in a safe and controlled way.

Official
Featured
Qdrant Server

Qdrant Server

This repository is an example of how to create a MCP server for Qdrant, a vector search engine.

Official
Featured