Skip to main content
Glama
owenwangmar

fja-mcp

by owenwangmar
README.md
# FJA-MCP

A reference implementation of the **Flourishing-Justice-Autonomy (FJA)** alignment framework, exposed as an [MCP](https://modelcontextprotocol.io/) server.

## What is FJA?

FJA is a normative AI-alignment framework that extends the HHH (Harmless-Helpful-Honest) triad to:

- **Flourishing**: Support human well-being, pluralistic cultural perspectives, and access to knowledge.
- **Justice**: Ensure fairness, non-discrimination, and equitable treatment.
- **Autonomy**: Respect user choice, consent, and self-determination.

## Install

```bash
pip install -e .
```

## Run the MCP server

```bash
fja-mcp-server
```

or with the official MCP CLI:

```bash
mcp run server.py -t stdio
mcp dev server.py          # opens MCP Inspector
```

## Run examples

```bash
python examples/cultural_diet.py
python examples/medical_autonomy.py
python examples/hiring_fairness.py
```

## LLM fine-tuning + FJA evaluation demo

This example loads `distilgpt2` (81M parameters), evaluates its FJA metrics, fine-tunes it on a tiny FJA-aligned dataset, and re-evaluates.

```bash
pip install torch transformers datasets accelerate
python examples/llm_fja_demo.py
```

## Use the MCP client

```bash
fja-mcp-client
```

or

```bash
python -m fja_mcp.mcp_client
```

## Run tests

```bash
pytest
```

## License

MIT

TDQS

B3/5.0

Scored across 2 tools

Disambiguation5/5

The two tools have clearly distinct purposes: one evaluates a single response, the other compares two responses. There is no overlap in functionality, and an agent can easily select the appropriate tool based on whether it needs a single evaluation or a comparison.

Naming Consistency5/5

Both tool names follow a consistent verb_noun pattern: evaluate_output and compare_outputs. The naming is predictable and aligns with their functions, making it easy to infer behavior from the name.

Tool Count3/5

With only two tools, the server feels minimal but covers the core evaluation and comparison tasks. However, it is on the thin side for a dedicated server, and additional tools like batch evaluation or criteria management could round it out.

Completeness4/5

The server provides essential single and comparative evaluation capabilities, which are the primary use cases. Minor gaps exist, such as lacking a tool to retrieve or modify FJA criteria, but these are not critical for basic evaluation workflows.

Maintenance

ActivityMaintained
ResponsivenessSyncing