# Clone and install
git clone https://github.com/ali-kamali/Axon.MCP.Server.git
cd axon.mcp.server
make dev-install
# Install pre-commit hooks
pre-commit install
This project follows strict coding standards:
snake_case for functions/variables, PascalCase for classessnake_case for CSS class names# Development
make dev-install # Install development dependencies
make format # Format code with black and isort
make lint # Run linters (flake8, mypy, pylint)
make test # Run tests with coverage
# Database
make migrate # Run database migrations
make seed # Seed test data
# Docker
make docker-up # Start all services
make docker-down # Stop all services
# Cleanup
make clean # Clean cache and build files
# Run all tests with coverage
make test
# Run specific test suite
pytest tests/unit/test_parsers.py -v
# Run tests with specific marker
pytest -m integration
# Run tests in parallel
pytest -n auto
# Generate coverage report
pytest --cov=src --cov-report=html --cov-report=term
# View HTML report
open htmlcov/index.html
To add a new tool for AI assistants (e.g., analyze_complexity):
src/mcp_server/server.py (or delegate to a service).
async def _analyze_complexity(self, repository_id: int, file_path: str) -> str:
# Implementation logic
return "Complexity analysis result"
list_tools function in src/mcp_server/server.py.
Tool(
name="analyze_complexity",
description="Analyze the cyclomatic complexity of a file",
inputSchema={
"type": "object",
"properties": {
"repository_id": {"type": "integer"},
"file_path": {"type": "string"}
},
"required": ["repository_id", "file_path"]
}
)
call_tool function in src/mcp_server/server.py to handle the new tool name.
elif name == "analyze_complexity":
return await _analyze_complexity(...)
docs/api/mcp_tools.md.To add a new REST endpoint (e.g., GET /api/v1/stats):
src/api/routes/stats.py.
from fastapi import APIRouter
router = APIRouter()
@router.get("/stats")
async def get_stats():
return {"status": "ok"}
src/api/main.py.
from src.api.routes.stats import router as stats_router
app.include_router(stats_router, prefix="/api/v1", tags=["Stats"])
To support a new language (e.g., Python):
src/parsers/python_parser.py inheriting from BaseParser.
from src.parsers.base_parser import BaseParser
class PythonParser(BaseParser):
def parse(self, file_path: str, content: str):
# Tree-sitter parsing logic
pass
src/extractors/knowledge_extractor.py to instantiate PythonParser for .py files.