oas-mcp

Frontend Web Interface

The OAS-MCP project includes a React-based web interface that provides a user-friendly way to configure OpenAPI specifications as MCP servers. The frontend eliminates the need for manual JSON configuration and credential management.

Overview

The frontend UI is a single-page application built with React and Vite that allows you to:

Getting Started

Running the Frontend

  1. Start the OAS-MCP server (required for credential storage):
    npx oas-mcp serve --port 8080 --cred-store file
    
  2. Start the frontend development server:
    cd frontend
    npm install
    npm run dev
    
  3. Open the interface at http://localhost:5173

Production Build

To build the frontend for production deployment:

cd frontend
npm run build

The built files will be in frontend/dist/ and can be served by any static web server.

Features

1. Spec Upload & Validation

The interface supports multiple ways to provide your OpenAPI specification:

2. Server Configuration

Configure your MCP server settings through an intuitive form:

Setting Description Default
Base URL API base URL (auto-detected from spec) https://api.example.com
Schema URL OpenAPI spec URL Auto-generated suggestion
Server Name MCP server identifier openapi
SSE Server URL OAS-MCP server endpoint http://127.0.0.1:8080

3. Authentication Management

Secure credential management with support for multiple authentication types:

Supported Auth Types

Credential Storage

4. Generated Configuration

The interface automatically generates MCP server configuration that you can:

Example generated configuration:

{
  "myapi": {
    "url": "http://127.0.0.1:8080/sse?s=https%3A%2F%2Fapi.example.com%2Fopenapi.json&u=https%3A%2F%2Fapi.example.com&n=myapi"
  }
}

5. Connected Servers Tracking

Keep track of configured MCP servers:

Security Considerations

Credential Handling

HTTPS Recommendations

For production use:

File Structure

frontend/
├── src/
│   ├── modules/
│   │   ├── App.tsx              # Main application component
│   │   ├── ConfigForm.tsx       # Server configuration form
│   │   ├── GeneratedConfig.tsx  # Output configuration display
│   │   └── SpecUploader.tsx     # OpenAPI spec input component
│   ├── util/
│   │   ├── buildConfig.ts       # Configuration generation logic
│   │   └── parseSpec.ts         # OpenAPI spec parsing
│   ├── types.ts                 # TypeScript type definitions
│   └── main.tsx                # Application entry point
├── package.json
├── vite.config.ts
└── README.md

Environment Setup

Development Dependencies

Browser Compatibility

Modern browsers with ES2020+ support required.

Credential Store Integration

The frontend integrates with the OAS-MCP server’s credential store system:

File-based Credentials

When using --cred-store file, credentials are saved to:

.oas_mcps/creds.json

⚠️ Important: Add this directory to your .gitignore:

# OAS-MCP credential storage
.oas_mcps/

Memory-based Credentials

When using --cred-store memory, credentials are lost when the server restarts.

API Endpoints Used

The frontend communicates with these OAS-MCP server endpoints:

Endpoint Method Purpose
/credentials POST Store authentication credentials
/import-env-credentials POST Import credentials from environment variables
/sse GET Establish MCP server connection

Troubleshooting

Common Issues

Spec validation fails:

Credential save fails:

Generated config doesn’t work:

Debug Mode

Start the OAS-MCP server with --debug for detailed logging:

npx oas-mcp serve --debug --cred-store file

Next Steps

After generating your MCP server configuration:

  1. Add to VS Code: Copy the configuration to your mcp.json file
  2. Test the connection: Verify the MCP server appears in your client
  3. Explore generated tools: List and test the automatically generated tools
  4. Set up authentication: Configure credentials for protected APIs

For more details on credential management, see Adding Credentials.