- Language/Version: Python 3.10+
- Core Libraries:
agent-utilities,fastmcp,pydantic-ai - Key principles: Functional patterns, Pydantic for data validation, asynchronous tool execution.
- Architecture:
mcp.py: Main MCP server entry point and tool registration.agent.py: Pydantic AI agent definition and logic.skills/: Directory containing modular agent skills (if applicable).agent/: Internal agent logic and prompt templates.
graph TD
User([User/A2A]) --> Server[A2A Server / FastAPI]
Server --> Agent[Pydantic AI Agent]
Agent --> Skills[Modular Skills]
Agent --> MCP[MCP Server / FastMCP]
MCP --> Client[API Client / Wrapper]
Client --> ExternalAPI([External Service API])
sequenceDiagram
participant U as User
participant S as Server
participant A as Agent
participant T as MCP Tool
participant API as External API
U->>S: Request
S->>A: Process Query
A->>T: Invoke Tool
T->>API: API Request
API-->>T: API Response
T-->>A: Tool Result
A-->>S: Final Response
S-->>U: Output
pip install .[all]
pre-commit run --all-files
- MCP Entry Point →
mcp.py - Agent Entry Point →
agent.py - Source Code →
github_agent/ - Skills →
skills/(if exists)
├── .bumpversion.cfg\n├── .dockerignore\n├── .env\n├── .gitattributes\n├── .github\n│ └── workflows\n│ └── pipeline.yml\n├── .gitignore\n├── .pre-commit-config.yaml\n├── AGENTS.md\n├── Dockerfile\n├── LICENSE\n├── README.md\n├── compose.yml\n├── debug.Dockerfile\n├── github_agent\n│ ├── __init__.py\n│ ├── agent\n│ │ ├── AGENTS.md\n│ │ ├── CRON.md\n│ │ ├── HEARTBEAT.md\n│ │ ├── IDENTITY.md\n│ │ ├── MEMORY.md\n│ │ ├── USER.md\n│ │ └── templates.py\n│ └── agent.py\n├── mcp.compose.yml\n├── pyproject.toml\n├── requirements.txt\n└── scripts\n └── validate_a2a_agent.py
Always:
- Use
agent-utilitiesfor common patterns (e.g.,create_mcp_server,create_agent). - Define input/output models using Pydantic.
- Include descriptive docstrings for all tools (they are used as tool descriptions for LLMs).
- Check for optional dependencies using
try/except ImportError.
Good example:
from agent_utilities import create_mcp_server
from mcp.server.fastmcp import FastMCP
mcp = create_mcp_server("my-agent")
@mcp.tool()
async def my_tool(param: str) -> str:
"""Description for LLM."""
return f"Result: {param}"Do:
- Run
pre-commitbefore pushing changes. - Use existing patterns from
agent-utilities. - Keep tools focused and idempotent where possible.
Don't:
- Use
cdcommands in scripts; use absolute paths or relative to project root. - Add new dependencies to
dependenciesinpyproject.tomlwithout checkingoptional-dependenciesfirst. - Hardcode secrets; use environment variables or
.envfiles.
Always do:
- Run lint/test via
pre-commit. - Use
agent-utilitiesbase classes.
Ask first:
- Major refactors of
mcp.pyoragent.py. - Deleting or renaming public tool functions.
Never do:
- Commit
.envfiles or secrets. - Modify
agent-utilitiesoruniversal-skillsfiles from within this package.
- Propose a plan first before making large changes.
- Check
agent-utilitiesdocumentation for existing helpers.