The extract_endpoints tool scans your codebase for REST API endpoint definitions and extracts them into structured documentation. It supports multiple web frameworks and can export to OpenAPI or Postman formats for API documentation and testing.
Stellarion uses regex pattern matching optimized for each supported framework to detect route definitions. It extracts HTTP methods, paths, handlers, parameters, and middleware. The framework is auto-detected from your project configuration, or you can specify it explicitly.
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
path | string | No | . | Directory to scan |
framework | string | No | auto | auto, express, fastapi, spring, django, flask, or rails |
outputFormat | string | No | json | json, openapi, or postman |
groupBy | string | No | - | Group by method, path, or resource |
pathPrefix | string | No | - | Filter endpoints by path prefix |
includeParameters | boolean | No | false | Extract route parameters |
includeHandlers | boolean | No | false | Include handler function names |
includeMiddleware | boolean | No | false | Include middleware chain |
includeAuth | boolean | No | false | Include authentication requirements |
includeStatistics | boolean | No | false | Include endpoint statistics |
mcp__stellarion__extract_endpoints framework:express outputFormat:openapi includeParameters:true
| Framework | Detection Patterns |
|---|---|
| Express | app.get(), router.get(), app.post(), etc. |
| FastAPI | @app.get(), @router.get(), @app.post(), etc. |
| Spring | @GetMapping, @PostMapping, @RequestMapping, etc. |
| Django | URL patterns, class-based views, path(), re_path() |
| Flask | @app.route(), blueprints, @blueprint.route() |
| Rails | routes.rb definitions, resources, get, post, etc. |
Natural Language:
Extract all API endpoints from this project
Direct MCP Call:
mcp__stellarion__extract_endpoints
Returns: List of all detected endpoints with methods and paths
Natural Language:
Find all Express routes in the api directory
Direct MCP Call:
mcp__stellarion__extract_endpoints framework:express path:src/api/
Natural Language:
Extract endpoints and show their route parameters and handler functions
Direct MCP Call:
mcp__stellarion__extract_endpoints includeParameters:true includeHandlers:true
Natural Language:
Generate an OpenAPI specification from my API endpoints
Direct MCP Call:
mcp__stellarion__extract_endpoints outputFormat:openapi includeParameters:true
Returns: OpenAPI 3.0 specification document
Natural Language:
Create a Postman collection for testing my API
Direct MCP Call:
mcp__stellarion__extract_endpoints outputFormat:postman includeParameters:true
Returns: Postman Collection v2.1.0 ready for import
Natural Language:
Show me endpoints grouped by resource (users, products, orders, etc.)
Direct MCP Call:
mcp__stellarion__extract_endpoints groupBy:resource includeStatistics:true
Natural Language:
Extract only the API endpoints (paths starting with /api)
Direct MCP Call:
mcp__stellarion__extract_endpoints pathPrefix:/api includeStatistics:true
Natural Language:
Show me all endpoints with their authentication requirements
Direct MCP Call:
mcp__stellarion__extract_endpoints includeAuth:true includeMiddleware:true
Natural Language:
Extract all FastAPI endpoints with their parameters
Direct MCP Call:
mcp__stellarion__extract_endpoints framework:fastapi includeParameters:true includeHandlers:true
Standard JSON with endpoint details:
{
"endpoints": [
{
"method": "GET",
"path": "/api/users/:id",
"handler": "getUser",
"file": "src/routes/users.ts",
"line": 45,
"parameters": [
{ "name": "id", "type": "path", "required": true }
]
}
],
"statistics": {
"total": 24,
"byMethod": { "GET": 12, "POST": 6, "PUT": 4, "DELETE": 2 }
}
}
Complete OpenAPI specification compatible with Swagger UI, Redoc, and other documentation tools:
openapi: 3.0.0
info:
title: API Documentation
version: 1.0.0
paths:
/api/users/{id}:
get:
operationId: getUser
parameters:
- name: id
in: path
required: true
Ready-to-import Postman collection:
{
"info": {
"name": "API Collection",
"schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json"
},
"item": [...]
}
Each endpoint includes:
| Field | Description |
|---|---|
| HTTP method | GET, POST, PUT, DELETE, PATCH |
| Path pattern | Route path with parameters |
| Handler function | Name of the handler (when enabled) |
| File location | Source file path |
| Line number | Where the route is defined |
| Route parameters | Path and query parameters (when enabled) |
| Middleware | Middleware chain (when enabled) |
| Authentication | Auth requirements (when enabled) |
When includeStatistics: true:
| Metric | Description |
|---|---|
| Total count | Number of endpoints |
| By method | Breakdown by HTTP method |
| By prefix | Endpoints grouped by path prefix |
| Coverage | Files scanned vs. files with routes |
| Group By | Description |
|---|---|
method | Group by HTTP method (GET, POST, etc.) |
path | Group by path prefix (/api/users, /api/products) |
resource | Group by extracted resource name (users, products) |
framework: "auto" for automatic detection - usually works wellpathPrefix: "/api" to focus on API routes onlyoutputFormat: "openapi" for documentation toolsoutputFormat: "postman" for API testingincludeParameters: true for complete endpoint information# Extract endpoints with full details
mcp__stellarion__extract_endpoints outputFormat:openapi includeParameters:true includeHandlers:true
# Save the OpenAPI spec for documentation tools
# List all endpoints with auth info
mcp__stellarion__extract_endpoints includeAuth:true includeMiddleware:true groupBy:path
# Review which endpoints are protected
# Generate Postman collection
mcp__stellarion__extract_endpoints outputFormat:postman includeParameters:true
# Import into Postman for testing