a2a-agent-mcpserver-generator 0.1.1__py3-none-any.whl → 0.1.2__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -45,9 +45,14 @@ async def main(
45
45
  log.info(f'- Server Name: {name}')
46
46
 
47
47
  # Load agent.json
48
- async with httpx.AsyncClient() as httpx_client:
49
- card_resolver = A2ACardResolver(httpx_client=httpx_client, base_url=agent)
50
- card: AgentCard = await card_resolver.get_agent_card()
48
+ try:
49
+ async with httpx.AsyncClient() as httpx_client:
50
+ card_resolver = A2ACardResolver(httpx_client=httpx_client, base_url=agent)
51
+ card: AgentCard = await card_resolver.get_agent_card()
52
+ except Exception as e:
53
+ log.error(f"failed to get agent card from address: {agent}")
54
+ log.error(e)
55
+ return
51
56
 
52
57
  # Parse agent.json
53
58
  card_parsed: CardParsed = parse_card(card)
@@ -145,9 +145,10 @@ async def handle_call_tool(name: str, arguments: dict) -> list[types.TextContent
145
145
 
146
146
  if isinstance(chunk.root.result, TaskStatusUpdateEvent):
147
147
  task_status = chunk.root.result
148
- ctx.session.send_log_message(
148
+ notification_msg = ''.join(part.root.text for part in task_status.status.message.parts) if task_status.status.message else ""
149
+ await ctx.session.send_log_message(
149
150
  level="info",
150
- data=f"Task: {{task_id}} is {{task_status.status.state}} at {{task_status.status.timestamp}} with message: {{task_status.status.message}}",
151
+ data=f"Task: {{task_id}} is '{{task_status.status.state}}' with message: {{notification_msg}}",
151
152
  logger="notification_stream",
152
153
  related_request_id=ctx.request_id,
153
154
  )
@@ -188,10 +189,10 @@ async def handle_call_tool(name: str, arguments: dict) -> list[types.TextContent
188
189
  )]
189
190
 
190
191
  task = get_response.root.result
191
-
192
- ctx.session.send_log_message(
192
+ notification_msg = ''.join(part.root.text for part in task_status.status.message.parts) if task_status.status.message else ""
193
+ await ctx.session.send_log_message(
193
194
  level="info",
194
- data=f"Task: {{task_id}} is {{task.status.state}} at {{task.status.timestamp}} with message: {{task.status.message}}",
195
+ data=f"Task: {{task_id}} is '{{task_status.status.state}}' with message: {{notification_msg}}",
195
196
  logger="notification_stream",
196
197
  related_request_id=ctx.request_id,
197
198
  )
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: a2a-agent-mcpserver-generator
3
- Version: 0.1.1
3
+ Version: 0.1.2
4
4
  Summary: Add your description here
5
5
  Author-email: vincent-pli <justdoit.pli@gmail.com>
6
6
  Requires-Python: >=3.13
@@ -24,6 +24,11 @@ English | [简体中文](./README-zh.md)
24
24
  - Complete Project Setup: Generates all necessary files to run an MCP server
25
25
  - Easy Configuration: Simple environment-based configuration for the generated server
26
26
 
27
+ ## Prerequisites
28
+
29
+ - Python 3.13+
30
+ - `uv` (optional, but recommended) or `pip`
31
+
27
32
  ## Environment Setup 🔧
28
33
  Firstly, you need to start up a a2a agent:
29
34
  https://github.com/google/a2a-python/tree/main/examples
@@ -35,7 +40,7 @@ uv run a2a-agent-mcpserver-generator --agent http://0.0.0.0:10000
35
40
  ## Installation 📦
36
41
 
37
42
  ```bash
38
- pip install a2a-agent-mcpserver-generator
43
+ uv pip install a2a-agent-mcpserver-generator
39
44
  ```
40
45
 
41
46
  ## Usage 🚀
@@ -1,11 +1,11 @@
1
1
  a2a_agent_mcpserver_generator/__init__.py,sha256=YclN_EDxcIzDz6J_O9HngLaz25HqOZ8gE1WNnbJwYxQ,75
2
- a2a_agent_mcpserver_generator/app.py,sha256=WkjLK5LKCdMxY9tMIESCoGrGWmFOpDlQEkkREB1wKko,4353
2
+ a2a_agent_mcpserver_generator/app.py,sha256=uibSFNyWNClmC2oLLqkfnpsp3LExhyOC1U_GjdpA6Zw,4506
3
3
  a2a_agent_mcpserver_generator/config_generator.py,sha256=FEq5jQjMMupLIPfU4gQj0JU5Wtz-WXJhMeKeqfaarHo,874
4
4
  a2a_agent_mcpserver_generator/dockerfile_generator.py,sha256=FtU68SlF6pxAmsFMikllFxGl9D7lC98ZBXk0uAIliIU,594
5
- a2a_agent_mcpserver_generator/server_generator.py,sha256=dsmRe8Z89UPUMCwaeWQjOCSfKegSviYOQl-tYcdSZeA,8393
5
+ a2a_agent_mcpserver_generator/server_generator.py,sha256=LrTiOVhlpyU4-JA1fqYlBeDw2wxjDlA9LoZt6Tbusxk,8633
6
6
  a2a_agent_mcpserver_generator/types.py,sha256=Y_iS8FPkn5LZAY4gCoak4w-FPvQT_9g12_pHd3boROk,228
7
7
  a2a_agent_mcpserver_generator/utils.py,sha256=o2DQFhTdO71JpFRG-y1wXMs3azzN1pkJZbJtvoXM1yY,1022
8
- a2a_agent_mcpserver_generator-0.1.1.dist-info/METADATA,sha256=Fkgi2G73dWGZHBZNKzqc9aDUI3_T7_fKy8LRaJ9SwhU,2354
9
- a2a_agent_mcpserver_generator-0.1.1.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
10
- a2a_agent_mcpserver_generator-0.1.1.dist-info/entry_points.txt,sha256=1MPWCsTXjADeB9QB5ahmUdroIZPUIDtBmnUj44tuuFY,88
11
- a2a_agent_mcpserver_generator-0.1.1.dist-info/RECORD,,
8
+ a2a_agent_mcpserver_generator-0.1.2.dist-info/METADATA,sha256=6Xk_oidTV5yzy4RT1YWAUA-3cFd0OgrhMWZNJmqhtbw,2435
9
+ a2a_agent_mcpserver_generator-0.1.2.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
10
+ a2a_agent_mcpserver_generator-0.1.2.dist-info/entry_points.txt,sha256=1MPWCsTXjADeB9QB5ahmUdroIZPUIDtBmnUj44tuuFY,88
11
+ a2a_agent_mcpserver_generator-0.1.2.dist-info/RECORD,,