fast-agent-mcp 0.2.42__py3-none-any.whl → 0.2.43__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.

Potentially problematic release.


This version of fast-agent-mcp might be problematic. Click here for more details.

@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: fast-agent-mcp
3
- Version: 0.2.42
3
+ Version: 0.2.43
4
4
  Summary: Define, Prompt and Test MCP enabled Agents and Workflows
5
5
  Author-email: Shaun Smith <fastagent@llmindset.co.uk>
6
6
  License: Apache License
@@ -34,7 +34,7 @@ mcp_agent/core/agent_app.py,sha256=mMWfScEylf1l-rKzmRdoA7WIIBRvSypfZONDBYdo1M8,1
34
34
  mcp_agent/core/agent_types.py,sha256=7zVzAFWjvh5dDV3TuDwmO9LAWmDjYnZd3eeLH-wvvIQ,1705
35
35
  mcp_agent/core/direct_decorators.py,sha256=sYoEA1EmdyAxTpQwUDUjQYWY73VviM-fBnV1Zv7KfeU,19047
36
36
  mcp_agent/core/direct_factory.py,sha256=d_HvbAxyv2WrM07zyCpLXFVn7eArXk1LZmLKS49hzJo,19537
37
- mcp_agent/core/enhanced_prompt.py,sha256=wAsPu8GdKXFTArr2tW2k_wmKZE207gPen6s2ho8x2ZM,33363
37
+ mcp_agent/core/enhanced_prompt.py,sha256=jrAINowXPqXWGrk_g6xcvMXFE0SEBetNdDtV25vnCBU,33411
38
38
  mcp_agent/core/error_handling.py,sha256=xoyS2kLe0eG0bj2eSJCJ2odIhGUve2SbDR7jP-A-uRw,624
39
39
  mcp_agent/core/exceptions.py,sha256=ENAD_qGG67foxy6vDkIvc-lgopIUQy6O7zvNPpPXaQg,2289
40
40
  mcp_agent/core/fastagent.py,sha256=tAxapB3sjNyK6FqsJdOZt-IN5uYAi8DL1B9RHcGu55g,24849
@@ -108,7 +108,7 @@ mcp_agent/mcp/hf_auth.py,sha256=7szw4rkwRyK3J-sUTcVZHdwoLIZqlYo8XolJnZdjOww,4571
108
108
  mcp_agent/mcp/interfaces.py,sha256=NxUDi4eI-qWfaOS1QHWr3EjAweV-CX_CBJeBCwTwr7g,7102
109
109
  mcp_agent/mcp/logger_textio.py,sha256=vljC1BtNTCxBAda9ExqNB-FwVNUZIuJT3h1nWmCjMws,3172
110
110
  mcp_agent/mcp/mcp_agent_client_session.py,sha256=nEHrSalG5z47BKGwE9ooOmlSTc4Gb7qdEut071Dwepo,8987
111
- mcp_agent/mcp/mcp_aggregator.py,sha256=Q2hHT_fcm6QIJ96si88AWaHxPh4NB50g3nr2lfGGZV0,48753
111
+ mcp_agent/mcp/mcp_aggregator.py,sha256=D1xFBVVq_4Tn1Ka16SZTVB3qeU-FO5501ITHGXTuXs0,49730
112
112
  mcp_agent/mcp/mcp_connection_manager.py,sha256=dJxjnv2IRzlFIxrbPFl39-pmGcZHgyeMXVlMfqpREhE,17974
113
113
  mcp_agent/mcp/mime_utils.py,sha256=difepNR_gpb4MpMLkBRAoyhDk-AjXUHTiqKvT_VwS1o,1805
114
114
  mcp_agent/mcp/prompt_message_multipart.py,sha256=BDwRdNwyWHb2q2bccDb2iR2VlORqVvkvoG3xYzcMpCE,4403
@@ -161,8 +161,8 @@ mcp_agent/resources/examples/workflows/short_story.md,sha256=XN9I2kzCcMmke3dE5F2
161
161
  mcp_agent/resources/examples/workflows/short_story.txt,sha256=X3y_1AyhLFN2AKzCKvucJtDgAFIJfnlbsbGZO5bBWu0,1187
162
162
  mcp_agent/tools/tool_definition.py,sha256=L3Pxl-uLEXqlVoo-bYuFTFALeI-2pIU44YgFhsTKEtM,398
163
163
  mcp_agent/ui/console_display.py,sha256=U9ZWzeu3dUGNCDcyFVSTqX_rpxXbn3uNmuvJ4SIlzi0,15730
