Metadata-Version: 2.4
Name: capforge-mcp
Version: 0.6.1
Summary: MCP adapter for CapForge — ACM-controlled AI agent tool execution via the Model Context Protocol
Author-email: Shashank R <shashank.r2005@gmail.com>
License: Apache-2.0
Project-URL: Homepage, https://github.com/shashank123r/capforge
Project-URL: Repository, https://github.com/shashank123r/capforge
Project-URL: Specification, https://github.com/shashank123r/capforge/blob/main/SPEC.md
Keywords: capforge,acm,mcp,agent,authorization,security,model-context-protocol
Classifier: Development Status :: 3 - Alpha
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: Apache Software License
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Topic :: Security
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Requires-Python: >=3.12
Description-Content-Type: text/markdown
Requires-Dist: capforge>=0.6.1
Requires-Dist: mcp<2,>=1.28

# CapForge MCP Adapter

**ACM-controlled AI agent tool execution via the Model Context Protocol.**

---

## Overview

`capforge-mcp` is the official [Model Context Protocol](https://modelcontextprotocol.io/) integration for [CapForge](https://github.com/shashank123r/capforge). It lets you protect every MCP tool invocation against an [Agent Capability Manifest (ACM)](https://github.com/shashank123r/capforge/blob/main/SPEC.md) — a signed policy document that defines what actions an agent is allowed to perform.

Every tool call passes through `ACM.check()` before execution. Unauthorized attempts are rejected with a structured `MCPPermissionError`.

## Installation

```bash
pip install capforge-mcp
```

Requires Python 3.12+.

## Quick Start

```python
from capforge import ACM
from capforge_mcp import ACMProtectedMCP

# Load your signed capability manifest
acm = ACM.load("manifest.json")

# Create an ACM-protected MCP server
mcp = ACMProtectedMCP("MyServer", acm=acm)

# Register a protected tool
@mcp.tool(resource="email", action="send")
def send_email(to: str, body: str) -> str:
    return f"Sent to {to}: {body}"

# Run the server
mcp.run(transport="stdio")
```

## API

| Symbol | Description |
|:-------|:------------|
| `ACMProtectedMCP` | `FastMCP` wrapper with built-in ACM authorization |
| `acm_protected` | Decorator for adding ACM checks to any MCP tool |
| `MCPPermissionError` | Structured error raised on denied tool invocations |

## Dependency

`capforge-mcp` requires the [capforge](https://pypi.org/project/capforge/) core package (`pip install capforge`) and the [MCP Python SDK](https://pypi.org/project/mcp/) (`mcp>=1.28,<2`). Both are installed automatically as dependencies.

## License

Apache 2.0
