crewai - 💡(How to fix) Fix [FEATURE] End to end server and client example code for a2a protocall. [3 comments, 2 participants]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
GitHub stats
crewAIInc/crewAI#4606Fetched 2026-04-08 00:41:03
View on GitHub
Comments
3
Participants
2
Timeline
5
Reactions
0
Timeline (top)
commented ×3closed ×1labeled ×1
RAW_BUFFERClick to expand / collapse

Feature Area

Documentation

Is your feature request related to a an existing bug? Please link it here.

I am trying to setup agent to agent communication. but this documentation does not provide full working code how to setup server, agent card, and how communication happens from server to client. https://docs.crewai.com/en/learn/a2a-agent-delegation

Describe the solution you'd like

Please provide full working example from hosting agent, agent card and status update from from server.

Describe alternatives you've considered

No response

Additional context

No response

Willingness to Contribute

No response

extent analysis

Fix Plan

To set up agent-to-agent communication, we need to implement the following components:

  • Host agent
  • Agent card
  • Status update from server to client

Here are the concrete steps:

Step 1: Host Agent Setup

Create a host agent that will handle incoming requests from other agents.

import socket

def start_host_agent():
    host = '127.0.0.1'
    port = 12345

    # Create a socket object
    server_socket = socket.socket(socket.AF_INET, socket.SOCK_STREAM)

    # Bind the socket to the host and port
    server_socket.bind((host, port))

    # Listen for incoming connections
    server_socket.listen(5)
    print(f"Host agent listening on {host}:{port}")

    while True:
        # Accept incoming connections
        client_socket, address = server_socket.accept()
        print(f"Connection from {address} established")

        # Handle incoming requests
        request = client_socket.recv(1024)
        print(f"Received request: {request}")

        # Send response back to the client
        response = b"Request received"
        client_socket.send(response)
        client_socket.close()

start_host_agent()

Step 2: Agent Card Setup

Create an agent card that will send requests to the host agent.

import socket

def start_agent_card():
    host = '127.0.0.1'
    port = 12345

    # Create a socket object
    client_socket = socket.socket(socket.AF_INET, socket.SOCK_STREAM)

    # Connect to the host agent
    client_socket.connect((host, port))

    # Send a request to the host agent
    request = b"Hello from agent card"
    client_socket.send(request)

    # Receive response from the host agent
    response = client_socket.recv(1024)
    print(f"Received response: {response}")

    client_socket.close()

start_agent_card()

Step 3: Status Update from Server to Client

To update the status from the server to the client, you can use a similar approach as above, where the server sends a request to the client with the updated status.

import socket

def update_status(client_socket, status):
    # Send the updated status to the client
    client_socket.send(f"Status updated: {status}".encode())

# Example usage:
client_socket = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
client_socket.connect((host, port))
update_status(client_socket, "online")

Verification

To verify that the fix worked, you can test the communication between the host agent and the agent card by running the start_host_agent and start_agent_card functions. The host agent should receive the request from the agent card and send a response back.

Extra Tips

  • Make sure to handle any exceptions that may occur during

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING

crewai - 💡(How to fix) Fix [FEATURE] End to end server and client example code for a2a protocall. [3 comments, 2 participants]