Skip to main content
Narada supports two industry-standard protocols for agent integration: Agent-to-Agent (A2A) and Model Context Protocol (MCP). These protocols enable seamless communication between Narada and other AI agents or systems.

Overview

Both A2A and MCP provide standardized ways to interact with Narada’s capabilities:
  • A2A Protocol: Enables direct agent-to-agent communication following the A2A specification
  • MCP Protocol: Uses the Model Context Protocol with Streamable HTTP for structured interactions

A2A Protocol

The Agent-to-Agent (A2A) protocol enables direct communication between AI agents using a standardized specification.

Agent Discovery

Narada’s A2A agent information is available at the well-known endpoint. You can discover the agent card as :
cURL
curl -X GET 'https://api.narada.ai/fast/v2/a2a/.well-known/agent.json'
Agent Information
{
  "name": "Narada AI Agent",
  "description": "AI agent for automating tasks through web browsing and integrations",
  "version": "0.0.1",
  "url": "https://api.narada.ai/fast/v2/a2a",
  "authentication": {
    "type": "bearer",
    "description": "API key required"
  },
  // Additional fields...
}

A2A Endpoint

The main A2A endpoint follows the exact A2A protocol specification: Endpoint: https://api.narada.ai/fast/v2/a2a
The A2A endpoint implements the complete A2A protocol specification. Refer to the official A2A documentation for detailed protocol requirements and message formats.

Authentication

A2A requests require authentication using your Narada API key:
Authorization
string
required
Bearer token for API authentication. Format: Bearer YOUR_API_KEY

Example A2A Request

This example demonstrates how to use the A2A Python SDK to discover Narada’s agent card and send a streaming message request asking the Operator agent to navigate to google. First, install the A2A Python SDK:
pip install a2a-sdk
The A2A SDK is the official Python library for the Agent2Agent Protocol. You can find more details in the A2A Python SDK repository.
import httpx
from a2a.client import A2ACardResolver, A2AClient
from a2a.types import (
    MessageSendParams,
    MessageSendConfiguration,
    Message,
    TextPart,
    JSONRPCErrorResponse,
    SendStreamingMessageRequest,
)
from uuid import uuid4

headers = {
    "Authorization": f"Bearer <NARADA_API_KEY>"
}

agent = "https://api.narada.ai/fast/v2/a2a"
async with httpx.AsyncClient(timeout=30, headers=headers) as client:
    card_resolver = A2ACardResolver(
        client, base_url=agent, agent_card_path="/.well-known/agent.json"
    )
    card = await card_resolver.get_agent_card()

    client = A2AClient(client, agent_card=card)

    # Create message
    message = Message(
        role="user",
        parts=[TextPart(text="/Operator navigate to google.com")],
        message_id=str(uuid4()),
        context_id=uuid4().hex,
    )

    # Send streaming request
    response_stream = client.send_message_streaming(
        SendStreamingMessageRequest(
            id=str(uuid4()),
            params=MessageSendParams(
                id=str(uuid4()),
                message=message,
                configuration=MessageSendConfiguration(accepted_output_modes=["text"]),
            ),
        )
    )

    # Print streaming responses
    async for result in response_stream:
        if isinstance(result.root, JSONRPCErrorResponse):
            print(f"Error: {result.root.error}")
        else:
            event = result.root.result
            print(f"stream event => {event.model_dump_json(exclude_none=True)}")

MCP Protocol

The Model Context Protocol (MCP) provides structured communication using Streamable HTTP for efficient data exchange.

MCP Endpoint

Endpoint: https://api.narada.ai/fast/v2/mcp
The MCP endpoint implements the complete Model Context Protocol specification. Refer to the official MCP documentation for the detailed protocol requirements and message formats

Authentication

MCP requests use the same authentication method as A2A:
Authorization
string
required
Bearer token for API authentication. Format: Bearer YOUR_API_KEY

Example MCP Request

This example demonstrates how to use the FastMCP Python SDK to send a streaming message request asking the Operator agent to navigate to google. First, install the FastMCP Python SDK:
pip install fastmcp
FastMCP is a Python library for the Model Context Protocol. You can find more details in the FastMCP documentation.
from fastmcp import Client
from fastmcp.client.transports import StreamableHttpTransport

headers = {
    "Authorization": f"Bearer <NARADA_API_KEY>"
}

url = "https://api.narada.ai/fast/v2/mcp"
client = Client(
    transport=StreamableHttpTransport(
        url,
        headers=headers,
    ),
)

async with client:
    await client.ping()

    # Create a new task
    result = await client.call_tool(
        name="narada",
        arguments={
            "prompt": "/Operator navigate to google.com"
        }
    )
    print(result.content)

Error Handling

Both protocols return standardized error responses:
Error Response
{
  "jsonrpc": "2.0",
  "id": 1,
  "error": {
    "code": -32601,
    "message": "Method not found",
    "data": // Some data...
  }
}

Common Error Codes

  • 401 Unauthorized: Invalid or missing API key
  • 400 Bad Request: Invalid request format or parameters
  • 422 Unprocessable Entity: Request validation failed
  • 500 Internal Server Error: Unexpected server error
  • 503 Service Unavailable: Service temporarily unavailable
I