Metadata-Version: 2.4
Name: glassbox-mcp
Version: 4.2.4
Summary: MCP server for Glassbox — mechanistic interpretability + EU AI Act Annex IV compliance tools for Claude and any MCP-compatible client
Author-email: Ajay Pravin Mahale <mahale.ajay01@gmail.com>
License: MIT
Project-URL: Homepage, https://project-gu05p.vercel.app
Project-URL: Repository, https://github.com/designer-coderajay/Glassbox-AI-2.0-Mechanistic-Interpretability-tool
Project-URL: Bug Tracker, https://github.com/designer-coderajay/Glassbox-AI-2.0-Mechanistic-Interpretability-tool/issues
Project-URL: PyPI, https://pypi.org/project/glassbox-mcp
Project-URL: Paper, https://arxiv.org/abs/2603.09988
Keywords: mcp,model-context-protocol,mechanistic-interpretability,circuit-discovery,eu-ai-act,annex-iv,compliance,transformer,explainability,glassbox
Classifier: Development Status :: 4 - Beta
Classifier: Intended Audience :: Science/Research
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
Requires-Python: >=3.10
Description-Content-Type: text/markdown
Requires-Dist: mcp>=1.0.0
Requires-Dist: fastmcp>=0.1.0
Requires-Dist: pydantic>=2.0.0
Requires-Dist: glassbox-mech-interp>=4.2.4
Requires-Dist: transformer-lens>=2.0.0
Requires-Dist: torch>=2.0.0
Requires-Dist: einops>=0.6.1

# glassbox-mcp

MCP server for [Glassbox](https://project-gu05p.vercel.app) — mechanistic interpretability + EU AI Act Annex IV compliance tools, exposed via the [Model Context Protocol](https://modelcontextprotocol.io).

Connect Claude (or any MCP-compatible client) to Glassbox with a single pip install. No cloning, no manual server setup.

## Install

```bash
pip install glassbox-mcp
```

## Connect to Claude Desktop

Add to `~/.claude/claude_desktop_config.json` (macOS/Linux) or `%APPDATA%\Claude\claude_desktop_config.json` (Windows):

```json
{
  "mcpServers": {
    "glassbox": {
      "command": "glassbox-mcp"
    }
  }
}
```

Restart Claude Desktop. The Glassbox tools appear immediately.

## Tools

| Tool | What it does |
|------|-------------|
| `glassbox_circuit_discovery` | Attribution patching — find which attention heads causally drive a prediction |
| `glassbox_faithfulness_metrics` | Compute sufficiency, comprehensiveness, F1, and EU AI Act explainability grade (A–D) |
| `glassbox_compliance_report` | Generate a full EU AI Act Annex IV evidence package (all 9 sections) |
| `glassbox_attention_patterns` | Get attention weight heatmap for any layer/head |
| `glassbox_logit_lens` | Layer-by-layer residual stream projection — see how predictions build up |

## Supported Models

- `gpt2`, `gpt2-medium`, `gpt2-large`
- `EleutherAI/pythia-70m`, `pythia-160m`, `pythia-410m`

## Example usage in Claude

Once connected, ask Claude things like:

> *"Use Glassbox to analyse which attention heads drive GPT-2's prediction for 'The Eiffel Tower is in' → ' Paris'"*

> *"Generate an EU AI Act Annex IV compliance report for GPT-2 with provider name Acme Corp"*

> *"Show me the logit lens for GPT-2 on this sentence"*

## Requirements

- Python ≥ 3.10
- ~3 GB disk (PyTorch + TransformerLens model weights download on first use)

## Version

`4.2.4` — tracks `glassbox-mech-interp` v4.2.4

- Paper: [arXiv 2603.09988](https://arxiv.org/abs/2603.09988)
- PyPI (core library): [glassbox-mech-interp](https://pypi.org/project/glassbox-mech-interp)
- Website: [project-gu05p.vercel.app](https://project-gu05p.vercel.app)
- GitHub: [designer-coderajay/Glassbox-AI-2.0](https://github.com/designer-coderajay/Glassbox-AI-2.0-Mechanistic-Interpretability-tool)
