Metadata-Version: 2.4
Name: mem-brain-mcp
Version: 1.1.5
Summary: MCP Server for Mem-Brain API - Exposes memory operations as MCP tools
Keywords: ai,claude,cursor,llm,mcp,memory,model-context-protocol
Classifier: Development Status :: 4 - Beta
Classifier: Intended Audience :: Developers
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
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Requires-Python: <3.14,>=3.10
Requires-Dist: fastmcp<3.0.0,>=2.0.0
Requires-Dist: httpx>=0.25.0
Requires-Dist: pydantic-settings>=2.0.0
Requires-Dist: pydantic>=2.0.0
Requires-Dist: uvicorn[standard]>=0.27.0
Provides-Extra: dev
Requires-Dist: black>=23.0.0; extra == 'dev'
Requires-Dist: pytest-asyncio>=0.21.0; extra == 'dev'
Requires-Dist: pytest>=7.4.0; extra == 'dev'
Requires-Dist: ruff>=0.1.0; extra == 'dev'
Description-Content-Type: text/markdown

# Mem-Brain MCP Server

MCP (Model Context Protocol) server that exposes Mem-Brain API functionality as standardized tools for AI agents. Built with [FastMCP](https://gofastmcp.com) for production-ready HTTP/SSE transport.

**Underlying HTTP API (tools, async jobs, search patterns):** see **[Membrain API: Guide for Agentic Applications](../docs/MEMBRAIN_AGENTIC_API_GUIDE.md)** in the parent repo.

## Features

- Memory CRUD and semantic search
- Search modes: `raw` (graph-native), `interpreted` (LLM summary), `both` (summary + evidence)
- Graph operations (path + neighborhood)
- Stats and health endpoints
- HTTP/SSE transport for remote MCP clients

## Authentication

Mem-Brain MCP uses **MemBrain API keys**.

- Preferred header in MCP client config: `X-API-Key: mb_live_...`
- Also supported: `Authorization: Bearer mb_live_...`

## Installation

### PyPI

```bash
pip install mem-brain-mcp
mem-brain-mcp
```

### uvx

```bash
uvx mem-brain-mcp
```

## Configuration

```env
API_BASE_URL=https://mem-brain-api-cutover-v4-production.up.railway.app
MEMBRAIN_API_KEY=mb_live_xxx   # optional fallback for single-user local runs
MCP_SERVER_HOST=0.0.0.0
MCP_SERVER_PORT=8100
LOG_LEVEL=INFO
```

## MCP Client Examples

### Cursor (`~/.cursor/mcp.json`)

```json
{
  "mcpServers": {
    "mem-brain": {
      "url": "http://localhost:8100/mcp",
      "headers": {
        "X-API-Key": "mb_live_xxx"
      }
    }
  }
}
```

### Claude Desktop

```json
{
  "mcpServers": {
    "mem-brain": {
      "url": "http://localhost:8100/mcp",
      "headers": {
        "X-API-Key": "mb_live_xxx"
      }
    }
  }
}
```

## Development

```bash
pytest
```

## Build / Publish

```bash
uv build
uv tool run twine upload dist/*
```
