fast-agent-mcp 0.2.56__py3-none-any.whl → 0.2.58__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_mcp-0.2.56.dist-info → fast_agent_mcp-0.2.58.dist-info}/METADATA +2 -2
- {fast_agent_mcp-0.2.56.dist-info → fast_agent_mcp-0.2.58.dist-info}/RECORD +25 -24
- mcp_agent/agents/agent.py +10 -3
- mcp_agent/agents/base_agent.py +7 -2
- mcp_agent/config.py +3 -0
- mcp_agent/core/agent_app.py +18 -6
- mcp_agent/core/enhanced_prompt.py +10 -2
- mcp_agent/core/fastagent.py +2 -0
- mcp_agent/core/request_params.py +5 -0
- mcp_agent/event_progress.py +3 -0
- mcp_agent/human_input/elicitation_form.py +45 -33
- mcp_agent/llm/augmented_llm.py +16 -0
- mcp_agent/llm/providers/augmented_llm_anthropic.py +1 -0
- mcp_agent/llm/providers/augmented_llm_bedrock.py +890 -602
- mcp_agent/llm/providers/augmented_llm_google_native.py +1 -0
- mcp_agent/llm/providers/augmented_llm_openai.py +1 -0
- mcp_agent/llm/providers/bedrock_utils.py +216 -0
- mcp_agent/mcp/mcp_agent_client_session.py +105 -2
- mcp_agent/mcp/mcp_aggregator.py +92 -29
- mcp_agent/mcp/mcp_connection_manager.py +19 -0
- mcp_agent/resources/examples/mcp/elicitations/elicitation_forms_server.py +25 -3
- mcp_agent/ui/console_display.py +105 -15
- {fast_agent_mcp-0.2.56.dist-info → fast_agent_mcp-0.2.58.dist-info}/WHEEL +0 -0
- {fast_agent_mcp-0.2.56.dist-info → fast_agent_mcp-0.2.58.dist-info}/entry_points.txt +0 -0
- {fast_agent_mcp-0.2.56.dist-info → fast_agent_mcp-0.2.58.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.58
|
|
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
|
|
@@ -218,7 +218,7 @@ Requires-Dist: deprecated>=1.2.18
|
|
|
218
218
|
Requires-Dist: email-validator>=2.2.0
|
|
219
219
|
Requires-Dist: fastapi>=0.115.6
|
|
220
220
|
Requires-Dist: google-genai>=1.27.0
|
|
221
|
-
Requires-Dist: mcp==1.
|
|
221
|
+
Requires-Dist: mcp==1.13.1
|
|
222
222
|
Requires-Dist: openai>=1.99.9
|
|
223
223
|
Requires-Dist: opentelemetry-distro>=0.55b0
|
|
224
224
|
Requires-Dist: opentelemetry-exporter-otlp-proto-http>=1.7.0
|
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
mcp_agent/__init__.py,sha256=HWWxZeB-VxrUNNXZnu4duzKGwdfCdD2M_O6drN4kfs8,2389
|
|
2
2
|
mcp_agent/app.py,sha256=3mtHP1nRQcRaKhhxgTmCOv00alh70nT7UxNA8bN47QE,5560
|
|
3
|
-
mcp_agent/config.py,sha256=
|
|
3
|
+
mcp_agent/config.py,sha256=hUdBh-o7apHpTodxYyMpF1d-QDwnuvivO-dt0PkwzeI,19466
|
|
4
4
|
mcp_agent/console.py,sha256=Gjf2QLFumwG1Lav__c07X_kZxxEUSkzV-1_-YbAwcwo,813
|
|
5
5
|
mcp_agent/context.py,sha256=lzz_Fyf9lz9BBAUt1bRVBlyyHjLkyeuyIziAi4qXYUk,7639
|
|
6
6
|
mcp_agent/context_dependent.py,sha256=QXfhw3RaQCKfscEEBRGuZ3sdMWqkgShz2jJ1ivGGX1I,1455
|
|
7
|
-
mcp_agent/event_progress.py,sha256=
|
|
7
|
+
mcp_agent/event_progress.py,sha256=YEk4RxHtblLNIn-ea8c9uHkEKOhtLEWOO662yjkf8Vo,4614
|
|
8
8
|
mcp_agent/mcp_server_registry.py,sha256=lmz-aES-l7Gbg4itDF0iCmpso_KD8bVazVKSVzjwNE4,12398
|
|
9
9
|
mcp_agent/progress_display.py,sha256=GeJU9VUt6qKsFVymG688hCMVCsAygG9ifiiEb5IcbN4,361
|
|
10
10
|
mcp_agent/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
11
11
|
mcp_agent/agents/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
12
|
-
mcp_agent/agents/agent.py,sha256
|
|
13
|
-
mcp_agent/agents/base_agent.py,sha256=
|
|
12
|
+
mcp_agent/agents/agent.py,sha256=-vAbAXMt_0jIXyU1_rvcbGTCjwT3I0wyFL7kAdxI1Qk,3361
|
|
13
|
+
mcp_agent/agents/base_agent.py,sha256=IVQNCJMgs9gfUnhS6BvK1bVEe0ZfjzZXmWKbpI980i0,34875
|
|
14
14
|
mcp_agent/agents/workflow/__init__.py,sha256=HloteEW6kalvgR0XewpiFAqaQlMPlPJYg5p3K33IUzI,25
|
|
15
15
|
mcp_agent/agents/workflow/chain_agent.py,sha256=eIlImirrSXkqBJmPuAJgOKis81Cl6lZEGM0-6IyaUV8,6105
|
|
16
16
|
mcp_agent/agents/workflow/evaluator_optimizer.py,sha256=LT81m2B7fxgBZY0CorXFOZJbVhM5fnjDjfrcywO5UrM,12210
|
|
@@ -32,19 +32,19 @@ mcp_agent/cli/commands/server_helpers.py,sha256=x5tD_qhf1W4D2li09sfOyfRWCOCa6lmp
|
|
|
32
32
|
mcp_agent/cli/commands/setup.py,sha256=eOEd4TL-b0DaDeSJMGOfNOsTEItoZ67W88eTP4aP-bo,6482
|
|
33
33
|
mcp_agent/cli/commands/url_parser.py,sha256=5VdtcHRHzi67YignStVbz7u-rcvNNErw9oJLAUFOtEY,5855
|
|
34
34
|
mcp_agent/core/__init__.py,sha256=7xAVBbyrsJwmrzL-we9tBY9PcJxFnajoJcaXSc6gBUw,391
|
|
35
|
-
mcp_agent/core/agent_app.py,sha256=
|
|
35
|
+
mcp_agent/core/agent_app.py,sha256=2p-wlQZJ7LNFOIxDdzt7u2p0ar-5To0laiSBCNaZWpw,16834
|
|
36
36
|
mcp_agent/core/agent_types.py,sha256=ClFN7ikstZ5suweeLFf5w9jcg3ygxVhMS7GRj9VJ8yQ,1749
|
|
37
37
|
mcp_agent/core/direct_decorators.py,sha256=mOMLHf_qhWFqcOY0QE1UbHtXAarnetIKp7n0U8WvcyM,24061
|
|
38
38
|
mcp_agent/core/direct_factory.py,sha256=0G1HbVECfdFJGn__lBYGha_qt7Xyp18ST18IOzO134E,20867
|
|
39
|
-
mcp_agent/core/enhanced_prompt.py,sha256=
|
|
39
|
+
mcp_agent/core/enhanced_prompt.py,sha256=QeBajgqu09SyK0ULEzsauAM-xlR4oLtT23udbZzVLuk,36410
|
|
40
40
|
mcp_agent/core/error_handling.py,sha256=xoyS2kLe0eG0bj2eSJCJ2odIhGUve2SbDR7jP-A-uRw,624
|
|
41
41
|
mcp_agent/core/exceptions.py,sha256=ENAD_qGG67foxy6vDkIvc-lgopIUQy6O7zvNPpPXaQg,2289
|
|
42
|
-
mcp_agent/core/fastagent.py,sha256=
|
|
42
|
+
mcp_agent/core/fastagent.py,sha256=dYN2fpgDSrk7iGHN7JmW0e8eFF47oqDmatzdUHz0eEI,25306
|
|
43
43
|
mcp_agent/core/interactive_prompt.py,sha256=Gpwn7v7m3nw7fR_W7bs5XYArrny_xJK06DOURUwpzI4,32756
|
|
44
44
|
mcp_agent/core/mcp_content.py,sha256=2D7KHY9mG_vxoDwFLKvsPQV9VRIzHItM7V-jcEnACh8,8878
|
|
45
45
|
mcp_agent/core/mermaid_utils.py,sha256=MpcRyVCPMTwU1XeIxnyFg0fQLjcyXZduWRF8NhEqvXE,5332
|
|
46
46
|
mcp_agent/core/prompt.py,sha256=qnintOUGEoDPYLI9bu9G2OlgVMCe5ZPUZilgMzydXhc,7919
|
|
47
|
-
mcp_agent/core/request_params.py,sha256=
|
|
47
|
+
mcp_agent/core/request_params.py,sha256=OW9WnQAD-I2fz2JzMsqPY2wwwHFG0SI4yAvC1WxTfNY,1735
|
|
48
48
|
mcp_agent/core/usage_display.py,sha256=CcCQbTm5ftMgkoBgr5NWzHmYFBK5cSU-FM8yiBOVzGA,7527
|
|
49
49
|
mcp_agent/core/validation.py,sha256=8D6d3mQanvzC2dXx5yc8-5bkoWEh9cxuT6-YSthSGFk,12676
|
|
50
50
|
mcp_agent/executor/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
@@ -52,7 +52,7 @@ mcp_agent/executor/executor.py,sha256=E44p6d-o3OMRoP_dNs_cDnyti91LQ3P9eNU88mSi1k
|
|
|
52
52
|
mcp_agent/executor/task_registry.py,sha256=PCALFeYtkQrPBg4RBJnlA0aDI8nHclrNkHGUS4kV3W8,1242
|
|
53
53
|
mcp_agent/executor/workflow_signal.py,sha256=Cg1uZBk3fn8kXhPOg-wINNuVaf3v9pvLD6NbqWy5Z6E,11142
|
|
54
54
|
mcp_agent/human_input/__init__.py,sha256=RydNC10PhvTYFbLXXs0JMTnAt0ihPYeJZoRTnsq3eMg,909
|
|
55
|
-
mcp_agent/human_input/elicitation_form.py,sha256=
|
|
55
|
+
mcp_agent/human_input/elicitation_form.py,sha256=qckv7pqFSRgjqIpESX4C7OOBuG25R32wVTfyLaD-6wQ,29201
|
|
56
56
|
mcp_agent/human_input/elicitation_forms.py,sha256=w8XQ1GfZX8Jw-VB4jnDI0Im4mF-T9Ts8mT2zRZBtL6M,3824
|
|
57
57
|
mcp_agent/human_input/elicitation_handler.py,sha256=YfVhIhSBc9wuszPS4zoHho4n1pwmIoq13huN4MSRkIs,3305
|
|
58
58
|
mcp_agent/human_input/elicitation_state.py,sha256=Unl9uhEybUqACCUimnETdfUprJNpYDMq3DdbbHw5oAw,1175
|
|
@@ -61,7 +61,7 @@ mcp_agent/human_input/handler.py,sha256=s712Z5ssTCwjL9-VKoIdP5CtgMh43YvepynYisiW
|
|
|
61
61
|
mcp_agent/human_input/simple_form.py,sha256=u6iCo39IJftB1S1xljdQP3C18RuRCcwp7jKQTTDcLT4,3441
|
|
62
62
|
mcp_agent/human_input/types.py,sha256=RtWBOVzy8vnYoQrc36jRLn8z8N3C4pDPMBN5vF6qM5Y,1476
|
|
63
63
|
mcp_agent/llm/__init__.py,sha256=d8zgwG-bRFuwiMNMYkywg_qytk4P8lawyld_meuUmHI,68
|
|
64
|
-
mcp_agent/llm/augmented_llm.py,sha256=
|
|
64
|
+
mcp_agent/llm/augmented_llm.py,sha256=ovJKfgDKtNFmIhT3pKKjsNsaTQicz07bLo4eoIFx3ik,28682
|
|
65
65
|
mcp_agent/llm/augmented_llm_passthrough.py,sha256=bu0DJkjyFPzBZEU7f6MHnOp__9BCYl56tFd5nZVhSeY,8808
|
|
66
66
|
mcp_agent/llm/augmented_llm_playback.py,sha256=rLzgai496e2RlxqQp_Bp0U-Y1FF1SGsWl9COx4GiCNE,5004
|
|
67
67
|
mcp_agent/llm/augmented_llm_silent.py,sha256=IUnK_1Byy4D9TG0Pj46LFeNezgSTQ8d6MQIHWAImBwE,1846
|
|
@@ -78,18 +78,19 @@ mcp_agent/llm/usage_tracking.py,sha256=rF6v8QQDam8QbvlP4jzHljKqvuNHExeYDLkUMI86c
|
|
|
78
78
|
mcp_agent/llm/providers/__init__.py,sha256=heVxtmuqFJOnjjxHz4bWSqTAxXoN1E8twC_gQ_yJpHk,265
|
|
79
79
|
mcp_agent/llm/providers/anthropic_utils.py,sha256=vYDN5G5jKMhD2CQg8veJYab7tvvzYkDMq8M1g_hUAQg,3275
|
|
80
80
|
mcp_agent/llm/providers/augmented_llm_aliyun.py,sha256=Th4qeyihOSfTrojPw8YsgzEyaDwhybk7hkXkFjH-1dY,1277
|
|
81
|
-
mcp_agent/llm/providers/augmented_llm_anthropic.py,sha256=
|
|
81
|
+
mcp_agent/llm/providers/augmented_llm_anthropic.py,sha256=2IXAJVQOaMOGKLbZq5onwJ7E8baSsoIst7ffAZtyntw,30393
|
|
82
82
|
mcp_agent/llm/providers/augmented_llm_azure.py,sha256=Xoo6dFst6L9SaGKurqptwwTUzr-sYsolZ-AFb_79puc,6098
|
|
83
|
-
mcp_agent/llm/providers/augmented_llm_bedrock.py,sha256=
|
|
83
|
+
mcp_agent/llm/providers/augmented_llm_bedrock.py,sha256=gah6t-MSNJGgB-7OFVl7WAybNTh9Jygvgs0ABWyd69o,97313
|
|
84
84
|
mcp_agent/llm/providers/augmented_llm_deepseek.py,sha256=vphkYMFyukaejBw8SkCN-MqcG9qsfXJfWKZYYtspqPY,3877
|
|
85
85
|
mcp_agent/llm/providers/augmented_llm_generic.py,sha256=5Uq8ZBhcFuQTt7koP_5ykolREh2iWu8zKhNbh3pM9lQ,1210
|
|
86
|
-
mcp_agent/llm/providers/augmented_llm_google_native.py,sha256=
|
|
86
|
+
mcp_agent/llm/providers/augmented_llm_google_native.py,sha256=QfxzDTZCfRLOE0XcV7rOw76hRgTZ_oGBg1Bn0m_PHVY,22235
|
|
87
87
|
mcp_agent/llm/providers/augmented_llm_google_oai.py,sha256=g_g46h-YuxqbRZiO_dVo5zO2OkX1yx7nb6xDaQbOvWs,1137
|
|
88
88
|
mcp_agent/llm/providers/augmented_llm_groq.py,sha256=w-R1N2B7790v9tXxRCPt2SKnaB-DRdEtN_51fpdYb_I,5355
|
|
89
|
-
mcp_agent/llm/providers/augmented_llm_openai.py,sha256=
|
|
89
|
+
mcp_agent/llm/providers/augmented_llm_openai.py,sha256=RnwbzWMFWp2kHfmUhLTrx4rSTWkgJRc3XkN52_f3zt0,25359
|
|
90
90
|
mcp_agent/llm/providers/augmented_llm_openrouter.py,sha256=m3wS83fabBOmaZJH9gQ9sFw_2TB4xTb44WCOPB-2NJ4,2001
|
|
91
91
|
mcp_agent/llm/providers/augmented_llm_tensorzero_openai.py,sha256=D53Fry2AfBLOB5z9hM19U6_HMJeVNTpiBCAJb11ulNg,5503
|
|
92
92
|
mcp_agent/llm/providers/augmented_llm_xai.py,sha256=MhlX91IUNynQ_NDknx4EQJLwg-NbR8lcHS1P4JuLOnA,1433
|
|
93
|
+
mcp_agent/llm/providers/bedrock_utils.py,sha256=Ok-nGQ4T4OuFhr5d6LhVY4hUiq481yaixDWBpwohu_Y,7734
|
|
93
94
|
mcp_agent/llm/providers/google_converter.py,sha256=YmSfkkZR2YzR5DZduGaOW0v7BtjjindCIiuS8zOJ1VA,16941
|
|
94
95
|
mcp_agent/llm/providers/multipart_converter_anthropic.py,sha256=QsgIwWJ14SNZsun3fKDQaUx5AYdk8X6UYeBgYlZgZN0,16607
|
|
95
96
|
mcp_agent/llm/providers/multipart_converter_openai.py,sha256=8vBwX7PB62mV6pe4VvAj9YxzX1Dp1RJMZK1NWOMnioY,17998
|
|
@@ -112,9 +113,9 @@ mcp_agent/mcp/gen_client.py,sha256=fAVwFVCgSamw4PwoWOV4wrK9TABx1S_zZv8BctRyF2k,3
|
|
|
112
113
|
mcp_agent/mcp/hf_auth.py,sha256=7szw4rkwRyK3J-sUTcVZHdwoLIZqlYo8XolJnZdjOww,4571
|
|
113
114
|
mcp_agent/mcp/interfaces.py,sha256=5y7zuXkpGCfsJfZOAEZAZtbFd5rAKjn7oG4JoblPHZ4,8070
|
|
114
115
|
mcp_agent/mcp/logger_textio.py,sha256=vljC1BtNTCxBAda9ExqNB-FwVNUZIuJT3h1nWmCjMws,3172
|
|
115
|
-
mcp_agent/mcp/mcp_agent_client_session.py,sha256=
|
|
116
|
-
mcp_agent/mcp/mcp_aggregator.py,sha256=
|
|
117
|
-
mcp_agent/mcp/mcp_connection_manager.py,sha256=
|
|
116
|
+
mcp_agent/mcp/mcp_agent_client_session.py,sha256=WUx-9usO6PHwyfodIPEtd88DNDU-1YDdvQ4TNsEpfqI,13383
|
|
117
|
+
mcp_agent/mcp/mcp_aggregator.py,sha256=9r0EOrb8UR9br6qrjwW4deWWO2Jt7NFrYJenhrePRAk,55915
|
|
118
|
+
mcp_agent/mcp/mcp_connection_manager.py,sha256=VaWH-PWjVfaCDEWT0nfMblJ_3BbvDqDgoeMtGuLS9_M,18716
|
|
118
119
|
mcp_agent/mcp/mime_utils.py,sha256=difepNR_gpb4MpMLkBRAoyhDk-AjXUHTiqKvT_VwS1o,1805
|
|
119
120
|
mcp_agent/mcp/prompt_message_multipart.py,sha256=-oSO0mnc5gkSgulE1gAntPEwAKF4asOjEeVyLjhYrEk,4336
|
|
120
121
|
mcp_agent/mcp/prompt_render.py,sha256=k3v4BZDThGE2gGiOYVQtA6x8WTEdOuXIEnRafANhN1U,2996
|
|
@@ -138,7 +139,7 @@ mcp_agent/resources/examples/data-analysis/analysis.py,sha256=UaZk8RzsIj0TVXIM1k
|
|
|
138
139
|
mcp_agent/resources/examples/data-analysis/fastagent.config.yaml,sha256=ini94PHyJCfgpjcjHKMMbGuHs6LIj46F1NwY0ll5HVk,1609
|
|
139
140
|
mcp_agent/resources/examples/data-analysis/mount-point/WA_Fn-UseC_-HR-Employee-Attrition.csv,sha256=pcMeOL1_r8m8MziE6xgbBrQbjl5Ijo98yycZn7O-dlk,227977
|
|
140
141
|
mcp_agent/resources/examples/mcp/elicitations/elicitation_account_server.py,sha256=ZrPcj0kv75QXvtN0J_vhCmwxycnAodv35adUBZ9_8Ss,2903
|
|
141
|
-
mcp_agent/resources/examples/mcp/elicitations/elicitation_forms_server.py,sha256=
|
|
142
|
+
mcp_agent/resources/examples/mcp/elicitations/elicitation_forms_server.py,sha256=JSRSZ2rKqsHB0gt7LvyyVR9whnhmi_8kbvc9V6jvx2M,9329
|
|
142
143
|
mcp_agent/resources/examples/mcp/elicitations/elicitation_game_server.py,sha256=z9kHdNc6XWjAWkvet7inVBIcYxfWoxU6n9iHrsEqU7A,6206
|
|
143
144
|
mcp_agent/resources/examples/mcp/elicitations/fastagent.config.yaml,sha256=HPe0cuFL4-rzS4hHNgZiLMPEv0jYXOp7iSsrUliAaqs,1080
|
|
144
145
|
mcp_agent/resources/examples/mcp/elicitations/fastagent.secrets.yaml.example,sha256=1vkBmh9f4mnQZm6-2B7vyU1OepImviPW5MNAJkvUIPE,394
|
|
@@ -183,10 +184,10 @@ mcp_agent/resources/examples/workflows/router.py,sha256=vmw8aBitByi5PRFIvjYWWn2G
|
|
|
183
184
|
mcp_agent/resources/examples/workflows/short_story.md,sha256=XN9I2kzCcMmke3dE5F2lyRH5iFUZUQ8Sy-hS3rm_Wlc,1153
|
|
184
185
|
mcp_agent/resources/examples/workflows/short_story.txt,sha256=X3y_1AyhLFN2AKzCKvucJtDgAFIJfnlbsbGZO5bBWu0,1187
|
|
185
186
|
mcp_agent/tools/tool_definition.py,sha256=L3Pxl-uLEXqlVoo-bYuFTFALeI-2pIU44YgFhsTKEtM,398
|
|
186
|
-
mcp_agent/ui/console_display.py,sha256=
|
|
187
|
+
mcp_agent/ui/console_display.py,sha256=ts2oPxxprzbT9rMqZhzwq6DQkNfbq8XNwbgEPPMi7nI,32083
|
|
187
188
|
mcp_agent/ui/console_display_legacy.py,sha256=sm2v61-IPVafbF7uUaOyhO2tW_zgFWOjNS83IEWqGgI,14931
|
|
188
|
-
fast_agent_mcp-0.2.
|
|
189
|
-
fast_agent_mcp-0.2.
|
|
190
|
-
fast_agent_mcp-0.2.
|
|
191
|
-
fast_agent_mcp-0.2.
|
|
192
|
-
fast_agent_mcp-0.2.
|
|
189
|
+
fast_agent_mcp-0.2.58.dist-info/METADATA,sha256=WRpwRbCBYX-Aqf2TBHNWgRVxsNJUxMKuwNELJ29_ooA,30459
|
|
190
|
+
fast_agent_mcp-0.2.58.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
|
|
191
|
+
fast_agent_mcp-0.2.58.dist-info/entry_points.txt,sha256=QaX5kLdI0VdMPRdPUF1nkG_WdLUTNjp_icW6e3EhNYU,232
|
|
192
|
+
fast_agent_mcp-0.2.58.dist-info/licenses/LICENSE,sha256=Gx1L3axA4PnuK4FxsbX87jQ1opoOkSFfHHSytW6wLUU,10935
|
|
193
|
+
fast_agent_mcp-0.2.58.dist-info/RECORD,,
|
mcp_agent/agents/agent.py
CHANGED
|
@@ -10,6 +10,7 @@ from typing import TYPE_CHECKING, Any, Callable, Dict, List, Optional, TypeVar
|
|
|
10
10
|
from mcp_agent.agents.base_agent import BaseAgent
|
|
11
11
|
from mcp_agent.core.agent_types import AgentConfig
|
|
12
12
|
from mcp_agent.core.interactive_prompt import InteractivePrompt
|
|
13
|
+
from mcp_agent.core.request_params import RequestParams
|
|
13
14
|
from mcp_agent.human_input.types import HumanInputCallback
|
|
14
15
|
from mcp_agent.logging.logger import get_logger
|
|
15
16
|
from mcp_agent.mcp.interfaces import AugmentedLLMProtocol
|
|
@@ -51,13 +52,19 @@ class Agent(BaseAgent):
|
|
|
51
52
|
**kwargs,
|
|
52
53
|
)
|
|
53
54
|
|
|
54
|
-
async def prompt(
|
|
55
|
+
async def prompt(
|
|
56
|
+
self,
|
|
57
|
+
default_prompt: str = "",
|
|
58
|
+
agent_name: Optional[str] = None,
|
|
59
|
+
request_params: RequestParams | None = None
|
|
60
|
+
) -> str:
|
|
55
61
|
"""
|
|
56
62
|
Start an interactive prompt session with this agent.
|
|
57
63
|
|
|
58
64
|
Args:
|
|
59
65
|
default: Default message to use when user presses enter
|
|
60
66
|
agent_name: Ignored for single agents, included for API compatibility
|
|
67
|
+
request_params: Optional request parameters
|
|
61
68
|
|
|
62
69
|
Returns:
|
|
63
70
|
The result of the interactive session
|
|
@@ -66,14 +73,14 @@ class Agent(BaseAgent):
|
|
|
66
73
|
agent_name_str = str(self.name)
|
|
67
74
|
|
|
68
75
|
# Create agent_types dictionary with just this agent
|
|
69
|
-
agent_types = {agent_name_str: self.agent_type
|
|
76
|
+
agent_types = {agent_name_str: self.agent_type}
|
|
70
77
|
|
|
71
78
|
# Create the interactive prompt
|
|
72
79
|
prompt = InteractivePrompt(agent_types=agent_types)
|
|
73
80
|
|
|
74
81
|
# Define wrapper for send function
|
|
75
82
|
async def send_wrapper(message, agent_name):
|
|
76
|
-
return await self.send(message)
|
|
83
|
+
return await self.send(message, request_params)
|
|
77
84
|
|
|
78
85
|
# Start the prompt loop with just this agent
|
|
79
86
|
return await prompt.prompt_loop(
|
mcp_agent/agents/base_agent.py
CHANGED
|
@@ -208,7 +208,11 @@ class BaseAgent(MCPAggregator, AgentProtocol):
|
|
|
208
208
|
result: PromptMessageMultipart = await self.generate([Prompt.user(message)], request_params)
|
|
209
209
|
return result.first_text()
|
|
210
210
|
|
|
211
|
-
async def send(
|
|
211
|
+
async def send(
|
|
212
|
+
self,
|
|
213
|
+
message: Union[str, PromptMessage, PromptMessageMultipart],
|
|
214
|
+
request_params: RequestParams | None = None
|
|
215
|
+
) -> str:
|
|
212
216
|
"""
|
|
213
217
|
Send a message to the agent and get a response.
|
|
214
218
|
|
|
@@ -217,6 +221,7 @@ class BaseAgent(MCPAggregator, AgentProtocol):
|
|
|
217
221
|
- String: Converted to a user PromptMessageMultipart
|
|
218
222
|
- PromptMessage: Converted to PromptMessageMultipart
|
|
219
223
|
- PromptMessageMultipart: Used directly
|
|
224
|
+
- request_params: Optional request parameters
|
|
220
225
|
|
|
221
226
|
Returns:
|
|
222
227
|
The agent's response as a string
|
|
@@ -225,7 +230,7 @@ class BaseAgent(MCPAggregator, AgentProtocol):
|
|
|
225
230
|
prompt = self._normalize_message_input(message)
|
|
226
231
|
|
|
227
232
|
# Use the LLM to generate a response
|
|
228
|
-
response = await self.generate([prompt],
|
|
233
|
+
response = await self.generate([prompt], request_params)
|
|
229
234
|
return response.all_text()
|
|
230
235
|
|
|
231
236
|
def _normalize_message_input(
|
mcp_agent/config.py
CHANGED
|
@@ -276,6 +276,9 @@ class BedrockSettings(BaseModel):
|
|
|
276
276
|
profile: str | None = None
|
|
277
277
|
"""AWS profile to use for authentication"""
|
|
278
278
|
|
|
279
|
+
reasoning_effort: Literal["minimal", "low", "medium", "high"] = "minimal"
|
|
280
|
+
"""Default reasoning effort for Bedrock models. Can be overridden in model string (e.g., bedrock.claude-sonnet-4-0.high)"""
|
|
281
|
+
|
|
279
282
|
model_config = ConfigDict(extra="allow", arbitrary_types_allowed=True)
|
|
280
283
|
|
|
281
284
|
|
mcp_agent/core/agent_app.py
CHANGED
|
@@ -11,6 +11,7 @@ from rich import print as rich_print
|
|
|
11
11
|
from mcp_agent.agents.agent import Agent
|
|
12
12
|
from mcp_agent.core.agent_types import AgentType
|
|
13
13
|
from mcp_agent.core.interactive_prompt import InteractivePrompt
|
|
14
|
+
from mcp_agent.core.request_params import RequestParams
|
|
14
15
|
from mcp_agent.mcp.prompt_message_multipart import PromptMessageMultipart
|
|
15
16
|
from mcp_agent.progress_display import progress_display
|
|
16
17
|
|
|
@@ -53,6 +54,7 @@ class AgentApp:
|
|
|
53
54
|
message: Union[str, PromptMessage, PromptMessageMultipart] | None = None,
|
|
54
55
|
agent_name: str | None = None,
|
|
55
56
|
default_prompt: str = "",
|
|
57
|
+
request_params: RequestParams | None = None,
|
|
56
58
|
) -> str:
|
|
57
59
|
"""
|
|
58
60
|
Make the object callable to send messages or start interactive prompt.
|
|
@@ -65,19 +67,21 @@ class AgentApp:
|
|
|
65
67
|
- PromptMessageMultipart: Used directly
|
|
66
68
|
agent_name: Optional name of the agent to send to (defaults to first agent)
|
|
67
69
|
default_prompt: Default message to use in interactive prompt mode
|
|
70
|
+
request_params: Optional request parameters including MCP metadata
|
|
68
71
|
|
|
69
72
|
Returns:
|
|
70
73
|
The agent's response as a string or the result of the interactive session
|
|
71
74
|
"""
|
|
72
75
|
if message:
|
|
73
|
-
return await self._agent(agent_name).send(message)
|
|
76
|
+
return await self._agent(agent_name).send(message, request_params)
|
|
74
77
|
|
|
75
|
-
return await self.interactive(agent_name=agent_name, default_prompt=default_prompt)
|
|
78
|
+
return await self.interactive(agent_name=agent_name, default_prompt=default_prompt, request_params=request_params)
|
|
76
79
|
|
|
77
80
|
async def send(
|
|
78
81
|
self,
|
|
79
82
|
message: Union[str, PromptMessage, PromptMessageMultipart],
|
|
80
83
|
agent_name: Optional[str] = None,
|
|
84
|
+
request_params: RequestParams | None = None,
|
|
81
85
|
) -> str:
|
|
82
86
|
"""
|
|
83
87
|
Send a message to the specified agent (or to all agents).
|
|
@@ -88,11 +92,12 @@ class AgentApp:
|
|
|
88
92
|
- PromptMessage: Converted to PromptMessageMultipart
|
|
89
93
|
- PromptMessageMultipart: Used directly
|
|
90
94
|
agent_name: Optional name of the agent to send to
|
|
95
|
+
request_params: Optional request parameters including MCP metadata
|
|
91
96
|
|
|
92
97
|
Returns:
|
|
93
98
|
The agent's response as a string
|
|
94
99
|
"""
|
|
95
|
-
return await self._agent(agent_name).send(message)
|
|
100
|
+
return await self._agent(agent_name).send(message, request_params)
|
|
96
101
|
|
|
97
102
|
def _agent(self, agent_name: str | None) -> Agent:
|
|
98
103
|
if agent_name:
|
|
@@ -233,17 +238,23 @@ class AgentApp:
|
|
|
233
238
|
)
|
|
234
239
|
|
|
235
240
|
@deprecated
|
|
236
|
-
async def prompt(
|
|
241
|
+
async def prompt(
|
|
242
|
+
self,
|
|
243
|
+
agent_name: str | None = None,
|
|
244
|
+
default_prompt: str = "",
|
|
245
|
+
request_params: RequestParams | None = None
|
|
246
|
+
) -> str:
|
|
237
247
|
"""
|
|
238
248
|
Deprecated - use interactive() instead.
|
|
239
249
|
"""
|
|
240
|
-
return await self.interactive(agent_name=agent_name, default_prompt=default_prompt)
|
|
250
|
+
return await self.interactive(agent_name=agent_name, default_prompt=default_prompt, request_params=request_params)
|
|
241
251
|
|
|
242
252
|
async def interactive(
|
|
243
253
|
self,
|
|
244
254
|
agent_name: str | None = None,
|
|
245
255
|
default_prompt: str = "",
|
|
246
256
|
pretty_print_parallel: bool = False,
|
|
257
|
+
request_params: RequestParams | None = None,
|
|
247
258
|
) -> str:
|
|
248
259
|
"""
|
|
249
260
|
Interactive prompt for sending messages with advanced features.
|
|
@@ -252,6 +263,7 @@ class AgentApp:
|
|
|
252
263
|
agent_name: Optional target agent name (uses default if not specified)
|
|
253
264
|
default: Default message to use when user presses enter
|
|
254
265
|
pretty_print_parallel: Enable clean parallel results display for parallel agents
|
|
266
|
+
request_params: Optional request parameters including MCP metadata
|
|
255
267
|
|
|
256
268
|
Returns:
|
|
257
269
|
The result of the interactive session
|
|
@@ -285,7 +297,7 @@ class AgentApp:
|
|
|
285
297
|
|
|
286
298
|
# Define the wrapper for send function
|
|
287
299
|
async def send_wrapper(message, agent_name):
|
|
288
|
-
result = await self.send(message, agent_name)
|
|
300
|
+
result = await self.send(message, agent_name, request_params)
|
|
289
301
|
|
|
290
302
|
# Show parallel results if enabled and this is a parallel agent
|
|
291
303
|
if pretty_print_parallel:
|
|
@@ -428,9 +428,14 @@ def create_keybindings(on_toggle_multiline=None, app=None, agent_provider=None,
|
|
|
428
428
|
"""Enter: accept input when not in multiline mode."""
|
|
429
429
|
event.current_buffer.validate_and_handle()
|
|
430
430
|
|
|
431
|
+
@kb.add("c-j", filter=Condition(lambda: not in_multiline_mode))
|
|
432
|
+
def _(event) -> None:
|
|
433
|
+
"""Ctrl+J: Insert newline when in normal mode."""
|
|
434
|
+
event.current_buffer.insert_text("\n")
|
|
435
|
+
|
|
431
436
|
@kb.add("c-m", filter=Condition(lambda: in_multiline_mode))
|
|
432
437
|
def _(event) -> None:
|
|
433
|
-
"""Enter:
|
|
438
|
+
"""Enter: Insert newline when in multiline mode."""
|
|
434
439
|
event.current_buffer.insert_text("\n")
|
|
435
440
|
|
|
436
441
|
# Use c-j (Ctrl+J) as an alternative to represent Ctrl+Enter in multiline mode
|
|
@@ -581,6 +586,7 @@ async def get_enhanced_input(
|
|
|
581
586
|
|
|
582
587
|
shortcuts = [
|
|
583
588
|
("Ctrl+T", toggle_text),
|
|
589
|
+
("Ctrl+J", "Newline" if not in_multiline_mode else None),
|
|
584
590
|
("Ctrl+E", "External"),
|
|
585
591
|
("Ctrl+Y", "Copy"),
|
|
586
592
|
("Ctrl+L", "Clear"),
|
|
@@ -588,7 +594,7 @@ async def get_enhanced_input(
|
|
|
588
594
|
("EXIT", "Exit")
|
|
589
595
|
]
|
|
590
596
|
|
|
591
|
-
newline = "Ctrl
|
|
597
|
+
newline = "Ctrl+J:Submit" if in_multiline_mode else "<Enter>:Submit"
|
|
592
598
|
|
|
593
599
|
# Only show relevant shortcuts based on mode
|
|
594
600
|
shortcuts = [(k, v) for k, v in shortcuts if v]
|
|
@@ -670,6 +676,8 @@ async def get_enhanced_input(
|
|
|
670
676
|
def pre_process_input(text):
|
|
671
677
|
# Command processing
|
|
672
678
|
if text and text.startswith("/"):
|
|
679
|
+
if text == "/":
|
|
680
|
+
return ""
|
|
673
681
|
cmd_parts = text[1:].strip().split(maxsplit=1)
|
|
674
682
|
cmd = cmd_parts[0].lower()
|
|
675
683
|
|
mcp_agent/core/fastagent.py
CHANGED
|
@@ -87,6 +87,7 @@ class FastAgent:
|
|
|
87
87
|
ignore_unknown_args: bool = False,
|
|
88
88
|
parse_cli_args: bool = True,
|
|
89
89
|
quiet: bool = False, # Add quiet parameter
|
|
90
|
+
**kwargs
|
|
90
91
|
) -> None:
|
|
91
92
|
"""
|
|
92
93
|
Initialize the fast-agent application.
|
|
@@ -203,6 +204,7 @@ class FastAgent:
|
|
|
203
204
|
self.app = MCPApp(
|
|
204
205
|
name=name,
|
|
205
206
|
settings=config.Settings(**self.config) if hasattr(self, "config") else None,
|
|
207
|
+
**kwargs
|
|
206
208
|
)
|
|
207
209
|
|
|
208
210
|
# Stop progress display immediately if quiet mode is requested
|
mcp_agent/core/request_params.py
CHANGED
|
@@ -52,3 +52,8 @@ class RequestParams(CreateMessageRequestParams):
|
|
|
52
52
|
"""
|
|
53
53
|
Optional dictionary of template variables for dynamic templates. Currently only works for TensorZero inference backend
|
|
54
54
|
"""
|
|
55
|
+
|
|
56
|
+
mcp_metadata: Dict[str, Any] | None = None
|
|
57
|
+
"""
|
|
58
|
+
Metadata to pass through to MCP tool calls via the _meta field.
|
|
59
|
+
"""
|
mcp_agent/event_progress.py
CHANGED
|
@@ -5,9 +5,7 @@ from typing import Any, Dict, Optional
|
|
|
5
5
|
|
|
6
6
|
from mcp.types import ElicitRequestedSchema
|
|
7
7
|
from prompt_toolkit import Application
|
|
8
|
-
from prompt_toolkit.application.current import get_app
|
|
9
8
|
from prompt_toolkit.buffer import Buffer
|
|
10
|
-
from prompt_toolkit.filters import Condition
|
|
11
9
|
from prompt_toolkit.formatted_text import FormattedText
|
|
12
10
|
from prompt_toolkit.key_binding import KeyBindings
|
|
13
11
|
from prompt_toolkit.key_binding.bindings.focus import focus_next, focus_previous
|
|
@@ -327,16 +325,21 @@ class ElicitationForm:
|
|
|
327
325
|
def focus_previous_left(event):
|
|
328
326
|
focus_previous(event)
|
|
329
327
|
|
|
330
|
-
#
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
@kb.add("c-m", filter=not_in_multiline) # Enter to submit only when not in multiline
|
|
328
|
+
# Enter always submits
|
|
329
|
+
@kb.add("c-m")
|
|
334
330
|
def submit(event):
|
|
335
331
|
self._accept()
|
|
336
332
|
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
333
|
+
# Ctrl+J inserts newlines
|
|
334
|
+
@kb.add("c-j")
|
|
335
|
+
def insert_newline(event):
|
|
336
|
+
# Insert a newline at the cursor position
|
|
337
|
+
event.current_buffer.insert_text('\n')
|
|
338
|
+
# Mark this field as multiline when user adds a newline
|
|
339
|
+
for field_name, widget in self.field_widgets.items():
|
|
340
|
+
if isinstance(widget, Buffer) and widget == event.current_buffer:
|
|
341
|
+
self.multiline_fields.add(field_name)
|
|
342
|
+
break
|
|
340
343
|
|
|
341
344
|
# ESC should ALWAYS cancel immediately, no matter what
|
|
342
345
|
@kb.add("escape", eager=True, is_global=True)
|
|
@@ -353,7 +356,7 @@ class ElicitationForm:
|
|
|
353
356
|
[
|
|
354
357
|
(
|
|
355
358
|
"class:bottom-toolbar.text",
|
|
356
|
-
" <TAB
|
|
359
|
+
" <TAB>/↑↓→← navigate. <ENTER> submit. <Ctrl+J> insert new line. <ESC> cancel. ",
|
|
357
360
|
),
|
|
358
361
|
(
|
|
359
362
|
"class:bottom-toolbar.text",
|
|
@@ -435,6 +438,7 @@ class ElicitationForm:
|
|
|
435
438
|
|
|
436
439
|
return constraints
|
|
437
440
|
|
|
441
|
+
|
|
438
442
|
def _create_field(self, field_name: str, field_def: Dict[str, Any]):
|
|
439
443
|
"""Create a field widget."""
|
|
440
444
|
|
|
@@ -510,7 +514,8 @@ class ElicitationForm:
|
|
|
510
514
|
enum_names = field_def.get("enumNames", enum_values)
|
|
511
515
|
values = [(val, name) for val, name in zip(enum_values, enum_names)]
|
|
512
516
|
|
|
513
|
-
|
|
517
|
+
default_value = field_def.get("default")
|
|
518
|
+
radio_list = RadioList(values=values, default=default_value)
|
|
514
519
|
self.field_widgets[field_name] = radio_list
|
|
515
520
|
|
|
516
521
|
return HSplit([label, Frame(radio_list, height=min(len(values) + 2, 6))])
|
|
@@ -541,23 +546,35 @@ class ElicitationForm:
|
|
|
541
546
|
else:
|
|
542
547
|
constraints = {}
|
|
543
548
|
|
|
544
|
-
|
|
549
|
+
default_value = field_def.get("default")
|
|
550
|
+
|
|
551
|
+
# Determine if field should be multiline based on max_length or default value length
|
|
545
552
|
if field_type == "string":
|
|
546
553
|
max_length = constraints.get("maxLength")
|
|
554
|
+
# Check default value length if maxLength not specified
|
|
555
|
+
if not max_length and default_value is not None:
|
|
556
|
+
max_length = len(str(default_value))
|
|
547
557
|
else:
|
|
548
558
|
max_length = None
|
|
549
|
-
|
|
559
|
+
|
|
560
|
+
# Check if default value contains newlines
|
|
561
|
+
if field_type == "string" and default_value is not None and '\n' in str(default_value):
|
|
562
|
+
multiline = True
|
|
563
|
+
self.multiline_fields.add(field_name) # Track multiline fields
|
|
564
|
+
# Set height to actual line count for fields with newlines in default
|
|
565
|
+
initial_height = str(default_value).count('\n') + 1
|
|
566
|
+
elif max_length and max_length > 100:
|
|
550
567
|
# Use multiline for longer fields
|
|
551
568
|
multiline = True
|
|
552
569
|
self.multiline_fields.add(field_name) # Track multiline fields
|
|
553
570
|
if max_length <= 300:
|
|
554
|
-
|
|
571
|
+
initial_height = 3
|
|
555
572
|
else:
|
|
556
|
-
|
|
573
|
+
initial_height = 5
|
|
557
574
|
else:
|
|
558
575
|
# Single line for shorter fields
|
|
559
576
|
multiline = False
|
|
560
|
-
|
|
577
|
+
initial_height = 1
|
|
561
578
|
|
|
562
579
|
buffer = Buffer(
|
|
563
580
|
validator=validator,
|
|
@@ -566,6 +583,8 @@ class ElicitationForm:
|
|
|
566
583
|
complete_while_typing=False, # Disable completion for cleaner experience
|
|
567
584
|
enable_history_search=False, # Disable history for cleaner experience
|
|
568
585
|
)
|
|
586
|
+
if default_value is not None:
|
|
587
|
+
buffer.text = str(default_value)
|
|
569
588
|
self.field_widgets[field_name] = buffer
|
|
570
589
|
|
|
571
590
|
# Create dynamic style function for focus highlighting and validation errors
|
|
@@ -581,31 +600,24 @@ class ElicitationForm:
|
|
|
581
600
|
else:
|
|
582
601
|
return "class:input-field"
|
|
583
602
|
|
|
603
|
+
# Create a dynamic height function based on content
|
|
604
|
+
def get_dynamic_height():
|
|
605
|
+
if not buffer.text:
|
|
606
|
+
return initial_height
|
|
607
|
+
# Calculate height based on number of newlines in buffer
|
|
608
|
+
line_count = buffer.text.count('\n') + 1
|
|
609
|
+
# Use initial height as minimum, grow up to 20 lines
|
|
610
|
+
return min(max(line_count, initial_height), 20)
|
|
611
|
+
|
|
584
612
|
text_input = Window(
|
|
585
613
|
BufferControl(buffer=buffer),
|
|
586
|
-
height=height
|
|
614
|
+
height=get_dynamic_height, # Use dynamic height function
|
|
587
615
|
style=get_field_style, # Use dynamic style function
|
|
588
616
|
wrap_lines=True if multiline else False, # Enable word wrap for multiline
|
|
589
617
|
)
|
|
590
618
|
|
|
591
619
|
return HSplit([label, Frame(text_input)])
|
|
592
620
|
|
|
593
|
-
def _is_in_multiline_field(self) -> bool:
|
|
594
|
-
"""Check if currently focused field is a multiline field."""
|
|
595
|
-
|
|
596
|
-
focused = get_app().layout.current_control
|
|
597
|
-
|
|
598
|
-
# Find which field this control belongs to
|
|
599
|
-
# Only Buffer widgets can be multiline, so only check those
|
|
600
|
-
for field_name, widget in self.field_widgets.items():
|
|
601
|
-
if (
|
|
602
|
-
isinstance(widget, Buffer)
|
|
603
|
-
and hasattr(focused, "buffer")
|
|
604
|
-
and widget == focused.buffer
|
|
605
|
-
):
|
|
606
|
-
return field_name in self.multiline_fields
|
|
607
|
-
return False
|
|
608
|
-
|
|
609
621
|
def _validate_form(self) -> tuple[bool, Optional[str]]:
|
|
610
622
|
"""Validate the entire form."""
|
|
611
623
|
|
mcp_agent/llm/augmented_llm.py
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
from abc import abstractmethod
|
|
2
|
+
from contextvars import ContextVar
|
|
2
3
|
from typing import (
|
|
3
4
|
TYPE_CHECKING,
|
|
4
5
|
Any,
|
|
@@ -61,6 +62,9 @@ if TYPE_CHECKING:
|
|
|
61
62
|
# TODO -- move this to a constant
|
|
62
63
|
HUMAN_INPUT_TOOL_NAME = "__human_input__"
|
|
63
64
|
|
|
65
|
+
# Context variable for storing MCP metadata
|
|
66
|
+
_mcp_metadata_var: ContextVar[Dict[str, Any] | None] = ContextVar('mcp_metadata', default=None)
|
|
67
|
+
|
|
64
68
|
|
|
65
69
|
def deep_merge(dict1: Dict[Any, Any], dict2: Dict[Any, Any]) -> Dict[Any, Any]:
|
|
66
70
|
"""
|
|
@@ -97,6 +101,7 @@ class AugmentedLLM(ContextDependent, AugmentedLLMProtocol, Generic[MessageParamT
|
|
|
97
101
|
PARAM_USE_HISTORY = "use_history"
|
|
98
102
|
PARAM_MAX_ITERATIONS = "max_iterations"
|
|
99
103
|
PARAM_TEMPLATE_VARS = "template_vars"
|
|
104
|
+
PARAM_MCP_METADATA = "mcp_metadata"
|
|
100
105
|
|
|
101
106
|
# Base set of fields that should always be excluded
|
|
102
107
|
BASE_EXCLUDE_FIELDS = {PARAM_METADATA}
|
|
@@ -232,6 +237,11 @@ class AugmentedLLM(ContextDependent, AugmentedLLMProtocol, Generic[MessageParamT
|
|
|
232
237
|
|
|
233
238
|
self._precall(multipart_messages)
|
|
234
239
|
|
|
240
|
+
# Store MCP metadata in context variable
|
|
241
|
+
final_request_params = self.get_request_params(request_params)
|
|
242
|
+
if final_request_params.mcp_metadata:
|
|
243
|
+
_mcp_metadata_var.set(final_request_params.mcp_metadata)
|
|
244
|
+
|
|
235
245
|
assistant_response: PromptMessageMultipart = await self._apply_prompt_provider_specific(
|
|
236
246
|
multipart_messages, request_params
|
|
237
247
|
)
|
|
@@ -275,6 +285,12 @@ class AugmentedLLM(ContextDependent, AugmentedLLMProtocol, Generic[MessageParamT
|
|
|
275
285
|
multipart_messages = PromptMessageMultipart.to_multipart(multipart_messages)
|
|
276
286
|
|
|
277
287
|
self._precall(multipart_messages)
|
|
288
|
+
|
|
289
|
+
# Store MCP metadata in context variable
|
|
290
|
+
final_request_params = self.get_request_params(request_params)
|
|
291
|
+
if final_request_params.mcp_metadata:
|
|
292
|
+
_mcp_metadata_var.set(final_request_params.mcp_metadata)
|
|
293
|
+
|
|
278
294
|
result, assistant_response = await self._apply_prompt_provider_specific_structured(
|
|
279
295
|
multipart_messages, model, request_params
|
|
280
296
|
)
|
|
@@ -69,6 +69,7 @@ class AnthropicAugmentedLLM(AugmentedLLM[MessageParam, Message]):
|
|
|
69
69
|
AugmentedLLM.PARAM_MAX_ITERATIONS,
|
|
70
70
|
AugmentedLLM.PARAM_PARALLEL_TOOL_CALLS,
|
|
71
71
|
AugmentedLLM.PARAM_TEMPLATE_VARS,
|
|
72
|
+
AugmentedLLM.PARAM_MCP_METADATA,
|
|
72
73
|
}
|
|
73
74
|
|
|
74
75
|
def __init__(self, *args, **kwargs) -> None:
|