fast-agent-mcp 0.2.27__py3-none-any.whl → 0.2.28__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.
- {fast_agent_mcp-0.2.27.dist-info → fast_agent_mcp-0.2.28.dist-info}/METADATA +3 -1
- {fast_agent_mcp-0.2.27.dist-info → fast_agent_mcp-0.2.28.dist-info}/RECORD +24 -19
- mcp_agent/agents/agent.py +1 -17
- mcp_agent/agents/base_agent.py +2 -0
- mcp_agent/config.py +3 -0
- mcp_agent/context.py +2 -0
- mcp_agent/core/agent_app.py +7 -2
- mcp_agent/core/interactive_prompt.py +58 -51
- mcp_agent/llm/augmented_llm_slow.py +42 -0
- mcp_agent/llm/model_factory.py +74 -37
- mcp_agent/llm/provider_types.py +4 -3
- mcp_agent/llm/providers/augmented_llm_google_native.py +459 -0
- mcp_agent/llm/providers/{augmented_llm_google.py → augmented_llm_google_oai.py} +2 -2
- mcp_agent/llm/providers/google_converter.py +361 -0
- mcp_agent/mcp/helpers/server_config_helpers.py +23 -0
- mcp_agent/mcp/mcp_agent_client_session.py +51 -24
- mcp_agent/mcp/mcp_aggregator.py +18 -3
- mcp_agent/mcp/mcp_connection_manager.py +6 -5
- mcp_agent/mcp/sampling.py +40 -10
- mcp_agent/mcp_server_registry.py +15 -4
- mcp_agent/tools/tool_definition.py +14 -0
- {fast_agent_mcp-0.2.27.dist-info → fast_agent_mcp-0.2.28.dist-info}/WHEEL +0 -0
- {fast_agent_mcp-0.2.27.dist-info → fast_agent_mcp-0.2.28.dist-info}/entry_points.txt +0 -0
- {fast_agent_mcp-0.2.27.dist-info → fast_agent_mcp-0.2.28.dist-info}/licenses/LICENSE +0 -0
mcp_agent/mcp_server_registry.py
CHANGED
@@ -70,9 +70,15 @@ class ServerRegistry:
|
|
70
70
|
config (Settings): The Settings object containing the server configurations.
|
71
71
|
config_path (str): Path to the YAML configuration file.
|
72
72
|
"""
|
73
|
-
|
74
|
-
self.load_registry_from_file(config_path)
|
75
|
-
)
|
73
|
+
if config is None:
|
74
|
+
self.registry = self.load_registry_from_file(config_path)
|
75
|
+
elif config.mcp is not None and hasattr(config.mcp, 'servers') and config.mcp.servers is not None:
|
76
|
+
# Ensure config.mcp exists, has a 'servers' attribute, and it's not None
|
77
|
+
self.registry = config.mcp.servers
|
78
|
+
else:
|
79
|
+
# Default to an empty dictionary if config.mcp is None or has no 'servers'
|
80
|
+
self.registry = {}
|
81
|
+
|
76
82
|
self.init_hooks: Dict[str, InitHookCallable] = {}
|
77
83
|
self.connection_manager = MCPConnectionManager(self)
|
78
84
|
|
@@ -88,8 +94,13 @@ class ServerRegistry:
|
|
88
94
|
Raises:
|
89
95
|
ValueError: If the configuration is invalid.
|
90
96
|
"""
|
97
|
+
servers = {}
|
91
98
|
|
92
|
-
|
99
|
+
settings = get_settings(config_path)
|
100
|
+
|
101
|
+
if settings.mcp is not None and hasattr(settings.mcp, 'servers') and settings.mcp.servers is not None:
|
102
|
+
return settings.mcp.servers
|
103
|
+
|
93
104
|
return servers
|
94
105
|
|
95
106
|
@asynccontextmanager
|
@@ -0,0 +1,14 @@
|
|
1
|
+
from dataclasses import dataclass, field
|
2
|
+
from typing import Any, Dict, Optional
|
3
|
+
|
4
|
+
|
5
|
+
@dataclass
|
6
|
+
class ToolDefinition:
|
7
|
+
"""
|
8
|
+
Represents a definition of a tool available to the agent.
|
9
|
+
"""
|
10
|
+
|
11
|
+
name: str
|
12
|
+
description: Optional[str] = None
|
13
|
+
inputSchema: Dict[str, Any] = field(default_factory=dict)
|
14
|
+
# Add other relevant fields if necessary based on how tools are defined in fast-agent
|
File without changes
|
File without changes
|
File without changes
|