Mokapi is an open-source API mocking tool that lets you develop and test without waiting for backends. Mock REST APIs, Kafka topics, LDAP directories, and SMTP servers using OpenAPI and AsyncAPI specifications.
Perfect for:
- Frontend developers building UIs before backends exist
- QA teams testing edge cases, errors, and timeouts
- DevOps engineers running reliable CI/CD tests without external dependencies
- API designers prototyping and validating contracts early
Try Instantly
npx go-mokapi https://petstore3.swagger.io/api/v3/openapi.json
Then test your mock:
curl http://localhost/api/v3/pet/1 -H 'Accept: application/json'
Mock HTTP/HTTPS, Apache Kafka, LDAP, and SMTP — all from a single tool.
Uses OpenAPI and AsyncAPI specs as the source of truth. Your mocks stay aligned with your API contracts.
Control responses, simulate errors, add delays, or create complex workflows using embedded JavaScript:
import { on } from 'mokapi'
export default function() {
on('http', (request, response) => {
// Return 404 for specific IDs
if (request.path.petId === '999') {
response.statusCode = 404
return
}
// Customize response data
response.data.name = 'Custom Pet Name'
})
}Version control your mocks alongside your code. Run them in CI/CD pipelines. No UI configuration required.
Override parts of your OpenAPI spec without modifying the original file. Perfect for testing different scenarios.
Visualize requests, responses, and logs in real-time at http://localhost:8080

Load specs from local files, HTTP URLs, Git repositories, or NPM packages.
Mock backend APIs while building UIs. Test loading states, errors, and edge cases without waiting for real endpoints.
Simulate timeouts, 500 errors, rate limits, and malformed responses. Test how your application handles failures.
Run fast, reliable tests without external dependencies. No flaky tests due to network issues or unavailable services.
Validate that your requests and responses match your OpenAPI specification. Catch breaking changes early.
Explore tutorials that walk you through mocking different protocols and scenarios:
-
Get started with REST API
Mock a REST API using OpenAPI specification -
Mock Kafka with AsyncAPI
Simulate Kafka topics and validate message producers -
Mock LDAP Authentication
Test authentication flows without a real LDAP server -
Mock SMTP Mail Servers
Test email workflows without sending real messages -
CI/CD Integration with GitHub Actions
Run Mokapi in automated test pipelines
More examples mokapi.io/resources
- Getting Started Guide
- HTTP/REST API Documentation
- Kafka Documentation
- LDAP Documentation
- SMTP/Mail Documentation
- JavaScript API Reference
- Configuration Guide
If Mokapi helps your team ship faster, consider supporting development:
MIT License - see LICENSE for details.
- Website: mokapi.io
- GitHub: github.com/marle3003/mokapi
- NPM Package: npmjs.com/package/go-mokapi
- Documentation: mokapi.io/docs
- Tutorials: mokapi.io/resources/tutorials
- Blog: mokapi.io/resources/blogs
