Spaces:
Configuration error
Configuration error
Project Structure
Overview
AMCP follows Python best practices with a clear separation of concerns:
AMCP/
βββ src/amcp/ # Main package source code
β βββ __init__.py # Package initialization
β βββ __main__.py # Entry point for python -m amcp
β βββ cli.py # CLI interface (Typer)
β βββ agent.py # Agent orchestration logic
β βββ agent_spec.py # Agent specification handling
β βββ tools.py # Built-in tools (read, grep, bash, etc.)
β βββ config.py # Configuration management
β βββ mcp_client.py # MCP server integration
β βββ chat.py # Chat/LLM interaction
β βββ readfile.py # File reading utilities
β
βββ tests/ # Test suite
β βββ __init__.py
β βββ conftest.py # Pytest fixtures
β βββ test_agent_spec.py
β βββ test_config.py
β βββ test_tools.py
β
βββ .github/
β βββ workflows/
β βββ ci.yml # GitHub Actions CI/CD
β
βββ docs/ # Documentation
β βββ PROJECT_STRUCTURE.md
β
βββ pyproject.toml # Project metadata & dependencies
βββ pytest.ini # Pytest configuration
βββ Makefile # Common development tasks
βββ .pre-commit-config.yaml # Pre-commit hooks
βββ .ruff.toml # Ruff linter configuration
βββ .gitignore
βββ README.md
βββ CONTRIBUTING.md
βββ CHANGELOG.md
βββ Dockerfile
Key Design Decisions
1. Source Layout (src/ layout)
- Prevents accidental imports of uninstalled code
- Clear separation between source and tests
- Recommended by PyPA
2. Testing
- Uses pytest for testing framework
- Fixtures in
conftest.pyfor reusability - Coverage reporting with pytest-cov
- Target: >80% code coverage
3. Code Quality
- Ruff for linting and formatting
- Type hints encouraged (mypy for type checking)
- Pre-commit hooks for automated checks
4. CI/CD
- GitHub Actions for automated testing
- Matrix testing across Python 3.11, 3.12, 3.13
- Automated coverage reporting
5. Configuration
- pyproject.toml as single source of truth
- Tool configurations centralized
- Optional dependencies for development
Development Workflow
- Setup:
make installorpip install -e ".[dev]" - Test:
make testorpytest - Lint:
make lintorruff check src/ tests/ - Format:
make formatorruff format src/ tests/ - Coverage:
make test-cov
Module Responsibilities
- cli.py: Command-line interface, argument parsing
- agent.py: Core agent logic, tool orchestration
- tools.py: Built-in tool implementations
- config.py: Configuration loading/saving
- mcp_client.py: MCP protocol communication
- chat.py: LLM interaction, streaming responses