Skip to content
This repository was archived by the owner on Jan 25, 2026. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .github/scripts/list-projects.sh
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,11 @@ changed_projects=""

while IFS= read -r project; do
if [ -n "$project" ]; then
# Skip the root project (namespace package only)
if [ "$project" = "." ]; then
continue
fi

# If --changed-only flag is set, check if project has changed
if [ "$CHANGED_ONLY" = true ]; then
if ! git diff --name-only HEAD~1 HEAD | grep -q "^${project#./}/"; then
Expand Down
12 changes: 12 additions & 0 deletions .github/workflows/on-pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,18 @@ jobs:
run: uv build
working-directory: ${{ matrix.pyproject }}

- name: Ruff Format
run: uv run ruff format --check .
working-directory: ${{ matrix.pyproject }}

- name: Ruff Check
run: uv run ruff check .
working-directory: ${{ matrix.pyproject }}

- name: Type Check
run: uv run basedpyright .
working-directory: ${{ matrix.pyproject }}

- name: Test
run: uv run pytest -m "not skip_on_ci" -v tests/
working-directory: ${{ matrix.pyproject }}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[project]
name = "fastmcp-agents-bridge-pydantic-ai"
version = "0.1.4"
version = "0.5.9"
description = "Pydantic AI Agent Bridge"
readme = "README.md"
requires-python = ">=3.13"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,15 +1,13 @@
from pathlib import Path
from typing import TYPE_CHECKING

import pytest
from fastmcp import FastMCP
from fastmcp.mcp_config import MCPConfig, TransformingStdioMCPServer
from pydantic_ai import Agent, RunContext
from pydantic_ai import Agent
from pydantic_ai.models.google import GoogleModel
from pydantic_ai.providers.google import GoogleProvider
from pydantic_ai.toolsets import AbstractToolset

from fastmcp_agents.bridge.pydantic_ai.toolset import DynamicToolset, FastMCPServerToolset
from fastmcp_agents.bridge.pydantic_ai.toolset import FastMCPServerToolset

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

result = await agent.run("What tools do you have available? Please test all of the tools to make sure they work.")
print(result.output)


# async def test_agent_with_bridge_customize(model: GoogleModel):
# mcp_config = MCPConfig(
# mcpServers={
# "echo": TransformingStdioMCPServer(
# command="uvx",
# args=["mcp-server-time"],
# tools={},
# ),
# },
# )

# async def prepare_mcp_config(ctx: RunContext[Path]) -> AbstractToolset[Path]:
# return FastMCPServerToolset[Path].from_mcp_config(mcp_config=mcp_config)

# dynamic_toolset: DynamicToolset[Path] = DynamicToolset[Path](build_toolset_fn=prepare_mcp_config)

# agent = Agent[Path, str](
# model,
# system_prompt="Be concise, reply with one sentence.",
# toolsets=[dynamic_toolset],
# deps_type=Path,
# output_type=str,
# )

# async with agent:
# result = await agent.run(
# deps=Path(), user_prompt="What tools do you have available? Please test all of the tools to make sure they work."
# )
# print(result.output)

# async with agent:
# result = await agent.run(
# deps=Path(), user_prompt="What tools do you have available? Please test all of the tools to make sure they work."
# )
# print(result.output)
# print(dynamic_toolset.toolset.toolsets)
2 changes: 1 addition & 1 deletion fastmcp-agents-cli/pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[project]
name = "fastmcp-agents-cli"
version = "0.5.8"
version = "0.5.9"
description = "CLI for running FastMCP and calling tools on it"
readme = "README.md"
requires-python = ">=3.13"
Expand Down
31 changes: 26 additions & 5 deletions fastmcp-agents-cli/tests/test_cli.py
Original file line number Diff line number Diff line change
@@ -1,21 +1,42 @@
import json
import tempfile
from collections.abc import AsyncGenerator
from pathlib import Path
from typing import Any

import pytest

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


@pytest.fixture
async def test_directory() -> AsyncGenerator[Path, Any]:
with tempfile.TemporaryDirectory() as temp_dir:
config_json = Path(temp_dir) / "config.json"
config_json.write_text(
json.dumps({"mcpServers": {"filesystem": {"command": "uvx", "args": ["filesystem-operations-mcp", "--root-dir", temp_dir]}}})
)

subdir = Path(temp_dir) / "subdir"
subdir.mkdir()

random_file = subdir / "random_file.txt"
random_file.write_text("Hello, world!")

yield Path(temp_dir)


@pytest.mark.asyncio
async def test_app():
assert app


@pytest.mark.asyncio
async def test_tool_call():
result = await call_tool(config=Path("config.json"), tool="get_structure", args='{"depth": 3}')
async def test_tool_call(test_directory: Path):
result = await call_tool(config=test_directory / "config.json", tool="get_structure", args='{"depth": 3}')

assert "src/fastmcp_agents/cli" in str(result.data)
assert "subdir" in str(result.data)


async def test_list_tools():
await list_tools(config=Path("config.json"))
async def test_list_tools(test_directory: Path):
await list_tools(config=test_directory / "config.json")

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

Loading