Metadata-Version: 2.4
Name: magatama
Version: 0.5.3
Summary: MAGATAMA MCP Server - AI Coding Support via Model Context Protocol
Project-URL: Homepage, https://github.com/tsucky230/MAGATAMA
Project-URL: Repository, https://github.com/tsucky230/MAGATAMA
Project-URL: Documentation, https://github.com/tsucky230/MAGATAMA#readme
Project-URL: Issues, https://github.com/tsucky230/MAGATAMA/issues
Author: MAGATAMA Team
License: MIT
Keywords: ai-coding,claude,copilot,knowledge-graph,mcp,model-context-protocol
Classifier: Development Status :: 3 - Alpha
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
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.11
Requires-Dist: click>=8.1.0
Requires-Dist: httpx>=0.27.0
Requires-Dist: magatama-core
Requires-Dist: mcp>=1.0.0
Requires-Dist: rich>=13.7.0
Requires-Dist: uvicorn>=0.27.0
Requires-Dist: watchdog>=4.0.0
Provides-Extra: dev
Requires-Dist: mypy>=1.9.0; extra == 'dev'
Requires-Dist: pytest-asyncio>=0.23.0; extra == 'dev'
Requires-Dist: pytest-cov>=4.1.0; extra == 'dev'
Requires-Dist: pytest>=8.0.0; extra == 'dev'
Requires-Dist: ruff>=0.4.0; extra == 'dev'
Description-Content-Type: text/markdown

# magatama - AI Coding Support MCP Server

[![PyPI version](https://badge.fury.io/py/magatama.svg)](https://badge.fury.io/py/magatama)
[![Python 3.11+](https://img.shields.io/badge/python-3.11+-blue.svg)](https://www.python.org/downloads/)
[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)

> [MAGATAMA](https://github.com/tsucky230/MAGATAMA)（[YATA](https://github.com/nahisaho/YATA) のフォーク）の
> MCP サーバーパッケージです（PyPI 配布名 `magatama` / import 名 `magatama_mcp` / CLI コマンド `magatama`）。

Model Context Protocol (MCP) サーバーとして、AI コーディングツールに知識グラフコンテキストを提供します。

## 特徴

- 🤖 **MCP 完全対応**: 36 Tools, 3 Prompts, 1 Resource
- 🔌 **comP Bridge**: comP の `.comp/index.db` を再パースなしで知識グラフに取り込み
- 🔌 **AI ツール連携**: Claude Desktop, GitHub Copilot, Cursor
- 📡 **複数トランスポート**: stdio / SSE
- 🔒 **プライバシー**: 完全ローカル実行

## インストール

```bash
pip install magatama
```

## 使用方法

### CLI コマンド

```bash
# ファイルを解析
magatama parse path/to/file.py

# ディレクトリを解析
magatama parse path/to/project --pattern "**/*.py"

# MCP サーバーを起動（stdio）
magatama serve

# MCP サーバーを起動（SSE）
magatama serve --transport sse --port 8080

# エンティティを検索
magatama query "function_name" --type function

# 統計情報を表示
magatama stats

# グラフの整合性を検証
magatama validate --graph graph.json --repair
```

### AI ツール設定

#### Claude Desktop

```json
{
  "mcpServers": {
    "magatama": {
      "command": "magatama",
      "args": ["serve"]
    }
  }
}
```

#### GitHub Copilot (VS Code)

`.vscode/mcp.json`:

```json
{
  "mcpServers": {
    "magatama": {
      "command": "magatama",
      "args": ["serve"]
    }
  }
}
```

## MCP Tools

全 **36 ツール**を提供します（基本・フレームワーク知識・検索・品質分析・
AI 支援・comP Bridge）。下表は基本ツールの抜粋で、全 36 ツールの一覧は
[ルート README](https://github.com/tsucky230/MAGATAMA#-mcp-tools-36) を参照してください。

| Tool | 説明 |
|------|------|
| `parse_file` | ソースファイルを解析してエンティティを抽出 |
| `parse_directory` | ディレクトリ内のファイルを一括解析 |
| `search_entities` | 名前や型でエンティティを検索 |
| `get_entity` / `get_related_entities` | 詳細取得 / 関連エンティティ取得 |
| `get_graph_stats` | 知識グラフの統計情報を取得 |
| `save_graph` / `load_graph` | JSON への保存 / 読み込み |
| `read_external_graph` | **comP Bridge**: comP インデックスを取り込み |
| `get_external_graph_info` | **comP Bridge**: comP インデックスの統計を確認 |

## MCP Prompts

| Prompt | 説明 |
|--------|------|
| `analyze_codebase` | コードベース構造を分析 |
| `explain_entity` | コードエンティティを説明 |
| `find_dependencies` | 依存関係を分析 |

## ライセンス

MIT License - 詳細は [LICENSE](../../LICENSE) を参照してください。

## 関連プロジェクト

- [magatama-core](https://github.com/tsucky230/MAGATAMA/tree/main/packages/magatama-core) - Knowledge Graph Engine
