fast-agent-mcp 0.2.0__py3-none-any.whl → 0.2.1__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.0
3
+ Version: 0.2.1
4
4
  Summary: Define, Prompt and Test MCP enabled Agents and Workflows
5
5
  Author-email: Shaun Smith <fastagent@llmindset.co.uk>, Sarmad Qadri <sarmad@lastmileai.dev>
6
6
  License: Apache License
@@ -22,7 +22,7 @@ mcp_agent/cli/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
22
22
  mcp_agent/cli/__main__.py,sha256=AVZ7tQFhU_sDOGuUGJq8ujgKtcxsYJBJwHbVaaiRDlI,166
23
23
  mcp_agent/cli/main.py,sha256=oumTbJPbiLFomm5IcdKJNjP3kXVkeYTxZEtYTkBBfLA,2742
24
24
  mcp_agent/cli/terminal.py,sha256=GRwD-RGW7saIz2IOWZn5vD6JjiArscELBThm1GTFkuI,1065
25
- mcp_agent/cli/commands/bootstrap.py,sha256=Dm_Fy8UhvLHCkSfV5e8G6NV5JiQrFPJqAfVPshr_-kY,10651
25
+ mcp_agent/cli/commands/bootstrap.py,sha256=Pv3LQUQLK_5-8nbOQ6iibJI7awgD04P9xh6-VpU15pw,11571
26
26
  mcp_agent/cli/commands/config.py,sha256=jU2gl4d5YESrdUboh3u6mxf7CxVT-_DT_sK8Vuh3ajw,231
27
27
  mcp_agent/cli/commands/setup.py,sha256=iXsKrf31Szv4Umbk9JfR5as9HcivFJchhE1KKzHxyIo,6345
28
28
  mcp_agent/core/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
@@ -101,6 +101,10 @@ mcp_agent/mcp/prompts/prompt_server.py,sha256=tXtQd4EnH86MmdAvHlXm4oOS1dWLSCW5Pv
101
101
  mcp_agent/mcp/prompts/prompt_template.py,sha256=EejiqGkau8OizORNyKTUwUjrPof5V-hH1H_MBQoQfXw,15732
102
102
  mcp_agent/mcp_server/__init__.py,sha256=zBU51ITHIEPScd9nRafnhEddsWqXRPAAvHhkrbRI2_4,155
103
103
  mcp_agent/mcp_server/agent_server.py,sha256=I3jh2izfiUSQFZzboEavtp8DJpkx3tuaeLqRReOTuiM,4491
104
+ mcp_agent/resources/examples/data-analysis/analysis-campaign.py,sha256=QdNdo0-7LR4Uzw61hEU_jVKmWyk6A9YpGo81kMwVobM,7267
105
+ mcp_agent/resources/examples/data-analysis/analysis.py,sha256=M9z8Q4YC5OGuqSa5uefYmmfmctqMn-WqCSfg5LI407o,2609
106
+ mcp_agent/resources/examples/data-analysis/fastagent.config.yaml,sha256=ini94PHyJCfgpjcjHKMMbGuHs6LIj46F1NwY0ll5HVk,1609
107
+ mcp_agent/resources/examples/data-analysis/mount-point/WA_Fn-UseC_-HR-Employee-Attrition.csv,sha256=pcMeOL1_r8m8MziE6xgbBrQbjl5Ijo98yycZn7O-dlk,227977
104
108
  mcp_agent/resources/examples/in_dev/agent_build.py,sha256=eetMEdYDbmnRH4CLO7chpQucAar3OE7iVzD_pnMjIGs,2854
105
109
  mcp_agent/resources/examples/in_dev/slides.py,sha256=-SEFeGIg9SLF253NIxmA0NjlanLe8CR1yjDBBp2LXgs,4904
106
110
  mcp_agent/resources/examples/internal/agent.py,sha256=RZOMb5cJzIY1k0V28YgrHcUFSt0Uy977towy4yJE7bA,502
