Skip to content

Commit 9f6bf56

Browse files
committed
feat(mcp-server-filesystem): Add FastAgent integration and configuration files for filesystem interaction
1 parent 59db6d9 commit 9f6bf56

File tree

5 files changed

+89
-1
lines changed

5 files changed

+89
-1
lines changed

.editorconfig

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,4 +9,7 @@ trim_trailing_whitespace = true
99

1010
[*.{java,xml}]
1111
indent_size = 4
12-
ij_java_continuation_indent_size = 4
12+
ij_java_continuation_indent_size = 4
13+
14+
[*.yaml]
15+
indent_size = 2

.gitignore

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,3 +8,8 @@
88
# Maven build files
99
target/
1010
dependency-reduced-pom.xml
11+
12+
# FastAgent files
13+
fastagent.secrets.yaml
14+
fastagent.config.yaml
15+
fastagent.jsonl
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
import asyncio
2+
3+
from mcp_agent.core.fastagent import FastAgent
4+
5+
# Create the application
6+
fast = FastAgent("FastAgent for MCP Server Filesystem")
7+
8+
9+
# Define the agent
10+
@fast.agent(
11+
name="mcp-server-filesystem",
12+
instruction="""You are a helpful AI Agent that is able to interact with users
13+
and to call the resources, prompts, tools of the MCP server named filesystem.
14+
""",
15+
servers=["filesystem"]
16+
)
17+
async def main():
18+
# use the --model command line switch or agent arguments to change model
19+
async with fast.run() as agent:
20+
await agent.interactive()
21+
22+
23+
if __name__ == "__main__":
24+
asyncio.run(main())
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
# FastAgent Configuration File
2+
3+
# Default Model Configuration:
4+
#
5+
# Takes format:
6+
# <provider>.<model_string>.<reasoning_effort?> (e.g. anthropic.claude-3-5-sonnet-20241022 or openai.o3-mini.low)
7+
# Accepts aliases for Anthropic Models: haiku, haiku3, sonnet, sonnet35, opus, opus3
8+
# and OpenAI Models: gpt-4o-mini, gpt-4o, o1, o1-mini, o3-mini
9+
#
10+
# If not specified, defaults to "haiku".
11+
# Can be override with a command line switch --model=<model>, or within the Agent constructor.
12+
13+
default_model: deepseek
14+
15+
# Logging and Console Configuration:
16+
logger:
17+
# level: "debug" | "info" | "warning" | "error"
18+
# type: "none" | "console" | "file" | "http"
19+
# path: "/path/to/logfile.json"
20+
21+
22+
# Switch the progress display on or off
23+
progress_display: true
24+
25+
# Show chat User/Assistant messages on the console
26+
show_chat: true
27+
# Show tool calls on the console
28+
show_tools: true
29+
# Truncate long tool responses on the console
30+
truncate_tools: true
31+
32+
# MCP Servers
33+
mcp:
34+
servers:
35+
filesystem:
36+
command: "java"
37+
# Note: the path separator might be different on Windows
38+
args: [ "-jar", "../target/mcp-server-filesystem.jar" ]
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
# FastAgent Secrets Configuration
2+
# WARNING: Keep this file secure and never commit to version control
3+
4+
# Alternatively set OPENAI_API_KEY and ANTHROPIC_API_KEY environment variables. Config file takes precedence.
5+
6+
openai:
7+
api_key: <your-api-key-here>
8+
anthropic:
9+
api_key: <your-api-key-here>
10+
deepseek:
11+
api_key: <your-api-key-here>
12+
13+
# Example of setting an MCP Server environment variable
14+
mcp:
15+
servers:
16+
filesystem:
17+
env:
18+
YOUR_ENV_KEY: <your-env-value>

0 commit comments

Comments
 (0)