Skip to content
This repository was archived by the owner on Jan 25, 2026. It is now read-only.

Commit 4c5df32

Browse files
authored
Merge pull request #53 from strawgate/pydantic-fork
Refactor existing Agents into the Library
2 parents 3bba45f + 68a5e4a commit 4c5df32

File tree

60 files changed

+538
-4874
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

60 files changed

+538
-4874
lines changed

.github/scripts/list-projects.sh

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,11 @@ changed_projects=""
2929

3030
while IFS= read -r project; do
3131
if [ -n "$project" ]; then
32+
# Skip the root project (namespace package only)
33+
if [ "$project" = "." ]; then
34+
continue
35+
fi
36+
3237
# If --changed-only flag is set, check if project has changed
3338
if [ "$CHANGED_ONLY" = true ]; then
3439
if ! git diff --name-only HEAD~1 HEAD | grep -q "^${project#./}/"; then

.github/workflows/on-pr.yml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,18 @@ jobs:
4444
run: uv build
4545
working-directory: ${{ matrix.pyproject }}
4646

47+
- name: Ruff Format
48+
run: uv run ruff format --check .
49+
working-directory: ${{ matrix.pyproject }}
50+
51+
- name: Ruff Check
52+
run: uv run ruff check .
53+
working-directory: ${{ matrix.pyproject }}
54+
55+
- name: Type Check
56+
run: uv run basedpyright .
57+
working-directory: ${{ matrix.pyproject }}
58+
4759
- name: Test
4860
run: uv run pytest -m "not skip_on_ci" -v tests/
4961
working-directory: ${{ matrix.pyproject }}

fastmcp-agents-bridge/fastmcp_agents_bridge_pydantic_ai/pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[project]
22
name = "fastmcp-agents-bridge-pydantic-ai"
3-
version = "0.1.4"
3+
version = "0.5.9"
44
description = "Pydantic AI Agent Bridge"
55
readme = "README.md"
66
requires-python = ">=3.13"
Lines changed: 2 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,13 @@
1-
from pathlib import Path
21
from typing import TYPE_CHECKING
32

43
import pytest
54
from fastmcp import FastMCP
65
from fastmcp.mcp_config import MCPConfig, TransformingStdioMCPServer
7-
from pydantic_ai import Agent, RunContext
6+
from pydantic_ai import Agent
87
from pydantic_ai.models.google import GoogleModel
98
from pydantic_ai.providers.google import GoogleProvider
10-
from pydantic_ai.toolsets import AbstractToolset
119

12-
from fastmcp_agents.bridge.pydantic_ai.toolset import DynamicToolset, FastMCPServerToolset
10+
from fastmcp_agents.bridge.pydantic_ai.toolset import FastMCPServerToolset
1311

1412
if TYPE_CHECKING:
1513
from fastmcp.server.proxy import FastMCPProxy
@@ -59,41 +57,3 @@ async def test_agent_with_bridge(model: GoogleModel):
5957

6058
result = await agent.run("What tools do you have available? Please test all of the tools to make sure they work.")
6159
print(result.output)
62-
63-
64-
# async def test_agent_with_bridge_customize(model: GoogleModel):
65-
# mcp_config = MCPConfig(
66-
# mcpServers={
67-
# "echo": TransformingStdioMCPServer(
68-
# command="uvx",
69-
# args=["mcp-server-time"],
70-
# tools={},
71-
# ),
72-
# },
73-
# )
74-
75-
# async def prepare_mcp_config(ctx: RunContext[Path]) -> AbstractToolset[Path]:
76-
# return FastMCPServerToolset[Path].from_mcp_config(mcp_config=mcp_config)
77-
78-
# dynamic_toolset: DynamicToolset[Path] = DynamicToolset[Path](build_toolset_fn=prepare_mcp_config)
79-
80-
# agent = Agent[Path, str](
81-
# model,
82-
# system_prompt="Be concise, reply with one sentence.",
83-
# toolsets=[dynamic_toolset],
84-
# deps_type=Path,
85-
# output_type=str,
86-
# )
87-
88-
# async with agent:
89-
# result = await agent.run(
90-
# deps=Path(), user_prompt="What tools do you have available? Please test all of the tools to make sure they work."
91-
# )
92-
# print(result.output)
93-
94-
# async with agent:
95-
# result = await agent.run(
96-
# deps=Path(), user_prompt="What tools do you have available? Please test all of the tools to make sure they work."
97-
# )
98-
# print(result.output)
99-
# print(dynamic_toolset.toolset.toolsets)

fastmcp-agents-cli/pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[project]
22
name = "fastmcp-agents-cli"
3-
version = "0.5.8"
3+
version = "0.5.9"
44
description = "CLI for running FastMCP and calling tools on it"
55
readme = "README.md"
66
requires-python = ">=3.13"
Lines changed: 26 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,42 @@
1+
import json
2+
import tempfile
3+
from collections.abc import AsyncGenerator
14
from pathlib import Path
5+
from typing import Any
26

37
import pytest
48

59
from fastmcp_agents.cli.main import app, call_tool, list_tools
610

711

12+
@pytest.fixture
13+
async def test_directory() -> AsyncGenerator[Path, Any]:
14+
with tempfile.TemporaryDirectory() as temp_dir:
15+
config_json = Path(temp_dir) / "config.json"
16+
config_json.write_text(
17+
json.dumps({"mcpServers": {"filesystem": {"command": "uvx", "args": ["filesystem-operations-mcp", "--root-dir", temp_dir]}}})
18+
)
19+
20+
subdir = Path(temp_dir) / "subdir"
21+
subdir.mkdir()
22+
23+
random_file = subdir / "random_file.txt"
24+
random_file.write_text("Hello, world!")
25+
26+
yield Path(temp_dir)
27+
28+
829
@pytest.mark.asyncio
930
async def test_app():
1031
assert app
1132

1233

1334
@pytest.mark.asyncio
14-
async def test_tool_call():
15-
result = await call_tool(config=Path("config.json"), tool="get_structure", args='{"depth": 3}')
35+
async def test_tool_call(test_directory: Path):
36+
result = await call_tool(config=test_directory / "config.json", tool="get_structure", args='{"depth": 3}')
1637

17-
assert "src/fastmcp_agents/cli" in str(result.data)
38+
assert "subdir" in str(result.data)
1839

1940

20-
async def test_list_tools():
21-
await list_tools(config=Path("config.json"))
41+
async def test_list_tools(test_directory: Path):
42+
await list_tools(config=test_directory / "config.json")

fastmcp-agents-library/agents/fastmcp-agents-library-agent-documentation-maintainer/.gitignore

Lines changed: 0 additions & 2 deletions
This file was deleted.

fastmcp-agents-library/agents/fastmcp-agents-library-agent-documentation-maintainer/.vscode/launch.json

Lines changed: 0 additions & 18 deletions
This file was deleted.

fastmcp-agents-library/agents/fastmcp-agents-library-agent-documentation-maintainer/.vscode/settings.json

Lines changed: 0 additions & 5 deletions
This file was deleted.

fastmcp-agents-library/agents/fastmcp-agents-library-agent-documentation-maintainer/README.md

Lines changed: 0 additions & 1 deletion
This file was deleted.

0 commit comments

Comments
 (0)