AIRA HUB HAS A NEW VERSION THAT WORKS ON CLAUDE OR OTHER MCP CLIENTS THAT USE JSON OR MCP REMOTE.
---> NEW VERSION https://github.com/IhateCreatingUserNames2/AiraHub2/tree/main
Test demo on: https://airahub2.onrender.com/
CLAUDE JSON CONFIG:
{
"mcpServers": {
"aira-hub": {
"command": "npx",
"args": [
"mcp-remote",
"https://airahub2.onrender.com/mcp/stream"
]
}
}
}
AIRA Hub is a FastAPI-based platform for managing MCP (Model Context Protocol) tools and A2A (Agent-to-Agent) skills with OAuth 2.1 authentication. This document provides setup instructions, usage examples, and API reference for the system.
- Setup Instructions
- Authentication
- Agent Connection
- Tool/Skill Management
- API Reference
- Example Clients
- Troubleshooting
- Python 3.8+
- Required packages:
pip install fastapi uvicorn httpx pydantic jwt python-jose aiohttp sse-starlette
python AiraHub.py --host 0.0.0.0 --port 8015
The API documentation will be available at http://localhost:8015/docs
The system comes with these pre-configured users:
- admin / password123 (admin privileges)
- agent1 / password123 (agent privileges)
curl -X POST "http://localhost:8015/token" \
-d "username=admin&password=password123" \
-H "Content-Type: application/x-www-form-urlencoded"
Response:
{
"access_token": "eyJhbGciOi...",
"token_type": "bearer",
"expires_at": 1234567890
}
Refresh tokens are automatically handled via HTTP-only cookies. To manually refresh:
curl -X POST "http://localhost:8015/refresh-token" \
-H "Cookie: refresh_token=your_refresh_token"
# Example from dummy_agent_sse.py
async with session.get(
f"{AIRA_HUB}/connect/stream?agent_url={AGENT_URL}&name={AGENT_NAME}&aira_capabilities={CAPABILITIES}",
headers={"Authorization": f"Bearer {token}"}
) as resp:
# Handle SSE events
init_payload = {
"url": AGENT_URL,
"description": "Agent description",
"mcp_tools": [{
"name": "sample_tool",
"inputSchema": {"type": "object"}
}],
"tags": ["test"]
}
await session.post(f"{AIRA_HUB}/connect/stream/init", json=init_payload)
# From aira_test_client.py
resp = requests.get(f"{AIRA_HUB}/mcp/tools", headers=headers)
tool_request = {
"agent_url": "http://agent-url",
"tool_name": "tool_name",
"arguments": {"param": "value"}
}
resp = requests.post(f"{AIRA_HUB}/mcp/invoke-tool", json=tool_request)
resp = requests.get(f"{AIRA_HUB}/tools/calls/{call_id}")
Endpoint | Method | Description | Required Role |
---|---|---|---|
/token |
POST | Get access token | - |
/connect/stream |
GET | Establish SSE connection | agent/admin |
/status |
GET | Get system status | user |
/mcp/tools |
GET | List MCP tools | user |
/a2a/skills |
GET | List A2A skills | user |
/mcp/invoke-tool |
POST | Invoke MCP tool | user |
/my/agents |
GET | List user's agents | user |
Two example clients are provided:
- dummy_agent_sse.py - Demonstrates how to connect an agent via SSE
- aira_test_client.py - Shows how to interact with the hub as a client
To run them:
python dummy_agent_sse.py
python aira_test_client.py
-
Authentication Failures
- Verify username/password
- Check token expiration
-
SSE Connection Drops
- Ensure your agent maintains the connection
- Implement reconnection logic
-
Tool Invocation Errors
- Verify the agent is online
- Check tool name and parameters match the schema
For debugging, run the server with:
python AiraHub.py --host 0.0.0.0 --port 8015 --log-level debug
This documentation reflects the actual implementation in the provided code files. For the most up-to-date information, always refer to the interactive API docs at /docs
when the server is running.