OpenCode Integration
stdio
json
{
"mcp": {
"swag2mcp": {
"type": "local",
"command": ["swag2mcp", "mcp"],
"enabled": true
}
}
}HTTP
json
{
"mcp": {
"swag2mcp": {
"type": "local",
"command": ["swag2mcp", "mcp", "--transport", "sse", "--http-addr", "127.0.0.1:8080"],
"enabled": true
}
}
}Example Queries
Once connected, you can ask:
- "What APIs do you have?"
- "Show all endpoints in petstore"
- "Find an API for creating a user"
- "Call GET /pet/1 and show the result"