Inspiration

We realized that while AI agents are getting smarter, connecting them to real-world systems remains dangerously fragile. Developers currently face a terrible trade-off: write brittle, hardcoded integrations for every API, or risk unsafe dynamic code execution that hallucinates parameters and leaks secrets. We asked ourselves: What if we could treat an API spec not as documentation, but as a strict, executable contract for AI? Nativara was born from the idea that we shouldn't generate code; we should generate a protocol-independent interface that enforces safety by design.

What it does

Nativara transforms any standard OpenAPI (REST) specification into a safe, visual, and interactive toolset for AI agents.

  • Ingest: Upload an OpenAPI 3.x document. We parse, dereference, and normalize it into a deterministic operation catalog.
  • Analyze: Our engine proposes intent-oriented tools (e.g., get_weather, compare_forecasts) with pre-classified safety levels (Read-Only vs. Destructive).
  • Validate: A "fail-closed" validator ensures every proposed tool binding matches the source schema exactly—no hallucinated parameters allowed.
  • Execute: Once published, Nativara exposes a secure MCP (Model Context Protocol) endpoint. When an agent calls a tool, we execute the HTTP request with strict SSRF prevention and return structured data that renders interactive widgets (charts, tables, cards) directly inside the chat interface.

🚀 Live Demo: https://nativara.up.railway.app

How we built it

We built Nativara as a TypeScript monorepo powered by Next.js 15, MongoDB, and Zod for runtime validation.

  • Core Architecture: We separated the "brain" (@ainative/core) from the "hands" (@ainative/runtime, @ainative/mcp-adapter). The core holds a protocol-independent Intermediate Representation (IR), ensuring we aren't locked into MCP forever.
  • Safety First: The runtime (@ainative/runtime) implements a hardened HTTP client that rejects redirects, pins DNS connections to prevent rebinding, and enforces an 8-second timeout/1MB limit.
  • AI Collaboration: We partnered heavily with OpenAI Codex and GPT-5.6. Codex scaffolded our entire workspace structure, generated 70+ test cases for our validators, and drafted the complex logic for our SSRF prevention layer. GPT-5.6 helped refine our Zod schemas to balance strictness with flexibility.
  • Deployment: We containerized the application and deployed it on Railway for instant global availability.

Challenges we ran into

  • Determinism vs. Flexibility: Early on, we tried using an LLM to propose tool mappings dynamically. It was too non-deterministic for a hackathon demo—one bad prompt would break the flow. We pivoted to a versioned template system that guarantees reproducible results for known APIs like Open-Meteo.
  • Security Boundaries: Implementing "fail-closed" validation was harder than expected. We had to ensure that any mismatch between the proposal and the OpenAPI spec resulted in a hard error, not a silent fix. This required writing custom diffing logic against Zod schemas.
  • Widget Rendering: Getting ChatGPT to render interactive charts instead of plain text required precise mapping of our internal data structure to the MCP Apps SDK's structuredContent format. One wrong field name would break the UI.

Accomplishments that we're proud of

  • Zero Runtime Code Generation: Unlike other solutions that exec dynamic code, we publish pure data contracts. This makes our system inherently safer and auditable.
  • Protocol Independence: Our core logic has zero dependencies on MCP or Next.js. We could swap the output adapter to GraphQL or gRPC tomorrow without touching the analyzer.
  • End-to-End Safety: From DNS resolution to response parsing, every hop is validated. We successfully blocked simulated SSRF attacks during our testing phase.
  • Live Deployment: We went from local prototype to a fully hosted, public-facing MCP endpoint on Railway in under 24 hours.
  • 70+ Automated Tests: Comprehensive test coverage across all packages ensuring reliability.

What we learned

  • Trust Nothing: Even "trusted" OpenAPI specs can have weird edge cases. Validating the response from an API is just as important as validating the request.
  • AI as a Pair Programmer, Not a Pilot: Codex excelled at boilerplate, tests, and refactoring, but human judgment was critical for architectural boundaries and security policies. We learned to let AI write the how, but humans must define the what.
  • Simplicity Wins: By limiting our initial widget set to just three types (Chart, Table, Card), we delivered a more polished experience than trying to support everything.
  • Fail-Closed is Non-Negotiable: For AI agent safety, any uncertainty must result in rejection, not guesswork.

What's next for Nativara

  • LLM-Powered Analysis: Replace static templates with a validated LLM proposer to support any OpenAPI spec without manual mapping.
  • Multi-Protocol Support: Adding adapters for GraphQL subscriptions and gRPC streams.
  • Auth Flows: Integrating OAuth 2.0 and OIDC so agents can perform authenticated actions on behalf of users safely.
  • Template Marketplace: Allowing the community to share and rate analysis templates for popular APIs (Stripe, Twilio, Shopify).
  • Analytics Dashboard: Usage metrics, cost tracking, and latency histograms for production monitoring.

Built With

Share this project:

Updates