{"id":29341448,"url":"https://github.com/yeeaiclub/a2a-go","last_synced_at":"2026-01-14T16:25:50.294Z","repository":{"id":302300938,"uuid":"1011934749","full_name":"yeeaiclub/a2a-go","owner":"yeeaiclub","description":"Go implementation of the Agent-to-Agent (A2A/a2a)  protocol ","archived":false,"fork":false,"pushed_at":"2025-12-13T13:06:52.000Z","size":247,"stargazers_count":9,"open_issues_count":3,"forks_count":2,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-12-15T04:34:34.679Z","etag":null,"topics":["a2a","a2a-go","go","go-a2a","mcp"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/yeeaiclub.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-07-01T14:53:17.000Z","updated_at":"2025-12-13T13:06:48.000Z","dependencies_parsed_at":null,"dependency_job_id":"daba7f00-c0fb-4684-907c-4a7a1efad169","html_url":"https://github.com/yeeaiclub/a2a-go","commit_stats":null,"previous_names":["yumosx/a2a-go-1"],"tags_count":6,"template":false,"template_full_name":null,"purl":"pkg:github/yeeaiclub/a2a-go","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yeeaiclub%2Fa2a-go","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yeeaiclub%2Fa2a-go/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yeeaiclub%2Fa2a-go/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yeeaiclub%2Fa2a-go/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/yeeaiclub","download_url":"https://codeload.github.com/yeeaiclub/a2a-go/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yeeaiclub%2Fa2a-go/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28425811,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-14T15:24:48.085Z","status":"ssl_error","status_checked_at":"2026-01-14T15:23:41.940Z","response_time":107,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["a2a","a2a-go","go","go-a2a","mcp"],"created_at":"2025-07-08T09:01:36.016Z","updated_at":"2026-01-14T16:25:50.289Z","avatar_url":"https://github.com/yeeaiclub.png","language":"Go","funding_links":[],"categories":["⚙️ Implementations \u0026 Libraries","Server Implementations"],"sub_categories":["🛠️ \u003ca name=\"developer-tools\"\u003e\u003c/a\u003eDeveloper Tools"],"readme":"# a2a-go: Agent-to-Agent Protocol SDK for Go\n\n[![GoDoc](https://pkg.go.dev/badge/github.com/yeeaiclub/a2a-go)](https://pkg.go.dev/github.com/yeeaiclub/a2a-go)\n[![License](https://img.shields.io/badge/License-Apache_2.0-blue.svg)](LICENSE)\n[![Codecov](https://img.shields.io/codecov/c/github/yeeaiclub/a2a-go/main?logo=codecov\u0026logoColor=white)](https://codecov.io/gh/yeeaiclub/a2a-go/branch/main)\n[![Status](https://img.shields.io/badge/Status-Under%20Development-orange.svg)](https://github.com/yeeaiclub/a2a-go)\n\n**a2a-go** is a comprehensive Go SDK implementation of the **Agent-to-Agent (A2A) protocol**, providing a robust foundation for building AI agent communication systems. This SDK enables seamless integration between AI agents with middleware support, authentication, and full protocol method implementation.\n\n\u003e **⚠️ This project is currently under active development. APIs may change without notice.**\n\n## Overview\n\nThe **a2a-go** SDK implements the [A2A protocol specification](https://github.com/a2aproject/A2A) in Go, offering:\n\n### Core A2A Protocol Methods\n- [x] **Authentication** - Secure agent authentication\n- [x] **Send Task** - Submit tasks to other agents\n- [x] **Get Task** - Retrieve task information and status\n- [x] **Cancel Task** - Cancel running or pending tasks\n- [x] **Stream Task** - Real-time task result streaming\n- [x] **Set Push Notification** - Configure push notifications for tasks\n- [x] **Get Push Notification** - Retrieve push notification configurations\n\n### SDK Features\n- [x] **Middleware Support** - Extensible middleware architecture for request/response processing\n- [x] **Security Schemes** - Support for multiple authentication methods (API Key, Bearer, OAuth2, OpenID Connect)\n- [x] **Context Management** - Flexible context handling with security configuration\n\n\n## Installation\n\n```shell\ngo get github.com/yeeaiclub/a2a-go\n```\n\n## Quick Start\n\n## client\n\n```go\n// Initialize an HTTP client with a custom timeout (you can adjust config.Timeout as needed)\nhttpClient := \u0026http.Client{ Timeout: config.Timeout }\n\n// Create a new a2a-go client instance using the HTTP client and the API base URL\n// Replace \"http://localhost:8080/api\" with your actual server endpoint\na2aClient := client.NewClient(httpClient, \"http://localhost:8080/api\")\n```\n\n\u003e The above code demonstrates how to set up the a2a-go client. You need to provide a custom `http.Client` (for timeout, proxy, etc.) and the API endpoint of your a2a server.\n\n```go\n// Example: Sending a message using the a2a-go client\nresp, err := client.SendMessage(types.MessageSendParam{\n    Message: \u0026types.Message{\n        TaskID: taskID,           // The ID of the task this message belongs to\n        Role:   types.User,       // The sender's role (e.g., User, Agent)\n        Parts: []types.Part{\n            // Message content parts; here we use a text message as an example\n            \u0026types.TextPart{Kind: \"text\", Text: message},\n        },\n    },\n})\n```\n\n\u003e The above code shows how to send a message:\n\u003e - `TaskID`: Specifies which task the message is associated with. **This field can be empty if you are starting a new task; the server will generate a new TaskID automatically if not provided.**\n\u003e - `Role`: Indicates the sender's role (such as User or Agent).\n\u003e - `Parts`: Supports multiple content types (text, image, etc.); here, a text message is used.\n\u003e \n\u003e The `resp` variable contains the server's response, and `err` is used for error handling.\n\nIf you want to receive messages from the server in a streaming fashion, you can use the `SendMessageStream` method:\n```go\n// Create a channel to receive events (buffer size 10 as an example)\nevents := make(chan events, 10)\n\nerr := client.SendMessageStream(types.MessageSendParam{\n    Message: \u0026types.Message{\n        TaskID: taskID,           // The ID of the task this message belongs to\n        Role:   types.User,       // The sender's role (e.g., User, Agent)\n        Parts: []types.Part{\n            // Message content parts; here we use a text message as an example\n            \u0026types.TextPart{Kind: \"text\", Text: message},\n        },\n    },\n}, events)\n```\n\n\u003e The above code demonstrates how to use `SendMessageStream` to receive server responses as a stream. Events will be sent to the `events` channel as they arrive. This is useful for real-time or incremental message processing.\n\n## Server\n\nAn a2a-server essentially consists of four components: taskStore, executor, queueManager, and updater.\n- **taskStore**: Used to store and update task information and status.\n- **queueManager**: Manages the creation and destruction of queues related to tasks.\n- **executor**: (explained below)\n- **updater**: Assists with task status tracking and updates.\n\nExample of basic server setup:\n\n```go\nstore := tasks.NewInMemoryTaskStore()\nmanager := a2a.NewQueueManager()\n\ndefaultHandler := handler.NewDefaultHandler(store, a2a.NewExecutor(), handler.WithQueueManger(manager))\nserver := handler.NewServer(\"/card\", \"/api\", agentCard, defaultHandler)\nserver.Start(8080)\n```\n\nThe Executor module provides two core functions: `Execute` and `Cancel`.\n\n- The `Execute` function is responsible for executing the specified task based on the user-provided context.\n- The `Cancel` function cancels the execution of the corresponding task.\n\nDuring execution, the function uses a built-in status update mechanism to provide real-time feedback on task progress. The implementation includes:\n\n1. **Status update mechanism**: Uses the `updater` utility to track and update task status.\n2. **Message queue interaction**: All status changes and progress information are written to the event queue (`event.Queue`) in real time.\n3. **Result return**: The final execution result is returned to the caller via the queue.\n\nTypical implementation example:\n\n```go\nfunc (e *Executor) Execute(ctx context.Context, requestContext *execution.RequestContext, queue *event.Queue) error {\n    // Initialize the task status tracker\n    u := updater.NewTaskUpdater(queue, requestContext.TaskId, requestContext.ContextId)\n\n    // Create the initial status message\n    message := u.NewAgentMessage([]types.Part{\n        \u0026types.TextPart{Text: \"start the work\", Kind: types.PartTypeText},\n    })\n\n    // Update task status\n    u.StartWork(updater.WithMessage(message))\n    u.Complete()\n    \n    return nil\n}\n```\n\n## Documentation\n\n- [GoDoc](https://pkg.go.dev/github.com/yeeaiclub/a2a-go) - API documentation\n- [A2A Specification](https://github.com/a2aproject/A2A) - Protocol specification\n\n\n## Contributing\n\nWe welcome contributions! Please read our contributing guidelines before submitting pull requests.\n\n\u003e **Note:** Since this project is under active development, we recommend checking the latest issues and discussions before contributing to understand the current development priorities.\n\n## License\n\nThis project is licensed under the [Apache 2.0 License](LICENSE).\n\n---\n**Keywords**: a2a-go, a2a, agent-to-agent, Go SDK, AI agents, protocol implementation, middleware, authentication, streaming, task management","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fyeeaiclub%2Fa2a-go","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fyeeaiclub%2Fa2a-go","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fyeeaiclub%2Fa2a-go/lists"}