mcp-fair-shake
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@mcp-fair-shake what are my deadlines for lodging an unfair dismissal claim in Victoria?"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
mcp-fair-shake
Etymology
"Fair Shake of the Sauce Bottle mate"
-- Kevin Rudd, 2006
Related MCP server: AusLaw MCP
Mission
Empowering employees with timely, grounded, and factual Australian workplace legislation and support pathways.
The How
A Model Context Protocol (MCP) server providing authoritative access to Australian workplace legislation. Built with Python using FastMCP, following best practices from trusted MCPs like Context7, arXiv, and Sequential Thinking.
What is MCP?
The Model Context Protocol is a standard way to connect AI assistants to external tools and data sources. This server implements MCP to provide Australian workplace legislation lookup to AI assistants like Claude Code and Claude Desktop.
Project Status
✅ Completed Phases (4/10 complete)
Phase 1: Core Infrastructure
MCP tools:
resolve-legislation,get-legislation-content,get-cache-statusLocal-first caching with SHA256 integrity verification
CLI admin mode for cache management and pre-caching
Phase 2.5: Fine-Grained Extraction
Pydantic models for hierarchical legislation structure (Act → Part → Division → Section → Subsection → Paragraph)
Federal and Victorian text parsers with state machine parsing
11,882 nodes extracted across 8 Acts (365x more granular than manual graph)
D3.js force-directed graph visualization with hierarchical relationships
Phase 3: Support Pathways
get-supporttool for employee support agency lookupDeadline tracking with urgency indicators (21 days for unfair dismissal)
Victorian and federal support pathways (Fair Work Commission, WorkSafe Victoria, etc.)
Phase 4: Federal Coverage
Fair Work Act 2009, Fair Work Regulations 2009
Top 10 Modern Awards by employee coverage
Federal/state jurisdiction filtering
📍 Remaining Phases (6/10)
Phase 5: Hierarchical Summaries
Recursive bottom-up summarization of legislation graph (map tile pyramid pattern: leaf nodes → parents → root)
Phase 6: Advanced Data & Search
Phase 6.1: DuckDB integration for efficient querying
Phase 6.2: Leaf node embeddings + TF-IDF for content-based search
Phase 6.3: Node2Vec embeddings + DRIFT hierarchical knowledge graph algorithm
Phase 6.4: Advanced search/filter UI
Phase 7: Conversational Breach Test Cases Generator
100% compliant scenarios: Surface legislation, interpret as "No Non-Compliance detected"
0% compliant scenarios: Blatant breaches surface legislation with "Non-compliance potentially detected"
50% compliant scenarios: Boundary cases that test interpretation edge cases
Phase 8: Live Audio Transcription
Google ADK live streaming APIs with Gemini integration for real-time workplace conversation analysis
Phase 9: GitHub Pages WebApp
Interactive legislation exploration interface deployed via GitHub Pages
Phase 10: National Coverage
All Australian states and territories (NSW, QLD, SA, WA, TAS, NT, ACT)
Current Legislation Coverage
Federal: Fair Work Act 2009, Fair Work Regulations 2009, 10 Modern Awards
Victorian: OHS Act 2004, Equal Opportunity Act 2010, Long Service Leave Act 2018, Workers Compensation Act 1958, Accident Compensation Act 1985
Testing & Quality
111 tests passing, 82.75% coverage, zero mocks, full type safety with mypy strict mode
Installation
From GitHub (Recommended)
Install and run directly from the GitHub repository using uvx:
uvx --from git+https://github.com/neozenith/mcp-fair-shake mcp-fair-shakeLocal Development
Clone the repository and set up for development:
git clone https://github.com/neozenith/mcp-fair-shake.git
cd mcp-fair-shake
make init # Installs dependencies and sets up the environmentUsage
Running the Server
The MCP server runs via stdio (standard input/output) for communication with MCP clients:
# Using uvx
uvx --from git+https://github.com/neozenith/mcp-fair-shake mcp-fair-shake
# Local development
uv run mcp-fair-shakeIntegrating with Claude Desktop
Add to your Claude Desktop configuration (~/Library/Application Support/Claude/claude_desktop_config.json on macOS):
{
"mcpServers": {
"mcp-fair-shake": {
"command": "uvx",
"args": [
"--from",
"git+https://github.com/neozenith/mcp-fair-shake",
"mcp-fair-shake"
]
}
}
}For local development:
{
"mcpServers": {
"mcp-fair-shake": {
"command": "uv",
"args": [
"--directory",
"/path/to/mcp-fair-shake",
"run",
"mcp-fair-shake"
]
}
}
}Available Tools
resolve-legislation
Resolve natural language queries or citations to canonical legislation IDs.
Parameters:
query(string, required): Natural language query or citation (e.g., "unfair dismissal", "OHS Act s.21")jurisdiction(string, optional): Filter by jurisdiction (e.g., "au-victoria", "au-federal")
Example:
{
"query": "unfair dismissal",
"jurisdiction": "au-federal"
}Returns: Ranked matches with canonical IDs, titles, and cache status.
get-legislation-content
Retrieve legislation content from cache or download if needed. Supports both HTML (federal) and PDF (Victorian, Modern Awards) sources.
Parameters:
canonical_id(string, required): Canonical legislation IDFederal Acts:
/au-federal/fwa/2009Modern Awards:
/au-federal/ma/000004Victorian Acts:
/au-victoria/ohs/2004
mode(string, optional): Content mode - "text", "summary", or "metadata"section(string, optional): Optional section filter (e.g., "s21")
Example:
{
"canonical_id": "/au-federal/ma/000004",
"mode": "text"
}Returns: Legislation content with metadata, including page markers for PDF sources.
get-support
Find support agencies and resolution pathways for workplace issues.
Parameters:
scenario(string, required): Workplace issue description (e.g., "unfair dismissal", "wage theft", "discrimination")jurisdiction(string, optional): Filter by jurisdiction (e.g., "au-victoria", "au-federal")
Example:
{
"scenario": "unfair dismissal",
"jurisdiction": "au-federal"
}Returns: Support agencies, contact information, deadlines, and step-by-step guidance.
get-cache-status
Get cache coverage, size, and missing items.
Parameters: None
Returns: JSON with cache statistics including coverage, total size, and cached items.
CLI Admin Mode
Pre-cache legislation and manage the cache:
# Check cache status
mcp-fair-shake status
# Pre-cache P0 legislation (MVP)
mcp-fair-shake cache --priority P0
# Pre-cache all configured legislation
mcp-fair-shake cache --priority all
# Force re-download
mcp-fair-shake cache --priority P0 --force
# Verify cache integrity
mcp-fair-shake verifyDevelopment
Setup
make init # Initialize project and dependencies
make check # Run all quality checks (format, lint, type check, tests)
make fix # Auto-fix formatting and linting issuesTesting
The project uses pytest with comprehensive test coverage:
# Run all tests
uv run pytest
# Run with coverage
uv run pytest --cov
# Run specific test file
uv run pytest tests/test_server.py
# Run specific test
uv run pytest tests/test_tools.py::test_evaluate_tool_basic -vTesting Architecture:
NO MOCKS POLICY - All tests use real HTTP requests and actual data
Uses FastMCP's in-memory testing client for clean, fast tests
Integration tests verify end-to-end functionality with real legislation sources
PDF and HTML parsing tested with actual government documents
Zero subprocess overhead or async teardown issues
Parametrized tests cover multiple scenarios
111 tests, 82.75% coverage, all passing with no errors or warnings
Code Quality
# Format code
uv run ruff format .
# Lint code
uv run ruff check . --fix
# Type check
uv run mypy .
# All quality checks
make checkProject Structure
mcp-fair-shake/
├── src/mcp_fair_shake/ # Main package
│ ├── __init__.py # Package exports
│ ├── server.py # MCP server with three tools
│ ├── canonical_id.py # Canonical ID parser/validator
│ ├── cache.py # Cache manager with SHA256 verification
│ ├── fetcher.py # Legislation fetcher with retry logic
│ └── cli.py # CLI admin mode
├── tests/ # Test suite (111 tests, 82.75% coverage)
│ ├── conftest.py # Pytest fixtures
│ ├── test_server.py # Server initialization tests
│ ├── test_tools.py # MCP tool integration tests
│ ├── test_canonical_id.py # Canonical ID parsing tests
│ ├── test_cache.py # Cache management tests
│ ├── test_fetcher.py # Legislation fetcher unit tests
│ ├── test_fetcher_integration.py # Real HTTP integration tests (NO MOCKS)
│ ├── test_pdf_parser.py # PDF parsing tests
│ ├── test_html_parser.py # HTML parsing tests
│ ├── test_playwright_fetcher.py # Playwright browser automation tests
│ └── test_deadlines.py # Deadline tracking and urgency tests
├── data/ # Local legislation cache
│ ├── legislation/cache/ # Cached legislation files
│ ├── legislation/summaries/ # Plain language summaries (Phase 2+)
│ ├── legislation/parquet/ # Compressed queryable format (Phase 2+)
│ ├── support-pathways/ # Support agency databases (Phase 3+)
│ └── metadata/ # Cache index and logs
├── docs/ # Documentation
│ ├── ROADMAP.md # Implementation roadmap
│ ├── REQUIREMENTS.md # Functional requirements
│ └── SPECIFICATION.md # Technical specifications
├── pyproject.toml # Project metadata and dependencies
├── Makefile # Development commands
└── README.md # This fileArchitecture
This MCP server is built using:
Python 3.12+: Modern Python with type hints
FastMCP 0.3+: Fast, Pythonic way to build MCP servers with clean testing
pytest: Testing with async support via pytest-asyncio
ruff: Fast linting and formatting
mypy: Static type checking
uv: Fast Python package management
Best Practices from Trusted MCPs
This project follows patterns from leading MCP implementations:
SerenaMCP: AsyncIO-based architecture, support for stdio/HTTP/SSE transports
Sequential Thinking MCP: Comprehensive pytest test suite with test_*.py organization
Context7 MCP: Clear tool definition with inputSchema validation, uvx installation patterns
Playwright MCP: Security-first approach, subprocess isolation, pinned dependencies
FastMCP: Clean API with decorators, in-memory testing, "fail loudly" error handling
Contributing
Contributions are welcome! This project follows pragmatic development principles:
Working code first - Shipped code with minor issues > perfect code that never ships
YAGNI - Don't build abstractions until they're proven necessary
Testing when needed - Create tests when complexity requires it
Quality standards - All code must pass ruff, mypy, and existing tests
License
MIT License - see LICENSE file for details
References
Available Tools
4 toolsget_cache_statusA
Get cache status including coverage, size, and missing items.
Returns: JSON string with cache statistics
Example: >>> get_cache_status() '{"total_cached": 3, "cache_size_mb": 3.2, ...}'
Inputs: no named parameters. Returns: result
get_legislation_contentA
Retrieve legislation content from cache or download if needed.
Args: canonical_id: Canonical legislation ID (e.g., "/au-victoria/ohs/2004") mode: Content mode - "text" (full statutory text), "summary" (plain language), or "metadata" (dates, amendments, related provisions) section: Optional section filter (e.g., "s21")
Returns: Legislation content as text or JSON error
Example: >>> get_legislation_content("/au-victoria/ohs/2004", mode="text") "# Occupational Health and Safety Act 2004\n\n..."
Inputs: canonical_id (required), mode, section. Returns: result
get_supportA
Find support agencies and resolution pathways for workplace issues.
Matches workplace scenarios to relevant support agencies with contact information, eligibility criteria, deadlines, and step-by-step guidance.
Args: scenario: Description of the workplace issue (e.g., "unfair dismissal", "wage theft", "workplace discrimination", "unsafe working conditions") jurisdiction: Optional jurisdiction filter - "federal", "victoria", "national" legislation_id: Optional canonical legislation ID to find related agencies
Returns: JSON string with matched agencies, contact info, deadlines, and pathways
Example: >>> get_support("unfair dismissal", jurisdiction="federal") '{"agencies": [{"name": "Fair Work Commission", ...}], "pathways": [...]}'
Inputs: scenario (required), jurisdiction, legislation_id. Returns: result
resolve_legislationA
Resolve natural language query or citation to canonical legislation ID.
Handles fuzzy matching and returns ranked results.
Args: query: Natural language query or citation (e.g., "unfair dismissal", "OHS Act s.21", "Fair Work Act section 394") jurisdiction: Optional jurisdiction filter (e.g., "au-victoria", "au-federal")
Returns: JSON string with ranked legislation matches
Example: >>> resolve_legislation("unfair dismissal") '{"matches": [{"id": "/au-federal/fwa/2009", "title": "Fair Work Act 2009", ...}]}'
Inputs: query (required), jurisdiction. Returns: result
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 4 tools
Each tool occupies a clearly distinct step in the workflow: resolving a query to an ID, fetching content by ID, inspecting cache state, and mapping scenarios to support agencies. There is no plausible way to confuse resolve_legislation with get_legislation_content since one returns IDs and the other requires an ID as input. get_cache_status and get_support are also unmistakably separate.
All names use snake_case with a verb-first pattern (resolve_, get_), which is predictable and readable. The only minor wrinkle is inconsistent noun granularity — two tools repeat 'legislation' in the name while get_support and get_cache_status do not, slightly obscuring that they operate on the same domain.
Four tools is a tight, purposeful surface for a legislation-lookup server, and each one earns its place in the resolve-fetch-support chain. It sits at the low end of the comfortable 3-15 range, with cache status being the only tool that feels auxiliary rather than core.
The core lifecycle is covered: discover legislation, retrieve its content in multiple modes, check what is available locally, and route users to enforcement bodies. Gaps are minor but real — there is no way to enumerate available jurisdictions or cached legislation titles, and no cache-refresh or invalidation operation, so an agent hitting a missing item must work around it.
Maintenance
Related MCP Connectors
Reliable Australian business-day, public-holiday and deadline tools for AI agents.
Provenance-backed EU and UK legislation for AI agents, addressable to the individual provision.
Official EU and national law for AI assistants: cited provisions as in force on any date.
Australian business days and holiday-aware due dates for your AI agent.
Related MCP Servers
- -licenseNot gradedqualityNot gradedmaintenanceEnables AI agents to search AustLII (Australian Legal Information Institute) for real Australian legislation and case law. Provides citations with direct links for legal research and verification.-
- AlicenseAqualityBmaintenanceEnables users to search and retrieve Australian legislation and case law with full-text content extraction. Provides structured results with citation metadata and OCR support for archival PDFs.126 npm44Apache 2.0
- AlicenseNot gradedqualityDmaintenanceSearches AustLII for Australian legislation and case law, enabling AI agents to find and cite real legal documents with sources.4MIT
- AlicenseNot gradedqualityBmaintenanceProvides AI assistants with up-to-date legal documents from official sources, enabling accurate legal information retrieval and analysis.21AGPL 3.0