Sample on how you can consume any REST API from an OpenAPI file, save data to MongoDB and generate Java code for this too, using Claude Code, without knowing the API structure or writing any code.
Warning
This is just experimental at this point; it is still under development. Please do not use it with sensitive data for now; please wait for a
stable release.
It's mostly ideal for experimental and learning projects.**
- Add MCP server for any REST API with OpenAPI specs
- We have already configured MCP servers for
petstoreandweatherAPI - Discover what we can do with the API
- Simple flow on how to consume the API without knowing the structure
- Saving the data in mongodb
- A more complex example with a flow that requires several API calls
- Generate code for the above flows
Get docker-compose.yml and save it in a folder where you'll run the next commands.
docker compose up -ddocker compose attach claude-agentSee more
claudeHandle login.
/model
short summary of what weather tools offer
get top 3 active weather alerts for today in US Florida, show them and also save them using mongodb tools in db named weather and collection named alerts
mongosh --quiet --eval "use('weather'); db.alerts.find().pretty()"discover what tools to call from weather tools to get temperature, cloud cover and wind speed for last 3 days, all measurements per day, in palo alto, show them as table and have them in mongodb tools in db weather collections historical
mongosh --quiet --eval "use('weather'); db.historical.find().pretty()"/mpc
generate a new project in weather-api-client folder for the 2 flows from above, alerts and historic data
first generate detailed asciiart diagrams for all the implementation (add this to README.md) and then the actual code
respsect these:
- git initiated
- springboot
- java21
- okhttp code for RST API calls to weather tools
- jackson json
- clean code, KISS and SOLID
- persistence layer on mongodb
- generate extensive unit and integration tests for all flows
- test and run and the app
then commit tme with relevant commit message
View diagrams while generating the code. You could first review and change the diagrams as needed, and then generate the code based on those
give me curl samples how to test it and does it really save the data in mongodb
mongosh weather --eval "db.dropDatabase()" --quiet
rm -rf weather-api-clientdocker compose downdocker compose downThe Dockerfile is based on claude-code/.devcontainer
cd docker
docker buildx build --sbom=true --provenance=true -t xorio42/claude-agent .









