fast-agent-mcp 0.2.25__py3-none-any.whl → 0.2.27__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.25.dist-info → fast_agent_mcp-0.2.27.dist-info}/METADATA +2 -2
- {fast_agent_mcp-0.2.25.dist-info → fast_agent_mcp-0.2.27.dist-info}/RECORD +8 -8
- mcp_agent/llm/model_factory.py +9 -3
- mcp_agent/mcp/mcp_agent_client_session.py +23 -5
- mcp_agent/mcp/prompts/prompt_server.py +12 -4
- {fast_agent_mcp-0.2.25.dist-info → fast_agent_mcp-0.2.27.dist-info}/WHEEL +0 -0
- {fast_agent_mcp-0.2.25.dist-info → fast_agent_mcp-0.2.27.dist-info}/entry_points.txt +0 -0
- {fast_agent_mcp-0.2.25.dist-info → fast_agent_mcp-0.2.27.dist-info}/licenses/LICENSE +0 -0
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.4
|
2
2
|
Name: fast-agent-mcp
|
3
|
-
Version: 0.2.
|
3
|
+
Version: 0.2.27
|
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
|
@@ -214,7 +214,7 @@ Requires-Dist: aiohttp>=3.11.13
|
|
214
214
|
Requires-Dist: anthropic>=0.49.0
|
215
215
|
Requires-Dist: azure-identity>=1.14.0
|
216
216
|
Requires-Dist: fastapi>=0.115.6
|
217
|
-
Requires-Dist: mcp
|
217
|
+
Requires-Dist: mcp==1.9.1
|
218
218
|
Requires-Dist: openai>=1.63.2
|
219
219
|
Requires-Dist: opentelemetry-distro>=0.50b0
|
220
220
|
Requires-Dist: opentelemetry-exporter-otlp-proto-http>=1.29.0
|
@@ -53,7 +53,7 @@ mcp_agent/llm/augmented_llm.py,sha256=CqtSGo_QrHE73tz_DHMd0wdt2F41gwuUu5Bue51FNm
|
|
53
53
|
mcp_agent/llm/augmented_llm_passthrough.py,sha256=zHcctNpwg4EFJvD1x9Eg443SVX-uyzFphLikwF_yVE0,6288
|
54
54
|
mcp_agent/llm/augmented_llm_playback.py,sha256=6L_RWIK__R67oZK7u3Xt3hWy1T2LnHXIO-efqgP3tPw,4177
|
55
55
|
mcp_agent/llm/memory.py,sha256=HQ_c1QemOUjrkY6Z2omE6BG5fXga7y4jN7KCMOuGjPs,3345
|
56
|
-
mcp_agent/llm/model_factory.py,sha256=
|
56
|
+
mcp_agent/llm/model_factory.py,sha256=NN-ptlhwajTZVnjqE_1NG5pLbiBWEqC18H5EZbjwhCY,8481
|
57
57
|
mcp_agent/llm/prompt_utils.py,sha256=yWQHykoK13QRF7evHUKxVF0SpVLN-Bsft0Yixzvn0g0,4825
|
58
58
|
mcp_agent/llm/provider_key_manager.py,sha256=-K_FuibN6hdSnweT32lB8mKTfCARnbja6zYYs0ErTKg,2802
|
59
59
|
mcp_agent/llm/provider_types.py,sha256=m7vAQA0MSn4iVCoHQYwZ8pK8nW4iVLxp_Ul1JpnXMpY,408
|
@@ -88,7 +88,7 @@ mcp_agent/mcp/common.py,sha256=DiWLH9rxWvCgkKRsHQehY9mDhQl9gki1-q7LVUflDvI,425
|
|
88
88
|
mcp_agent/mcp/gen_client.py,sha256=fAVwFVCgSamw4PwoWOV4wrK9TABx1S_zZv8BctRyF2k,3030
|
89
89
|
mcp_agent/mcp/interfaces.py,sha256=PAou8znAl2HgtvfCpLQOZFbKra9F72OcVRfBJbboNX8,6965
|
90
90
|
mcp_agent/mcp/logger_textio.py,sha256=vljC1BtNTCxBAda9ExqNB-FwVNUZIuJT3h1nWmCjMws,3172
|
91
|
-
mcp_agent/mcp/mcp_agent_client_session.py,sha256=
|
91
|
+
mcp_agent/mcp/mcp_agent_client_session.py,sha256=eOryEpA3ew_K1KqxYKnYhYGB2Ph8fSsFv1-1FySYzzU,6510
|
92
92
|
mcp_agent/mcp/mcp_aggregator.py,sha256=KAtQTg6CBpTiHoMg6NKcMSiJ7Cvl-BgS0Lff784qwrs,46063
|
93
93
|
mcp_agent/mcp/mcp_connection_manager.py,sha256=jlqaAdS4zc1UfVBHQU0TkTbVr0-rOkbN9bkrLPrZVLk,17159
|
94
94
|
mcp_agent/mcp/mime_utils.py,sha256=difepNR_gpb4MpMLkBRAoyhDk-AjXUHTiqKvT_VwS1o,1805
|
@@ -104,7 +104,7 @@ mcp_agent/mcp/prompts/__main__.py,sha256=gr1Tdz9fcK0EXjEuZg_BOnKUmvhYq5AH2lFZicV
|
|
104
104
|
mcp_agent/mcp/prompts/prompt_constants.py,sha256=Q9W0t3rOXl2LHIG9wcghApUV2QZ1iICuo7SwVwHUf3c,566
|
105
105
|
mcp_agent/mcp/prompts/prompt_helpers.py,sha256=Joqo2t09pTKDP-Wge3G-ozPEHikzjaqwV6GVk8hNR50,7534
|
106
106
|
mcp_agent/mcp/prompts/prompt_load.py,sha256=Zo0FogqWFEG5FtF1d9ZH-RWsCSSMsi5FIEQHpJD8N7M,5404
|
107
|
-
mcp_agent/mcp/prompts/prompt_server.py,sha256=
|
107
|
+
mcp_agent/mcp/prompts/prompt_server.py,sha256=38DoKCg0YOUIraNyEfAvQQbXQ2_00l3h-LFDJoklAEw,19378
|
108
108
|
mcp_agent/mcp/prompts/prompt_template.py,sha256=EejiqGkau8OizORNyKTUwUjrPof5V-hH1H_MBQoQfXw,15732
|
109
109
|
mcp_agent/mcp_server/__init__.py,sha256=zBU51ITHIEPScd9nRafnhEddsWqXRPAAvHhkrbRI2_4,155
|
110
110
|
mcp_agent/mcp_server/agent_server.py,sha256=df3UbPLg52e_SS98F3lc4T8BqqzvQRBl6kplODsaq-M,20096
|
@@ -148,8 +148,8 @@ mcp_agent/resources/examples/workflows/parallel.py,sha256=DQ5vY5-h8Qa5QHcYjsWXhZ
|
|
148
148
|
mcp_agent/resources/examples/workflows/router.py,sha256=E4x_-c3l4YW9w1i4ARcDtkdeqIdbWEGfsMzwLYpdbVc,1677
|
149
149
|
mcp_agent/resources/examples/workflows/short_story.txt,sha256=X3y_1AyhLFN2AKzCKvucJtDgAFIJfnlbsbGZO5bBWu0,1187
|
150
150
|
mcp_agent/ui/console_display.py,sha256=UKqax5V2TC0hkZZORmmd6UqUk0DGX7A25E3h1k9f42k,10982
|
151
|
-
fast_agent_mcp-0.2.
|
152
|
-
fast_agent_mcp-0.2.
|
153
|
-
fast_agent_mcp-0.2.
|
154
|
-
fast_agent_mcp-0.2.
|
155
|
-
fast_agent_mcp-0.2.
|
151
|
+
fast_agent_mcp-0.2.27.dist-info/METADATA,sha256=NhCE4eUDaz5DFGgBMElTNOVCkCMXHrkf6-scgD1zs8A,30488
|
152
|
+
fast_agent_mcp-0.2.27.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
|
153
|
+
fast_agent_mcp-0.2.27.dist-info/entry_points.txt,sha256=bRniFM5zk3Kix5z7scX0gf9VnmGQ2Cz_Q1Gh7Ir4W00,186
|
154
|
+
fast_agent_mcp-0.2.27.dist-info/licenses/LICENSE,sha256=cN3FxDURL9XuzE5mhK9L2paZo82LTfjwCYVT7e3j0e4,10939
|
155
|
+
fast_agent_mcp-0.2.27.dist-info/RECORD,,
|
mcp_agent/llm/model_factory.py
CHANGED
@@ -86,19 +86,25 @@ class ModelFactory:
|
|
86
86
|
"claude-3-7-sonnet-latest": Provider.ANTHROPIC,
|
87
87
|
"claude-3-opus-20240229": Provider.ANTHROPIC,
|
88
88
|
"claude-3-opus-latest": Provider.ANTHROPIC,
|
89
|
+
"claude-opus-4-0": Provider.ANTHROPIC,
|
90
|
+
"claude-opus-4-20250514": Provider.ANTHROPIC,
|
91
|
+
"claude-sonnet-4-20250514": Provider.ANTHROPIC,
|
92
|
+
"claude-sonnet-4-0": Provider.ANTHROPIC,
|
89
93
|
"deepseek-chat": Provider.DEEPSEEK,
|
90
94
|
# "deepseek-reasoner": Provider.DEEPSEEK, reinstate on release
|
91
95
|
}
|
92
96
|
|
93
97
|
MODEL_ALIASES = {
|
94
|
-
"sonnet": "claude-
|
98
|
+
"sonnet": "claude-sonnet-4-0",
|
99
|
+
"sonnet4": "claude-sonnet-4-0",
|
95
100
|
"sonnet35": "claude-3-5-sonnet-latest",
|
96
101
|
"sonnet37": "claude-3-7-sonnet-latest",
|
97
|
-
"claude": "claude-
|
102
|
+
"claude": "claude-sonnet-4-0",
|
98
103
|
"haiku": "claude-3-5-haiku-latest",
|
99
104
|
"haiku3": "claude-3-haiku-20240307",
|
100
105
|
"haiku35": "claude-3-5-haiku-latest",
|
101
|
-
"opus": "claude-
|
106
|
+
"opus": "claude-opus-4-0",
|
107
|
+
"opus4": "claude-opus-4-0",
|
102
108
|
"opus3": "claude-3-opus-latest",
|
103
109
|
"deepseekv3": "deepseek-chat",
|
104
110
|
"deepseek": "deepseek-chat",
|
@@ -8,13 +8,14 @@ from typing import TYPE_CHECKING, Optional
|
|
8
8
|
|
9
9
|
from mcp import ClientSession, ServerNotification
|
10
10
|
from mcp.shared.session import (
|
11
|
+
ProgressFnT,
|
11
12
|
ReceiveResultT,
|
12
13
|
RequestId,
|
13
14
|
SendNotificationT,
|
14
15
|
SendRequestT,
|
15
16
|
SendResultT,
|
16
17
|
)
|
17
|
-
from mcp.types import ErrorData, ListRootsResult, Root, ToolListChangedNotification
|
18
|
+
from mcp.types import ErrorData, Implementation, ListRootsResult, Root, ToolListChangedNotification
|
18
19
|
from pydantic import FileUrl
|
19
20
|
|
20
21
|
from mcp_agent.context_dependent import ContextDependent
|
@@ -63,11 +64,21 @@ class MCPAgentClientSession(ClientSession, ContextDependent):
|
|
63
64
|
|
64
65
|
def __init__(self, *args, **kwargs) -> None:
|
65
66
|
# Extract server_name if provided in kwargs
|
67
|
+
from importlib.metadata import version
|
68
|
+
|
69
|
+
version = version("fast-agent-mcp") or "dev"
|
70
|
+
fast_agent: Implementation = Implementation(name="fast-agent-mcp", version=version)
|
71
|
+
|
66
72
|
self.session_server_name = kwargs.pop("server_name", None)
|
67
73
|
# Extract the notification callbacks if provided
|
68
74
|
self._tool_list_changed_callback = kwargs.pop("tool_list_changed_callback", None)
|
69
|
-
|
70
|
-
|
75
|
+
super().__init__(
|
76
|
+
*args,
|
77
|
+
**kwargs,
|
78
|
+
list_roots_callback=list_roots,
|
79
|
+
sampling_callback=sample,
|
80
|
+
client_info=fast_agent,
|
81
|
+
)
|
71
82
|
self.server_config: Optional[MCPServerSettings] = None
|
72
83
|
|
73
84
|
async def send_request(
|
@@ -75,11 +86,15 @@ class MCPAgentClientSession(ClientSession, ContextDependent):
|
|
75
86
|
request: SendRequestT,
|
76
87
|
result_type: type[ReceiveResultT],
|
77
88
|
request_read_timeout_seconds: timedelta | None = None,
|
89
|
+
progress_callback: ProgressFnT | None = None,
|
78
90
|
) -> ReceiveResultT:
|
79
91
|
logger.debug("send_request: request=", data=request.model_dump())
|
80
92
|
try:
|
81
93
|
result = await super().send_request(
|
82
|
-
request,
|
94
|
+
request,
|
95
|
+
result_type,
|
96
|
+
request_read_timeout_seconds=request_read_timeout_seconds,
|
97
|
+
progress_callback=progress_callback,
|
83
98
|
)
|
84
99
|
logger.debug("send_request: response=", data=result.model_dump())
|
85
100
|
return result
|
@@ -127,7 +142,10 @@ class MCPAgentClientSession(ClientSession, ContextDependent):
|
|
127
142
|
)
|
128
143
|
# Use asyncio.create_task to prevent blocking the notification handler
|
129
144
|
import asyncio
|
130
|
-
|
145
|
+
|
146
|
+
asyncio.create_task(
|
147
|
+
self._handle_tool_list_change_callback(self.session_server_name)
|
148
|
+
)
|
131
149
|
else:
|
132
150
|
logger.debug(
|
133
151
|
f"Tool list changed for server '{self.session_server_name}' but no callback registered"
|
@@ -229,7 +229,9 @@ def register_prompt(file_path: Path, config: Optional[PromptConfig] = None) -> N
|
|
229
229
|
# Create a function with properly typed parameters
|
230
230
|
async def template_handler_with_vars(**kwargs):
|
231
231
|
# Extract template variables from kwargs
|
232
|
-
context = {
|
232
|
+
context = {
|
233
|
+
var: kwargs.get(var) for var in template_vars if var in kwargs
|
234
|
+
}
|
233
235
|
|
234
236
|
# Check for missing variables
|
235
237
|
missing_vars = [var for var in template_vars if var not in context]
|
@@ -247,7 +249,9 @@ def register_prompt(file_path: Path, config: Optional[PromptConfig] = None) -> N
|
|
247
249
|
|
248
250
|
# Create a Prompt directly
|
249
251
|
arguments = [
|
250
|
-
PromptArgument(
|
252
|
+
PromptArgument(
|
253
|
+
name=var, description=f"Template variable: {var}", required=True
|
254
|
+
)
|
251
255
|
for var in template_vars
|
252
256
|
]
|
253
257
|
|
@@ -299,7 +303,9 @@ def register_prompt(file_path: Path, config: Optional[PromptConfig] = None) -> N
|
|
299
303
|
)
|
300
304
|
)
|
301
305
|
|
302
|
-
logger.info(
|
306
|
+
logger.info(
|
307
|
+
f"Registered resource: {resource_id} ({resource_file})"
|
308
|
+
)
|
303
309
|
except Exception as e:
|
304
310
|
logger.error(f"Error registering prompt {file_path}: {e}", exc_info=True)
|
305
311
|
|
@@ -307,7 +313,9 @@ def register_prompt(file_path: Path, config: Optional[PromptConfig] = None) -> N
|
|
307
313
|
def parse_args():
|
308
314
|
"""Parse command line arguments"""
|
309
315
|
parser = argparse.ArgumentParser(description="FastMCP Prompt Server")
|
310
|
-
parser.add_argument(
|
316
|
+
parser.add_argument(
|
317
|
+
"prompt_files", nargs="+", type=str, help="Prompt files to serve"
|
318
|
+
)
|
311
319
|
parser.add_argument(
|
312
320
|
"--user-delimiter",
|
313
321
|
type=str,
|
File without changes
|
File without changes
|
File without changes
|