fast-agent-mcp 0.3.7__py3-none-any.whl → 0.3.9__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.
- fast_agent/agents/llm_agent.py +30 -8
- fast_agent/agents/llm_decorator.py +2 -7
- fast_agent/agents/mcp_agent.py +9 -4
- fast_agent/cli/commands/auth.py +14 -1
- fast_agent/core/direct_factory.py +20 -8
- fast_agent/core/logging/listeners.py +2 -1
- fast_agent/interfaces.py +2 -2
- fast_agent/llm/model_database.py +7 -1
- fast_agent/llm/model_factory.py +2 -3
- fast_agent/llm/provider/anthropic/llm_anthropic.py +107 -62
- fast_agent/llm/provider/anthropic/multipart_converter_anthropic.py +4 -3
- fast_agent/llm/provider/bedrock/llm_bedrock.py +1 -1
- fast_agent/llm/provider/google/google_converter.py +8 -41
- fast_agent/llm/provider/google/llm_google_native.py +1 -3
- fast_agent/llm/provider/openai/llm_azure.py +1 -1
- fast_agent/llm/provider/openai/llm_openai.py +3 -3
- fast_agent/llm/provider/openai/llm_tensorzero_openai.py +1 -1
- fast_agent/llm/request_params.py +1 -1
- fast_agent/mcp/mcp_agent_client_session.py +45 -2
- fast_agent/mcp/mcp_aggregator.py +282 -5
- fast_agent/mcp/mcp_connection_manager.py +86 -10
- fast_agent/mcp/stdio_tracking_simple.py +59 -0
- fast_agent/mcp/streamable_http_tracking.py +309 -0
- fast_agent/mcp/transport_tracking.py +598 -0
- fast_agent/resources/examples/data-analysis/analysis.py +7 -3
- fast_agent/ui/console_display.py +22 -1
- fast_agent/ui/enhanced_prompt.py +21 -1
- fast_agent/ui/interactive_prompt.py +5 -0
- fast_agent/ui/mcp_display.py +636 -0
- {fast_agent_mcp-0.3.7.dist-info → fast_agent_mcp-0.3.9.dist-info}/METADATA +6 -6
- {fast_agent_mcp-0.3.7.dist-info → fast_agent_mcp-0.3.9.dist-info}/RECORD +34 -30
- {fast_agent_mcp-0.3.7.dist-info → fast_agent_mcp-0.3.9.dist-info}/WHEEL +0 -0
- {fast_agent_mcp-0.3.7.dist-info → fast_agent_mcp-0.3.9.dist-info}/entry_points.txt +0 -0
- {fast_agent_mcp-0.3.7.dist-info → fast_agent_mcp-0.3.9.dist-info}/licenses/LICENSE +0 -0
fast_agent/ui/enhanced_prompt.py
CHANGED
|
@@ -24,6 +24,7 @@ from fast_agent.agents.agent_types import AgentType
|
|
|
24
24
|
from fast_agent.constants import FAST_AGENT_ERROR_CHANNEL, FAST_AGENT_REMOVED_METADATA_CHANNEL
|
|
25
25
|
from fast_agent.core.exceptions import PromptExitError
|
|
26
26
|
from fast_agent.llm.model_info import get_model_info
|
|
27
|
+
from fast_agent.ui.mcp_display import render_mcp_status
|
|
27
28
|
|
|
28
29
|
if TYPE_CHECKING:
|
|
29
30
|
from fast_agent.core.agent_app import AgentApp
|
|
@@ -74,6 +75,20 @@ help_message_shown = False
|
|
|
74
75
|
_agent_info_shown = set()
|
|
75
76
|
|
|
76
77
|
|
|
78
|
+
async def show_mcp_status(agent_name: str, agent_provider: "AgentApp | None") -> None:
|
|
79
|
+
if agent_provider is None:
|
|
80
|
+
rich_print("[red]No agent provider available[/red]")
|
|
81
|
+
return
|
|
82
|
+
|
|
83
|
+
try:
|
|
84
|
+
agent = agent_provider._agent(agent_name)
|
|
85
|
+
except Exception as exc:
|
|
86
|
+
rich_print(f"[red]Unable to load agent '{agent_name}': {exc}[/red]")
|
|
87
|
+
return
|
|
88
|
+
|
|
89
|
+
await render_mcp_status(agent)
|
|
90
|
+
|
|
91
|
+
|
|
77
92
|
async def _display_agent_info_helper(agent_name: str, agent_provider: "AgentApp | None") -> None:
|
|
78
93
|
"""Helper function to display agent information."""
|
|
79
94
|
# Only show once per agent
|
|
@@ -165,6 +180,7 @@ async def _display_agent_info_helper(agent_name: str, agent_provider: "AgentApp
|
|
|
165
180
|
content = f"{server_text}[dim] available[/dim]"
|
|
166
181
|
|
|
167
182
|
rich_print(f"[dim]Agent [/dim][blue]{agent_name}[/blue][dim]:[/dim] {content}")
|
|
183
|
+
# await _render_mcp_status(agent)
|
|
168
184
|
|
|
169
185
|
# Mark as shown
|
|
170
186
|
_agent_info_shown.add(agent_name)
|
|
@@ -322,6 +338,7 @@ class AgentCompleter(Completer):
|
|
|
322
338
|
self.agents = agents
|
|
323
339
|
# Map commands to their descriptions for better completion hints
|
|
324
340
|
self.commands = {
|
|
341
|
+
"mcp": "Show MCP server status",
|
|
325
342
|
"tools": "List available MCP tools",
|
|
326
343
|
"prompt": "List and choose MCP prompts, or apply specific prompt (/prompt <name>)",
|
|
327
344
|
"agents": "List available agents",
|
|
@@ -331,8 +348,8 @@ class AgentCompleter(Completer):
|
|
|
331
348
|
"save_history": "Save history; .json = MCP JSON, others = Markdown",
|
|
332
349
|
"help": "Show commands and shortcuts",
|
|
333
350
|
"clear": "Clear the screen",
|
|
334
|
-
"STOP": "Stop this prompting session and move to next workflow step",
|
|
335
351
|
"EXIT": "Exit fast-agent, terminating any running workflows",
|
|
352
|
+
"STOP": "Stop this prompting session and move to next workflow step",
|
|
336
353
|
**(commands or {}), # Allow custom commands to be passed in
|
|
337
354
|
}
|
|
338
355
|
if is_human_input:
|
|
@@ -808,6 +825,8 @@ async def get_enhanced_input(
|
|
|
808
825
|
cmd_parts[1].strip() if len(cmd_parts) > 1 and cmd_parts[1].strip() else None
|
|
809
826
|
)
|
|
810
827
|
return {"save_history": True, "filename": filename}
|
|
828
|
+
elif cmd in ("mcpstatus", "mcp"):
|
|
829
|
+
return {"show_mcp_status": True}
|
|
811
830
|
elif cmd == "prompt":
|
|
812
831
|
# Handle /prompt with no arguments as interactive mode
|
|
813
832
|
if len(cmd_parts) > 1:
|
|
@@ -985,6 +1004,7 @@ async def handle_special_commands(command, agent_app=None):
|
|
|
985
1004
|
rich_print(" /prompt <name> - Apply a specific prompt by name")
|
|
986
1005
|
rich_print(" /usage - Show current usage statistics")
|
|
987
1006
|
rich_print(" /markdown - Show last assistant message without markdown formatting")
|
|
1007
|
+
rich_print(" /mcpstatus - Show MCP server status summary for the active agent")
|
|
988
1008
|
rich_print(" /save_history <filename> - Save current chat history to a file")
|
|
989
1009
|
rich_print(
|
|
990
1010
|
" [dim]Tip: Use a .json extension for MCP-compatible JSON; any other extension saves Markdown.[/dim]"
|
|
@@ -32,6 +32,7 @@ from fast_agent.ui.enhanced_prompt import (
|
|
|
32
32
|
get_enhanced_input,
|
|
33
33
|
get_selection_input,
|
|
34
34
|
handle_special_commands,
|
|
35
|
+
show_mcp_status,
|
|
35
36
|
)
|
|
36
37
|
from fast_agent.ui.progress_display import progress_display
|
|
37
38
|
from fast_agent.ui.usage_display import collect_agents_from_provider, display_usage_report
|
|
@@ -177,6 +178,10 @@ class InteractivePrompt:
|
|
|
177
178
|
# Handle markdown display
|
|
178
179
|
await self._show_markdown(prompt_provider, agent)
|
|
179
180
|
continue
|
|
181
|
+
elif "show_mcp_status" in command_result:
|
|
182
|
+
rich_print()
|
|
183
|
+
await show_mcp_status(agent, prompt_provider)
|
|
184
|
+
continue
|
|
180
185
|
elif "save_history" in command_result:
|
|
181
186
|
# Save history for the current agent
|
|
182
187
|
filename = command_result.get("filename")
|