Metadata-Version: 2.4
Name: armature-mcp-analytics
Version: 0.1.1
Summary: Armature analytics wrapper SDK for Python MCP servers.
Project-URL: Homepage, https://armature.tech
Project-URL: Repository, https://github.com/armature-tech/mcp-analytics-python
Author-email: Armature <support@armature.tech>
License-Expression: Apache-2.0
Keywords: analytics,armature,fastmcp,mcp,model-context-protocol,observability,telemetry
Classifier: Development Status :: 3 - Alpha
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: Apache Software 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 :: Software Development :: Libraries :: Python Modules
Requires-Python: >=3.10
Provides-Extra: fastmcp
Requires-Dist: fastmcp<4,>=2; extra == 'fastmcp'
Provides-Extra: mcp
Requires-Dist: mcp<2,>=1.27; extra == 'mcp'
Description-Content-Type: text/markdown

# armature-mcp-analytics

Armature analytics for Python MCP servers. The v1 integration is FastMCP-first:
instrument a `FastMCP` instance, keep writing normal tools, and Armature records
tool calls with MCP-specific telemetry.

Install:

```bash
pip install "armature-mcp-analytics[fastmcp]"
```

```python
import os
from fastmcp import FastMCP
from armature_mcp_analytics import instrument_fastmcp

mcp = FastMCP("Customer MCP")

instrument_fastmcp(
    mcp,
    {
        "armature": {
            "api_key": os.getenv("ANALYTICS_INGEST_API_KEY"),
            "delivery": "await",
        }
    },
)

@mcp.tool
def lookup_customer(customer_id: str) -> dict:
    """Look up a customer by id."""
    return {"customer_id": customer_id, "status": "active"}

if __name__ == "__main__":
    mcp.run()
```

Agents see an optional `telemetry` object on each tool input schema. The SDK
strips that object before your handler runs, then emits an authenticated batch
to Armature.

Environment variables:

| Variable | Purpose |
| --- | --- |
| `ANALYTICS_INGEST_API_KEY` | Armature ingest API key. Missing keys no-op for local development. |
| `ANALYTICS_INGEST_URL` | Optional ingest endpoint override. |