@@ -115,9 +119,20 @@ mcp_agent/resources/examples/prompting/agent.py,sha256=yuONn6xkQfk6hjanC9j5_zsIK
115
119
  mcp_agent/resources/examples/prompting/fastagent.config.yaml,sha256=UR6LtCpeSIzkHsCrHJW1z-wE7AgmgKozS_IYcfcSAkc,1270
116
120
  mcp_agent/resources/examples/prompting/image_server.py,sha256=vRDRGi68BqTWcldZ4-sd8j41M3e5TtWIUSzIROK8uFo,1667
117
121
  mcp_agent/resources/examples/prompting/work_with_image.py,sha256=2MctSPXZsmIyCYvsxsRc1_v_8v0ZKorHH0gWZxLW8Tc,507
122
+ mcp_agent/resources/examples/researcher/fastagent.config.yaml,sha256=bNOnID9OgdSBTUEhdimKB8LjaZLa1B6igmp-nxx8nr4,2271
123
+ mcp_agent/resources/examples/researcher/researcher-eval.py,sha256=CR9m4lyoXijS1whvsBDuk6IA-RmNc6iOYbtloETkITY,1833
124
+ mcp_agent/resources/examples/researcher/researcher-imp.py,sha256=oJxSVnLbZfIn71QbQR1E6j_m_UBrOOGP4SVljXErHLQ,7879
125
+ mcp_agent/resources/examples/researcher/researcher.py,sha256=SZfExi-FfwYETzGt2O3caS3L5E6EemV3IUrJHyzZqHI,1333
126
+ mcp_agent/resources/examples/workflows/chaining.py,sha256=tY0kA0U8s2rceAO4ogZFtpQEkiUWcrYnYDgHu_-4G50,889
127
+ mcp_agent/resources/examples/workflows/evaluator.py,sha256=cQJCHLqzmzUZwrJoAYLpZv_C_LG26kAUWh3dKQPXtJA,3095
128
+ mcp_agent/resources/examples/workflows/fastagent.config.yaml,sha256=k2AiapOcK42uqG2nWDVvnSLqN4okQIQZK0FTbZufBpY,809
129
+ mcp_agent/resources/examples/workflows/human_input.py,sha256=_I6nS6xYo8IHAmvzsUYOxqVGb4G6BTyJXPAmS3fNcBU,621
130
+ mcp_agent/resources/examples/workflows/orchestrator.py,sha256=rOGilFTliWWnZ3Jx5wZOH6AQMBKwaGqSMI4PR9MKcZw,2507
131
+ mcp_agent/resources/examples/workflows/parallel.py,sha256=n0dFN26QvYd2wjgohcaUBflac2SzXYx-bCyxMSousJE,1884
132
+ mcp_agent/resources/examples/workflows/router.py,sha256=E4x_-c3l4YW9w1i4ARcDtkdeqIdbWEGfsMzwLYpdbVc,1677
118
133
  mcp_agent/ui/console_display.py,sha256=TVGDtJ37hc6UG0ei9g7ZPZZfFNeS1MYozt-Mx8HsPCk,9752
