|
1 | | -## A2A Protocol Inspector |
| 1 | +# A2A Protocol Inspector |
| 2 | + |
2 | 3 | The A2A Inspector is a web-based tool designed to help developers inspect, debug, and validate servers that implement the Google A2A (Agent-to-Agent) protocol. It provides a user-friendly interface to interact with an A2A agent, view communication, and ensure specification compliance. |
3 | 4 |
|
4 | | -The application is built with FastAPI and uses Socket.IO for real-time communication. |
| 5 | +The application is built with a FastAPI backend and a TypeScript frontend. |
| 6 | + |
| 7 | +## Features |
| 8 | + |
| 9 | +- **Connect to a local A2A Agent:** Specify the base URL of any agent server to connect (e.g., `http://localhost:5555`). |
| 10 | +- **View Agent Card:** Automatically fetches and displays the agent's card. |
| 11 | +- **Spec Compliance Checks:** Performs basic validation on the agent card to ensure it adheres to the A2A specification. |
| 12 | +- **Live Chat:** A chat interface to send and receive messages with the connected agent. |
| 13 | +- **Debug Console:** A slide-out console shows the raw JSON-RPC 2.0 messages sent and received between the inspector and the agent server. |
| 14 | + |
| 15 | +## Prerequisites |
| 16 | + |
| 17 | +- Python 3.10+ |
| 18 | +- [uv](https://github.com/astral-sh/uv) |
| 19 | +- Node.js and npm |
5 | 20 |
|
6 | | -### Features |
7 | | -* Connect to a local A2A Agent: Specify the base URL of any agent server to connect (e.g. http://localhost:5555). |
8 | | -* View Agent Card: Automatically fetches and displays the agent's card. |
9 | | -* Spec Compliance Checks: Performs basic validation on the agent card to ensure it adheres to the A2A specification. |
10 | | -* Messages: A chat interface to send and receive text messages with the connected agent. |
11 | | -* Debug Console: A slide-out console at the bottom of the screen shows the raw JSON-RPC 2.0 messages sent and received between the inspector and the agent server. |
| 21 | +## Project Structure |
12 | 22 |
|
| 23 | +This repository is organized into two main parts: |
13 | 24 |
|
14 | | -### Prerequisites |
15 | | -Python 3.10+ |
16 | | -uv |
17 | | -Node.js and npm |
| 25 | +- `./backend/`: Contains the Python FastAPI server that handles WebSocket connections and communication with the A2A agent. |
| 26 | +- `./frontend/`: Contains the TypeScript and CSS source files for the web interface. |
18 | 27 |
|
19 | | -### Setup and Installation |
20 | | -Follow these steps to get the A2A Inspector running on your local machine. |
| 28 | +## Setup and Running the Application |
21 | 29 |
|
| 30 | +Follow these steps to get the A2A Inspector running on your local machine. The setup is a three-step process: install Python dependencies, install Node.js dependencies, and then run the two processes. |
| 31 | + |
| 32 | +### 1. Clone the repository |
| 33 | + |
| 34 | +```sh |
| 35 | +git clone https://github.com/google-a2a/a2a-inspector.git |
22 | 36 | cd a2a-inspector |
| 37 | +``` |
| 38 | + |
| 39 | +### 2. Install Dependencies |
| 40 | + |
| 41 | +First, install the Python dependencies for the backend from the root directory. `uv sync` reads the `uv.lock` file and installs the exact versions of the packages into a virtual environment. |
23 | 42 |
|
24 | | -#### Install Dependencies |
25 | | -Install all required packages from the requirements.txt file using uv. |
| 43 | +```sh |
| 44 | +# Run from the root of the project |
| 45 | +uv sync |
| 46 | +``` |
26 | 47 |
|
27 | | -uv pip install -r requirements.txt |
| 48 | +Next, install the Node.js dependencies for the frontend. |
28 | 49 |
|
29 | | -From the inspector folder, run: |
| 50 | +```sh |
| 51 | +# Navigate to the frontend directory |
| 52 | +cd frontend |
| 53 | + |
| 54 | +# Install npm packages |
30 | 55 | npm install |
31 | 56 |
|
32 | | -#### Running the Application |
33 | | -##### Build the frontend. |
34 | | -npm run build |
| 57 | +# Go back to the root directory |
| 58 | +cd .. |
| 59 | +``` |
| 60 | + |
| 61 | +### 3. Run the Application |
| 62 | + |
| 63 | +The application requires two processes to run concurrently: the frontend build process (in watch mode) and the backend server. |
| 64 | + |
| 65 | +**In your first terminal**, run the frontend development server. This will build the assets and automatically rebuild them when you make changes. |
| 66 | + |
| 67 | +```sh |
| 68 | +# Navigate to the frontend directory |
| 69 | +cd frontend |
| 70 | + |
| 71 | +# Build the frontend and watch for changes |
| 72 | +npm run build -- --watch |
| 73 | +``` |
| 74 | + |
| 75 | +**In a second terminal**, run the backend Python server. |
| 76 | + |
| 77 | +```sh |
| 78 | +# Navigate to the backend directory |
| 79 | +cd backend |
35 | 80 |
|
| 81 | +# Run the FastAPI server with live reload |
36 | 82 | uv run app.py |
| 83 | +``` |
37 | 84 |
|
| 85 | +### 4. Access the Inspector |
38 | 86 |
|
39 | | -#### Access the Inspector |
40 | | -Open your web browser and navigate to: |
41 | | -http://127.0.0.1:5001 |
| 87 | +Once both processes are running, open your web browser and navigate to: |
| 88 | +**[http://127.0.0.1:5001](http://127.0.0.1:5001)** |
0 commit comments