164
- fast_agent_mcp-0.2.42.dist-info/METADATA,sha256=Usid8c-xlf44Efu98pJSkr-CrDWdohM5GLrw9cpmgb8,31012
165
- fast_agent_mcp-0.2.42.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
166
- fast_agent_mcp-0.2.42.dist-info/entry_points.txt,sha256=QaX5kLdI0VdMPRdPUF1nkG_WdLUTNjp_icW6e3EhNYU,232
167
- fast_agent_mcp-0.2.42.dist-info/licenses/LICENSE,sha256=Gx1L3axA4PnuK4FxsbX87jQ1opoOkSFfHHSytW6wLUU,10935
168
- fast_agent_mcp-0.2.42.dist-info/RECORD,,
164
+ fast_agent_mcp-0.2.43.dist-info/METADATA,sha256=GzA8s5uVpEhN0t0iJD4E7Qy0SyvDfkrl1K5LYRellzg,31012
165
+ fast_agent_mcp-0.2.43.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
166
+ fast_agent_mcp-0.2.43.dist-info/entry_points.txt,sha256=QaX5kLdI0VdMPRdPUF1nkG_WdLUTNjp_icW6e3EhNYU,232
167
+ fast_agent_mcp-0.2.43.dist-info/licenses/LICENSE,sha256=Gx1L3axA4PnuK4FxsbX87jQ1opoOkSFfHHSytW6wLUU,10935
168
+ fast_agent_mcp-0.2.43.dist-info/RECORD,,
@@ -69,7 +69,9 @@ async def _display_agent_info_helper(agent_name: str, agent_provider: object) ->
69
69
  )
70
70
 
71
71
  resources_dict = await agent.list_resources()
72
- resource_count = sum(len(resources) for resources in resources_dict.values()) if resources_dict else 0
72
+ resource_count = (
73
+ sum(len(resources) for resources in resources_dict.values()) if resources_dict else 0
74
+ )
73
75
 
74
76
  prompts_dict = await agent.list_prompts()
75
77
  prompt_count = sum(len(prompts) for prompts in prompts_dict.values()) if prompts_dict else 0
@@ -226,7 +228,9 @@ async def _display_child_agent_info(child_agent, prefix: str, agent_provider) ->
226
228
  )
227
229
 
228
230
  resources_dict = await child_agent.list_resources()
229
- resource_count = sum(len(resources) for resources in resources_dict.values()) if resources_dict else 0
231
+ resource_count = (
232
+ sum(len(resources) for resources in resources_dict.values()) if resources_dict else 0
233
+ )
230
234
 
231
235
  prompts_dict = await child_agent.list_prompts()
232
236
  prompt_count = sum(len(prompts) for prompts in prompts_dict.values()) if prompts_dict else 0
@@ -258,7 +258,12 @@ class MCPAggregator(ContextDependent):
258
258
  },
259
259
  )
260
260
 
261
- async def fetch_tools(client: ClientSession):
261
+ async def fetch_tools(client: ClientSession, server_name: str) -> List[Tool]:
262
+ # Only fetch tools if the server supports them
263
+ if not await self.server_supports_feature(server_name, "tools"):
264
+ logger.debug(f"Server '{server_name}' does not support tools")
265
+ return []
266
+
262
267
  try:
263
268
  result: ListToolsResult = await client.list_tools()
264
269
  return result.tools or []
@@ -287,7 +292,7 @@ class MCPAggregator(ContextDependent):
287
292
  server_connection = await self._persistent_connection_manager.get_server(
288
293
  server_name, client_session_factory=MCPAgentClientSession
289
294
  )
290
- tools = await fetch_tools(server_connection.session)
295
+ tools = await fetch_tools(server_connection.session, server_name)
291
296
  prompts = await fetch_prompts(server_connection.session, server_name)
292
297
  else:
293
298
  # Create a factory function for the client session
@@ -326,7 +331,7 @@ class MCPAggregator(ContextDependent):
326
331
  server_registry=self.context.server_registry,
327
332
  client_session_factory=create_session,
328
333
  ) as client:
329
- tools = await fetch_tools(client)
334
+ tools = await fetch_tools(client, server_name)
330
335
  prompts = await fetch_prompts(client, server_name)
331
336
 
332
337
  return server_name, tools, prompts
@@ -962,6 +967,11 @@ class MCPAggregator(ContextDependent):
962
967
  logger.error(f"Cannot refresh tools for unknown server '{server_name}'")
963
968
  return
964
969
 
970
+ # Check if server supports tools capability
971
+ if not await self.server_supports_feature(server_name, "tools"):
972
+ logger.debug(f"Server '{server_name}' does not support tools")
973
+ return
974
+
965
975
  await self.display.show_tool_update(aggregator=self, updated_server=server_name)
966
976
 
967
977
  async with self._refresh_lock:
@@ -1103,6 +1113,10 @@ class MCPAggregator(ContextDependent):
1103
1113
  Raises:
1104
1114
  Exception: If the resource couldn't be found or other error occurs
1105
1115
  """
1116
+ # Check if server supports resources capability
1117
+ if not await self.server_supports_feature(server_name, "resources"):
1118
+ raise ValueError(f"Server '{server_name}' does not support resources")
1119
+
1106
1120
  logger.info(
1107
1121
  "Requesting resource",
1108
1122
  data={
@@ -1163,6 +1177,11 @@ class MCPAggregator(ContextDependent):
1163
1177
  # Initialize empty list for this server
1164
1178
  results[s_name] = []
1165
1179
 
1180
+ # Check if server supports resources capability
1181
+ if not await self.server_supports_feature(s_name, "resources"):
1182
+ logger.debug(f"Server '{s_name}' does not support resources")
1183
+ continue
1184
+
1166
1185
  try:
1167
1186
  # Use the _execute_on_server method to call list_resources on the server
1168
1187
  result = await self._execute_on_server(