119
- fast_agent_mcp-0.2.0.dist-info/METADATA,sha256=nN7ojDC04t2YuU51qVbESNSNXuECopH6f5BxhmH2ghI,29647
120
- fast_agent_mcp-0.2.0.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
121
- fast_agent_mcp-0.2.0.dist-info/entry_points.txt,sha256=qPM7vwtN1_KmP3dXehxgiCxUBHtqP7yfenZigztvY-w,226
122
- fast_agent_mcp-0.2.0.dist-info/licenses/LICENSE,sha256=cN3FxDURL9XuzE5mhK9L2paZo82LTfjwCYVT7e3j0e4,10939
123
- fast_agent_mcp-0.2.0.dist-info/RECORD,,
134
+ fast_agent_mcp-0.2.1.dist-info/METADATA,sha256=aewQmossBC95xw0NPet8u2LUxcjqRdsjdU291wudXsY,29647
135
+ fast_agent_mcp-0.2.1.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
136
+ fast_agent_mcp-0.2.1.dist-info/entry_points.txt,sha256=qPM7vwtN1_KmP3dXehxgiCxUBHtqP7yfenZigztvY-w,226
137
+ fast_agent_mcp-0.2.1.dist-info/licenses/LICENSE,sha256=cN3FxDURL9XuzE5mhK9L2paZo82LTfjwCYVT7e3j0e4,10939
138
+ fast_agent_mcp-0.2.1.dist-info/RECORD,,
@@ -20,7 +20,6 @@ EXAMPLE_TYPES = {
20
20
  "'Building Effective Agents' paper. Some agents use the 'fetch'\n"
21
21
  "and filesystem MCP Servers.",
22
22
  "files": [
23
- "agent_build.py",
24
23
  "chaining.py",
25
24
  "evaluator.py",
26
25
  "human_input.py",
@@ -70,9 +69,33 @@ def copy_example_files(example_type: str, target_dir: Path, force: bool = False)
70
69
  mount_point_dir.mkdir(parents=True)
71
70
  console.print(f"Created mount-point directory: {mount_point_dir}")
72
71
 
73
- # Use examples from top-level directory
74
- package_dir = Path(__file__).parent.parent.parent.parent.parent
75
- source_dir = package_dir / "examples" / ("workflows" if example_type == "workflow" else f"{example_type}")
72
+ # Try to use examples from the installed package first, or fall back to the top-level directory
73
+ from importlib.resources import files
74
+
75
+ try:
76
+ # First try to find examples in the package resources
77
+ source_dir = (
78
+ files("mcp_agent")
79
+ .joinpath("resources")
80
+ .joinpath("examples")
81
+ .joinpath("workflows" if example_type == "workflow" else f"{example_type}")
82
+ )
83
+ if not source_dir.is_dir():
84
+ # Fall back to the top-level directory for development mode
85
+ package_dir = Path(__file__).parent.parent.parent.parent.parent
86
+ source_dir = (
87
+ package_dir
88
+ / "examples"
89
+ / ("workflows" if example_type == "workflow" else f"{example_type}")
90
+ )
91
+ except (ImportError, ModuleNotFoundError, ValueError):
92
+ # Fall back to the top-level directory if the resource finding fails
93
+ package_dir = Path(__file__).parent.parent.parent.parent.parent
94
+ source_dir = (
95
+ package_dir
96
+ / "examples"
97
+ / ("workflows" if example_type == "workflow" else f"{example_type}")
98
+ )
76
99
 
77
100
  if not source_dir.exists():
78
101
  console.print(f"[red]Error: Source directory not found: {source_dir}[/red]")
@@ -0,0 +1,188 @@
1
+ import asyncio
2
+
3
+ from mcp_agent.core.fastagent import FastAgent
4
+ from mcp_agent.llm.augmented_llm import RequestParams
5
+
6
+ # Create the application
7
+ fast = FastAgent("Data Analysis & Campaign Generator")
8
+
9
+
10
+ # Original data analysis components
11
+ @fast.agent(
12
+ name="data_analysis",
13
+ instruction="""
14
+ You have access to a Python 3.12 interpreter and you can use this to analyse and process data.
15
+ Common analysis packages such as Pandas, Seaborn and Matplotlib are already installed.
16
+ You can add further packages if needed.
17
+ Data files are accessible from the /mnt/data/ directory (this is the current working directory).
18
+ Visualisations should be saved as .png files in the current working directory.
19
+ Extract key insights that would be compelling for a social media campaign.
20
+ """,
21
+ servers=["interpreter"],
22
+ request_params=RequestParams(maxTokens=8192),
23
+ model="sonnet",
24
+ )
25
+ @fast.agent(
26
+ "evaluator",
27
+ """You are collaborating with a Data Analysis tool that has the capability to analyse data and produce visualisations.
28
+ You must make sure that the tool has:
29
+ - Considered the best way for a Human to interpret the data
30
+ - Produced insightful visualisations.
31
+ - Provided a high level summary report for the Human.
32
+ - Has had its findings challenged, and justified
33
+ - Extracted compelling insights suitable for social media promotion
34
+ """,
35
+ request_params=RequestParams(maxTokens=8192),
36
+ model="gpt-4o",
37
+ )
38
+ @fast.evaluator_optimizer(
39
+ "analysis_tool",
40
+ generator="data_analysis",
41
+ evaluator="evaluator",
42
+ max_refinements=3,
43
+ min_rating="EXCELLENT",
44
+ )
45
+ # Research component using Brave search
46
+ @fast.agent(
47
+ "context_researcher",
48
+ """You are a research specialist who provides cultural context for different regions.
49
+ For any given data insight and target language/region, research:
50
+ 1. Cultural sensitivities related to presenting this type of data
51
+ 2. Local social media trends and preferences
52
+ 3. Region-specific considerations for marketing campaigns
53
+
54
+ Always provide actionable recommendations for adapting content to each culture.
55
+ """,
56
+ servers=["fetch", "brave"], # Using the fetch MCP server for Brave search
57
+ request_params=RequestParams(temperature=0.3),
58
+ model="gpt-4o",
59
+ )
60
+ # Social media content generator
61
+ @fast.agent(
62
+ "campaign_generator",
63
+ """Generate engaging social media content based on data insights.
64
+ Create compelling, shareable content that:
65
+ - Highlights key research findings in an accessible way
66
+ - Uses appropriate tone for the platform (Twitter/X, LinkedIn, Instagram, etc.)
67
+ - Is concise and impactful
68
+ - Includes suggested hashtags and posting schedule
69
+
70
+ Format your response with clear sections for each platform.
71
+ Save different campaign elements as separate files in the current directory.
72
+ """,
73
+ servers=["filesystem"], # Using filesystem MCP server to save files
74
+ request_params=RequestParams(temperature=0.7),
75
+ model="sonnet",
76
+ use_history=False,
77
+ )
78
+ # Translation agents with cultural adaptation
79
+ @fast.agent(
80
+ "translate_fr",
81
+ """Translate social media content to French with cultural adaptation.
82
+ Consider French cultural norms, expressions, and social media preferences.
83
+ Ensure the translation maintains the impact of the original while being culturally appropriate.
84
+ Save the translated content to a file with appropriate naming.
85
+ """,
86
+ model="haiku",
87
+ use_history=False,
88
+ servers=["filesystem"],
89
+ )
90
+ @fast.agent(
91
+ "translate_es",
92
+ """Translate social media content to Spanish with cultural adaptation.
93
+ Consider Spanish-speaking cultural contexts, expressions, and social media preferences.
94
+ Ensure the translation maintains the impact of the original while being culturally appropriate.
95
+ Save the translated content to a file with appropriate naming.
96
+ """,
97
+ model="haiku",
98
+ use_history=False,
99
+ servers=["filesystem"],
100
+ )
101
+ @fast.agent(
102
+ "translate_de",
103
+ """Translate social media content to German with cultural adaptation.
104
+ Consider German cultural norms, expressions, and social media preferences.
105
+ Ensure the translation maintains the impact of the original while being culturally appropriate.
106
+ Save the translated content to a file with appropriate naming.
107
+ """,
108
+ model="haiku",
109
+ use_history=False,
110
+ servers=["filesystem"],
111
+ )
112
+ @fast.agent(
113
+ "translate_ja",
114
+ """Translate social media content to Japanese with cultural adaptation.
115
+ Consider Japanese cultural norms, expressions, and social media preferences.
116
+ Ensure the translation maintains the impact of the original while being culturally appropriate.
117
+ Save the translated content to a file with appropriate naming.
118
+ """,
119
+ model="haiku",
120
+ use_history=False,
121
+ servers=["filesystem"],
122
+ )
123
+ # Parallel workflow for translations
124
+ @fast.parallel(
125
+ "translate_campaign",
126
+ instruction="Translates content to French, Spanish, German and Japanese. Supply the content to translate, translations will be saved to the filesystem.",
127
+ fan_out=["translate_fr", "translate_es", "translate_de", "translate_ja"],
128
+ include_request=True,
129
+ )
130
+ # Cultural sensitivity review agent
131
+ @fast.agent(
132
+ "cultural_reviewer",
133
+ """Review all translated content for cultural sensitivity and appropriateness.
134
+ For each language version, evaluate:
135
+ - Cultural appropriateness
136
+ - Potential misunderstandings or sensitivities
137
+ - Effectiveness for the target culture
138
+
139
+ Provide specific recommendations for any needed adjustments and save a review report.
140
+ """,
141
+ servers=["filesystem"],
142
+ request_params=RequestParams(temperature=0.2),
143
+ )
144
+ # Campaign optimization workflow
145
+ @fast.evaluator_optimizer(
146
+ "campaign_optimizer",
147
+ generator="campaign_generator",
148
+ evaluator="cultural_reviewer",
149
+ max_refinements=2,
150
+ min_rating="EXCELLENT",
151
+ )
152
+ # Main workflow orchestration
153
+ @fast.orchestrator(
154
+ "research_campaign_creator",
155
+ instruction="""
156
+ Create a complete multi-lingual social media campaign based on data analysis results.
157
+ The workflow will:
158
+ 1. Analyze the provided data and extract key insights
159
+ 2. Research cultural contexts for target languages
160
+ 3. Generate appropriate social media content
161
+ 4. Translate and culturally adapt the content
162
+ 5. Review and optimize all materials
163
+ 6. Save all campaign elements to files
164
+ """,
165
+ agents=[
166
+ "analysis_tool",
167
+ "context_researcher",
168
+ "campaign_optimizer",
169
+ "translate_campaign",
170
+ ],
171
+ model="sonnet", # Using a more capable model for orchestration
172
+ request_params=RequestParams(maxTokens=8192),
173
+ plan_type="full",
174
+ )
175
+ async def main() -> None:
176
+ # Use the app's context manager
177
+ print(
178
+ "WARNING: This workflow will likely run for >10 minutes and consume a lot of tokens. Press Enter to accept the default prompt and proceed"
179
+ )
180
+
181
+ async with fast.run() as agent:
182
+ await agent.research_campaign_creator.prompt(
183
+ default_prompt="Analyze the CSV file in the current directory and create a comprehensive multi-lingual social media campaign based on the findings. Save all campaign elements as separate files."
184
+ )
185
+
186
+
187
+ if __name__ == "__main__":
188
+ asyncio.run(main())
@@ -0,0 +1,65 @@
1
+ import asyncio
2
+
3
+ from mcp_agent.core.fastagent import FastAgent
4
+ from mcp_agent.llm.augmented_llm import RequestParams
5
+
6
+ # Create the application
7
+ fast = FastAgent("Data Analysis (Roots)")
8
+
9
+
10
+ # The sample data is under Database Contents License (DbCL) v1.0.
11
+ # Available here : https://www.kaggle.com/datasets/pavansubhasht/ibm-hr-analytics-attrition-dataset
12
+
13
+
14
+ @fast.agent(
15
+ name="data_analysis",
16
+ instruction="""
17
+ You have access to a Python 3.12 interpreter and you can use this to analyse and process data.
18
+ Common analysis packages such as Pandas, Seaborn and Matplotlib are already installed.
19
+ You can add further packages if needed.
20
+ Data files are accessible from the /mnt/data/ directory (this is the current working directory).
21
+ Visualisations should be saved as .png files in the current working directory.
22
+ """,
23
+ servers=["interpreter"],
24
+ request_params=RequestParams(maxTokens=8192),
25
+ )
26
+ async def main() -> None:
27
+ # Use the app's context manager
28
+ async with fast.run() as agent:
29
+ await agent(
30
+ "There is a csv file in the current directory. "
31
+ "Analyse the file, produce a detailed description of the data, and any patterns it contains.",
32
+ )
33
+ await agent(
34
+ "Consider the data, and how to usefully group it for presentation to a Human. Find insights, using the Python Interpreter as needed.\n"
35
+ "Use MatPlotLib to produce insightful visualisations. Save them as '.png' files in the current directory. Be sure to run the code and save the files.\n"
36
+ "Produce a summary with major insights to the data",
37
+ )
38
+ await agent()
39
+
40
+
41
+ if __name__ == "__main__":
42
+ asyncio.run(main())
43
+
44
+
45
+ ############################################################################################################
46
+ # Example of evaluator/optimizer flow
47
+ ############################################################################################################
48
+ # @fast.agent(
49
+ # "evaluator",
50
+ # """You are collaborating with a Data Analysis tool that has the capability to analyse data and produce visualisations.
51
+ # You must make sure that the tool has:
52
+ # - Considered the best way for a Human to interpret the data
53
+ # - Produced insightful visualasions.
54
+ # - Provided a high level summary report for the Human.
55
+ # - Has had its findings challenged, and justified
56
+ # """,
57
+ # request_params=RequestParams(maxTokens=8192),
58
+ # )
59
+ # @fast.evaluator_optimizer(
60
+ # "analysis_tool",
61
+ # generator="data_analysis",
62
+ # evaluator="evaluator",
63
+ # max_refinements=3,
64
+ # min_rating="EXCELLENT",
65
+ # )
@@ -0,0 +1,41 @@
1
+ default_model: sonnet
2
+
3
+ # on windows, adjust the mount point to be the full path e.g. x:/temp/data-analysis/mount-point:/mnt/data/
4
+
5
+ mcp:
6
+ servers:
7
+ interpreter:
8
+ command: "docker"
9
+ args:
10
+ [
11
+ "run",
12
+ "-i",
13
+ "--rm",
14
+ "--pull=always",
15
+ "-v",
16
+ "./mount-point:/mnt/data/",
17
+ "ghcr.io/evalstate/mcp-py-repl:latest",
18
+ ]
19
+ roots:
20
+ - uri: "file://./mount-point/"
21
+ name: "test_data"
22
+ server_uri_alias: "file:///mnt/data/"
23
+ filesystem:
24
+ # On windows update the command and arguments to use `node` and the absolute path to the server.
25
+ # Use `npm i -g @modelcontextprotocol/server-filesystem` to install the server globally.
26
+ # Use `npm -g root` to find the global node_modules path.`
27
+ # command: "node"
28
+ # args: ["c:/Program Files/nodejs/node_modules/@modelcontextprotocol/server-filesystem/dist/index.js","."]
29
+ command: "npx"
30
+ args: ["-y", "@modelcontextprotocol/server-filesystem", "./mount-point/"]
31
+ fetch:
32
+ command: "uvx"
33
+ args: ["mcp-server-fetch"]
34
+ brave:
35
+ # On windows replace the command and args line to use `node` and the absolute path to the server.
36
+ # Use `npm i -g @modelcontextprotocol/server-brave-search` to install the server globally.
37
+ # Use `npm -g root` to find the global node_modules path.`
38
+ # command: "node"
39
+ # args: ["c:/Program Files/nodejs/node_modules/@modelcontextprotocol/server-brave-search/dist/index.js"]
40
+ command: "npx"
41
+ args: ["-y", "@modelcontextprotocol/server-brave-search"]