Loads OpenAPI specifications so agents can explore and explain APIs and generate code or mock data from them.
Setup
Choose your client, copy the config, then fill in any required environment variables.
claude mcp add openapi --env SPEC_DIR='<SPEC_DIR>' -- npx -y @reapi/mcp-openapi@latest --dir ./specs~/.codex/config.toml
[mcp_servers.openapi]
command = "npx"
args = ["-y", "@reapi/mcp-openapi@latest", "--dir", "./specs"]
env = { SPEC_DIR = "<SPEC_DIR>" }
# codex mcp add openapi --env SPEC_DIR='<SPEC_DIR>' -- npx -y @reapi/mcp-openapi@latest --dir ./specs~/.cursor/mcp.json
{
"mcpServers": {
"openapi": {
"command": "npx",
"args": [
"-y",
"@reapi/mcp-openapi@latest",
"--dir",
"./specs"
],
"env": {
"SPEC_DIR": "<SPEC_DIR>"
}
}
}
}.vscode/mcp.json
{
"servers": {
"openapi": {
"type": "stdio",
"command": "npx",
"args": [
"-y",
"@reapi/mcp-openapi@latest",
"--dir",
"./specs"
],
"env": {
"SPEC_DIR": "<SPEC_DIR>"
}
}
}
}~/.gemini/settings.json
{
"mcpServers": {
"openapi": {
"command": "npx",
"args": [
"-y",
"@reapi/mcp-openapi@latest",
"--dir",
"./specs"
],
"env": {
"SPEC_DIR": "<SPEC_DIR>"
}
}
}
}claude_desktop_config.json
{
"mcpServers": {
"openapi": {
"command": "npx",
"args": [
"-y",
"@reapi/mcp-openapi@latest",
"--dir",
"./specs"
],
"env": {
"SPEC_DIR": "<SPEC_DIR>"
}
}
}
}.trae/mcp.json
{
"mcpServers": {
"openapi": {
"command": "npx",
"args": [
"-y",
"@reapi/mcp-openapi@latest",
"--dir",
"./specs"
],
"env": {
"SPEC_DIR": "<SPEC_DIR>"
}
}
}
}Environment variables
SPEC_DIR
Replace the placeholders with your own credentials and keep them out of version control.