Metadata-Version: 2.4
Name: stubborn-mcp
Version: 0.1.0b2
Summary: MCP server for Stubborn — deterministic code and contract context
Project-URL: Homepage, https://github.com/stubborn-ai/stubborn-mcp
Project-URL: Repository, https://github.com/stubborn-ai/stubborn-mcp
Project-URL: Documentation, https://github.com/stubborn-ai/stubborn-mcp#readme
Project-URL: Changelog, https://github.com/stubborn-ai/stubborn/blob/main/CHANGELOG.md
Author: Stubborn contributors
License-Expression: MIT
License-File: LICENSE
Keywords: code-context,cursor,llm,mcp,openapi,scip,stubborn
Classifier: Development Status :: 4 - Beta
Classifier: Environment :: Console
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Requires-Python: >=3.11
Requires-Dist: mcp<2,>=1.6
Requires-Dist: stubborn-stub<1.0,>=0.9.0b5
Provides-Extra: dev
Requires-Dist: pytest<9.0,>=8.0; extra == 'dev'
Requires-Dist: ruff<1,>=0.9; extra == 'dev'
Description-Content-Type: text/markdown

# stubborn-mcp

**MCP server for [Stubborn](https://github.com/stubborn-ai/stubborn)** — exposes source-neutral code and contract graph tools to Cursor and other MCP clients.

[![PyPI](https://img.shields.io/pypi/v/stubborn-mcp)](https://pypi.org/project/stubborn-mcp/)

Thin adapter over [`stubborn.api`](https://github.com/stubborn-ai/stubborn/blob/main/src/stubborn/api.py). All compile and contract graph logic lives in **[`stubborn-stub`](https://pypi.org/project/stubborn-stub/)**.

Part of the [stubborn-ai](https://github.com/stubborn-ai) program — see [stubborn-hub](https://github.com/stubborn-ai/stubborn-hub).

## Install

```bash
pip install stubborn-stub stubborn-mcp
```

For binary/NDJSON SCIP indexing, install Stubborn with its SCIP extra:

```bash
pip install "stubborn-stub[scip]" stubborn-mcp
stubborn index --scip index.scip --out metadata/symbols.db
export STUBBORN_DB=metadata/symbols.db
stubborn-mcp
```

Contract-only databases are also supported:

```bash
stubborn index-openapi \
  --openapi openapi.json \
  --service customers-service \
  --workspace petclinic \
  --out metadata/symbols.db
export STUBBORN_DB=metadata/symbols.db
stubborn-mcp
```

## Cursor configuration

`.cursor/mcp.json`:

```json
{
  "mcpServers": {
    "stubborn": {
      "command": "stubborn-mcp",
      "env": {
        "STUBBORN_DB": "${workspaceFolder}/metadata/symbols.db"
      }
    }
  }
}
```

Module entry: `python -m stubborn_mcp`

## Tools

| Tool | Purpose |
|------|---------|
| `workspace_info` | Inspect workspace source kinds: code repos, contract sources, symbols, endpoints |
| `get_context` | Prune + weave code or contract context (`java-stub` or `stubborn-dsl`) |
| `list_symbols` | Browse/search symbols by `stable_id` |
| `list_contracts` | Browse/search OpenAPI contract endpoint stable IDs and schema constraints |
| `metrics` | Compression KPI vs source tree |

Full parameter reference: [docs/MCP.md](docs/MCP.md)

## Development

```bash
git clone https://github.com/stubborn-ai/stubborn-mcp.git
cd stubborn-mcp
pip install -e "../stubborn"
pip install -e ".[dev]"
pytest
```

## License

MIT — see [LICENSE](LICENSE).
