A2A Server Plugin
Author: nacos
Version: 0.0.4
Type: extension
Repository: https://github.com/nacos-group/nacos-dify-plugins
Expose Dify apps as A2A (Agent-to-Agent) protocol agents for external discovery and invocation.
Features
- A2A Protocol Support: Expose any Dify App (Chatbot/Agent/Chatflow/Workflow) as an A2A-compatible agent
- Agent Discovery: Support endpoint for agent metadata discovery
- Nacos Integration: Optional registration to Nacos Agent Registry for centralized agent management
- Multi-turn Conversation: Maintain conversation context across multiple requests using Dify Plugin Storage
- Streaming Response: Support streaming mode for Agent Chat Apps
Quick Start
Step 1: Install the Plugin
- Download the plugin package from GitHub Releases
- In Dify, go to Plugins → Install Plugin
- Upload the plugin package and complete the installation
Step 2: Create an Endpoint (First Time)
- Go to Plugins → a2a_server → Create Endpoint
- Configure the required settings:
- Click Save to create the endpoint
Important: The endpoint ID is generated by Dify after you save. You cannot know the correct URL before creating the endpoint. Use a placeholder value first (e.g., ).
Step 3: Update the Correct URL
After saving, Dify will generate an endpoint ID (e.g., ). Now you need to update the URL:
- Go back to Edit Endpoint
- Update Agent Public URL to the correct value:
- Click Save again
Your final A2A URLs will be:
Step 4: Test the Agent
Test by fetching the Agent Card:
If successful, you'll receive a JSON response with your agent's metadata.
Note: If Nacos registration is enabled, the agent will be registered to Nacos when you call this GET endpoint for the first time. Before calling this endpoint, the agent is NOT registered to Nacos.
For sending messages via the POST endpoint, it's recommended to use an A2A SDK or A2A-compatible client.
Configuration Reference
Nacos Registration
When to Use Nacos
- You have multiple A2A agents and want centralized discovery
- You're using Nacos as your service registry
- You want agents to discover each other automatically
Registration Behavior
- Lazy Registration: The agent is NOT registered to Nacos immediately when the plugin starts
- First Request Trigger: Registration only occurs when the first GET request is made to
- Cache-based Deduplication: After registration, the AgentCard is cached locally (15 seconds TTL) to avoid duplicate registrations
- Change Detection: If the agent configuration changes (name, description, or URL), the agent will be re-registered to Nacos
- Remote Sync: After successful registration, the plugin fetches the AgentCard from Nacos to ensure cache consistency
Configuration Examples
Self-hosted Nacos:
Aliyun MSE Nacos:
API Reference
Endpoints
Supported JSON-RPC Methods
Response Format
Troubleshooting
Agent Card Not Returned
- Check that the endpoint is correctly configured
- Verify the URL path includes
- Check Dify logs for error messages
Nacos Registration Failed
- Verify Nacos server is accessible from Dify
- Check authentication credentials
- Ensure the namespace ID exists in Nacos
Message Send Returns Error
- Verify the Dify App is properly configured
- Check that the app supports chat/conversation mode
- Review the JSON-RPC request format
Requirements
- Dify version with plugin support
- Python 3.12+
- (Optional) Nacos server for agent registration
License
Apache License 2.0