Skip to main content
Glama
README.md
"# ๐Ÿš€ API Creator MCP

[![NPM Version](https://img.shields.io/npm/v/api-creator-mcp)](https://www.npmjs.com/package/api-creator-mcp)
[![CI](https://github.com/yourusername/api-creator-mcp/actions/workflows/ci.yml/badge.svg)](https://github.com/yourusername/api-creator-mcp/actions/workflows/ci.yml)
[![License](https://img.shields.io/badge/license-MIT-blue.svg)](LICENSE)
[![Node Version](https://img.shields.io/badge/node-%3E%3D20.0.0-brightgreen)](https://nodejs.org)

**API Creator MCP** is a specialized MCP (Model Context Protocol) server that generates complete, production-ready APIs. It supports REST, GraphQL, and microservices architectures with built-in security, validation, and deployment configurations.

## โœจ Features

- **REST API Generation** - Express/Fastify with database integration
- **OpenAPI Conversion** - Transform OpenAPI specs into working servers
- **GraphQL API Generation** - Apollo Server with subscriptions support
- **Microservice Generation** - gRPC, Kafka, RabbitMQ with service discovery
- **Deployment Configuration** - Docker, Kubernetes, AWS Lambda, Vercel
- **Security First** - JWT auth, Zod validation, rate limiting, path sanitization
- **TypeScript Native** - Full type safety with strict TypeScript
- **Observability** - OpenTelemetry tracing and Prometheus metrics

## ๐Ÿ“‹ Prerequisites

- Node.js 20+
- npm 9+

## ๐Ÿš€ Installation

### Via npx (recommended)

```bash
npx api-creator-mcp
```

### Via npm global install

```bash
npm install -g api-creator-mcp
api-creator-mcp
```

### Via GitHub

```bash
git clone https://github.com/yourusername/api-creator-mcp.git
cd api-creator-mcp
npm install
npm run build
npm link
api-creator-mcp
```

## ๐Ÿ”ง Configuration for Claude Desktop

Add to your `claude_desktop_config.json`:

```json
{
  "mcpServers": {
    "api-creator-mcp": {
      "command": "npx",
      "args": ["-y", "api-creator-mcp"]
    }
  }
}
```

## ๐Ÿ”ง Configuration for Cursor

Add to your Cursor MCP configuration:

```json
{
  "mcpServers": {
    "api-creator-mcp": {
      "command": "npx",
      "args": ["-y", "api-creator-mcp"]
    }
  }
}
```

## ๐Ÿ› ๏ธ Available Tools

### 1. create_rest_api
Generate a complete REST API with Express/Fastify.

```json
{
  "name": "tasks-api",
  "endpoints": [
    { "path": "/tasks", "method": "GET", "description": "List all tasks" },
    { "path": "/tasks", "method": "POST", "description": "Create a task" },
    { "path": "/tasks/:id", "method": "DELETE", "description": "Delete a task" }
  ],
  "database": "postgres",
  "authentication": true,
  "validation": true
}
```

### 2. generate_from_openapi
Convert an OpenAPI specification into a working server.

```json
{
  "openapi_spec": "{\"openapi\":\"3.0.0\",...}",
  "output_language": "typescript",
  "generate_sdk": true
}
```

### 3. create_graphql_api
Generate a GraphQL API with Apollo Server.

```json
{
  "name": "blog-api",
  "schema": {
    "types": "type Post { id: ID! title: String! content: String! }",
    "queries": "posts: [Post]",
    "mutations": "createPost(title: String!, content: String!): Post"
  },
  "data_source": "postgres",
  "subscriptions": true
}
```

### 4. create_microservice
Generate a microservice with async communication.

```json
{
  "name": "order-service",
  "communication": "kafka",
  "service_discovery": "consul",
  "observability": true
}
```

### 5. deploy_api
Deploy a generated API to cloud platforms.

```json
{
  "api_path": "./generated-apis/tasks-api",
  "platform": "docker",
  "environment": {
    "NODE_ENV": "production",
    "PORT": "3000"
  }
}
```

## ๐Ÿ“– Usage Examples

### Creating a Task Management API

```bash
# The MCP server will generate:
# - Express server with TypeScript
# - PostgreSQL integration with Prisma
# - JWT authentication
# - Zod validation for all endpoints
# - Complete project structure
```

### Converting an Existing API

```bash
# Provide your OpenAPI 3.0 spec
# The server will generate:
# - Fully typed TypeScript server
# - Client SDK for easy integration
# - All endpoints from your spec
```

## ๐Ÿ”’ Security

- **Input Validation**: All parameters validated with Zod schemas
- **Rate Limiting**: 100 requests per minute per client
- **Path Sanitization**: Prevents path traversal attacks
- **Permission System**: Role-based access control
- **No eval/exec**: Safe template literals only
- **JWT Authentication**: Built-in auth middleware

## ๐Ÿ“ Project Structure

```
api-creator-mcp/
โ”œโ”€โ”€ src/
โ”‚   โ”œโ”€โ”€ core/           # MCP server core
โ”‚   โ”œโ”€โ”€ tools/          # Tool implementations
โ”‚   โ”œโ”€โ”€ types/          # TypeScript types and Zod schemas
โ”‚   โ””โ”€โ”€ utils/          # Security and validation utilities
โ”œโ”€โ”€ tests/
โ”‚   โ”œโ”€โ”€ unit/           # Unit tests
โ”‚   โ””โ”€โ”€ integration/    # Integration tests
โ”œโ”€โ”€ templates/          # API templates
โ””โ”€โ”€ docs/               # Documentation
```

## ๐Ÿงช Testing

```bash
# Run all tests
npm test

# Run with coverage
npm run test:coverage

# Watch mode
npm run test:watch
```

## ๐Ÿค Contributing

1. Fork the repository
2. Create your feature branch (`git checkout -b feature/amazing-feature`)
3. Commit your changes (`git commit -m 'Add amazing feature'`)
4. Push to the branch (`git push origin feature/amazing-feature`)
5. Open a Pull Request

## ๐Ÿ“ License

This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.

## ๐Ÿ™ Acknowledgments

- [Model Context Protocol](https://modelcontextprotocol.io)
- [Express.js](https://expressjs.com)
- [Apollo GraphQL](https://www.apollographql.com)
- [gRPC](https://grpc.io)

## ๐Ÿ“ž Support

- Issues: [GitHub Issues](https://github.com/yourusername/api-creator-mcp/issues)
- Discussions: [GitHub Discussions](https://github.com/yourusername/api-creator-mcp/discussions)"

TDQS

A3.7/5.0

Scored across 5 tools

Disambiguation5/5

Each tool targets a distinct API development task: GraphQL, microservice, REST, deployment, and OpenAPI conversion. No two tools have overlapping purposes.

Naming Consistency5/5

All tool names follow the verb_noun pattern with lowercase underscores (create_*, deploy_*, generate_from_*), providing a clear and consistent naming convention.

Tool Count5/5

5 tools cover the core workflow of API creation and deployment without being excessive or insufficient for the stated purpose.

Completeness5/5

The tool surface provides a complete set for generating and deploying APIs, including three API styles and OpenAPI conversion, with no obvious missing operations for creation and deployment.

Maintenance

ActivityInactive
ResponsivenessNo issues