magatama 0.5.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- magatama-0.5.0/.gitignore +120 -0
- magatama-0.5.0/PKG-INFO +143 -0
- magatama-0.5.0/README.md +109 -0
- magatama-0.5.0/pyproject.toml +63 -0
- magatama-0.5.0/src/magatama_mcp/__init__.py +10 -0
- magatama-0.5.0/src/magatama_mcp/cli/__init__.py +10 -0
- magatama-0.5.0/src/magatama_mcp/cli/main.py +843 -0
- magatama-0.5.0/src/magatama_mcp/server/__init__.py +17 -0
- magatama-0.5.0/src/magatama_mcp/server/mcp_server.py +509 -0
- magatama-0.5.0/src/magatama_mcp/server/protocol.py +1683 -0
- magatama-0.5.0/tests/cli/__init__.py +3 -0
- magatama-0.5.0/tests/e2e/__init__.py +5 -0
- magatama-0.5.0/tests/e2e/test_e2e_integration.py +767 -0
- magatama-0.5.0/tests/e2e/test_security.py +552 -0
- magatama-0.5.0/tests/server/__init__.py +3 -0
- magatama-0.5.0/tests/test_cli.py +388 -0
- magatama-0.5.0/tests/test_mcp_server.py +332 -0
- magatama-0.5.0/tests/test_protocol.py +578 -0
|
@@ -0,0 +1,120 @@
|
|
|
1
|
+
# Byte-compiled / optimized / DLL files
|
|
2
|
+
__pycache__/
|
|
3
|
+
*.py[cod]
|
|
4
|
+
*$py.class
|
|
5
|
+
|
|
6
|
+
# C extensions
|
|
7
|
+
*.so
|
|
8
|
+
|
|
9
|
+
# Distribution / packaging
|
|
10
|
+
.Python
|
|
11
|
+
build/
|
|
12
|
+
develop-eggs/
|
|
13
|
+
dist/
|
|
14
|
+
downloads/
|
|
15
|
+
eggs/
|
|
16
|
+
.eggs/
|
|
17
|
+
lib/
|
|
18
|
+
lib64/
|
|
19
|
+
parts/
|
|
20
|
+
sdist/
|
|
21
|
+
var/
|
|
22
|
+
wheels/
|
|
23
|
+
share/python-wheels/
|
|
24
|
+
*.egg-info/
|
|
25
|
+
.installed.cfg
|
|
26
|
+
*.egg
|
|
27
|
+
MANIFEST
|
|
28
|
+
|
|
29
|
+
# PyInstaller
|
|
30
|
+
*.manifest
|
|
31
|
+
*.spec
|
|
32
|
+
|
|
33
|
+
# Installer logs
|
|
34
|
+
pip-log.txt
|
|
35
|
+
pip-delete-this-directory.txt
|
|
36
|
+
|
|
37
|
+
# Unit test / coverage reports
|
|
38
|
+
htmlcov/
|
|
39
|
+
.tox/
|
|
40
|
+
.nox/
|
|
41
|
+
.coverage
|
|
42
|
+
.coverage.*
|
|
43
|
+
.cache
|
|
44
|
+
nosetests.xml
|
|
45
|
+
coverage.xml
|
|
46
|
+
*.cover
|
|
47
|
+
*.py,cover
|
|
48
|
+
.hypothesis/
|
|
49
|
+
.pytest_cache/
|
|
50
|
+
cover/
|
|
51
|
+
|
|
52
|
+
# Translations
|
|
53
|
+
*.mo
|
|
54
|
+
*.pot
|
|
55
|
+
|
|
56
|
+
# Environments
|
|
57
|
+
.env
|
|
58
|
+
.venv
|
|
59
|
+
env/
|
|
60
|
+
venv/
|
|
61
|
+
ENV/
|
|
62
|
+
env.bak/
|
|
63
|
+
venv.bak/
|
|
64
|
+
|
|
65
|
+
# Spyder project settings
|
|
66
|
+
.spyderproject
|
|
67
|
+
.spyproject
|
|
68
|
+
|
|
69
|
+
# Rope project settings
|
|
70
|
+
.ropeproject
|
|
71
|
+
|
|
72
|
+
# mkdocs documentation
|
|
73
|
+
/site
|
|
74
|
+
|
|
75
|
+
# mypy
|
|
76
|
+
.mypy_cache/
|
|
77
|
+
.dmypy.json
|
|
78
|
+
dmypy.json
|
|
79
|
+
|
|
80
|
+
# Pyre type checker
|
|
81
|
+
.pyre/
|
|
82
|
+
|
|
83
|
+
# pytype static type analyzer
|
|
84
|
+
.pytype/
|
|
85
|
+
|
|
86
|
+
# Cython debug symbols
|
|
87
|
+
cython_debug/
|
|
88
|
+
|
|
89
|
+
# IDE
|
|
90
|
+
.idea/
|
|
91
|
+
.vscode/
|
|
92
|
+
*.swp
|
|
93
|
+
*.swo
|
|
94
|
+
*~
|
|
95
|
+
|
|
96
|
+
# OS
|
|
97
|
+
.DS_Store
|
|
98
|
+
Thumbs.db
|
|
99
|
+
|
|
100
|
+
# Project specific
|
|
101
|
+
*.db
|
|
102
|
+
*.sqlite
|
|
103
|
+
*.sqlite3
|
|
104
|
+
.yata/
|
|
105
|
+
storage/archive/*
|
|
106
|
+
storage/changes/*
|
|
107
|
+
!storage/archive/.gitkeep
|
|
108
|
+
!storage/changes/.gitkeep
|
|
109
|
+
|
|
110
|
+
# Framework knowledge repositories (cloned for analysis)
|
|
111
|
+
frameworks/*
|
|
112
|
+
!frameworks/.gitkeep
|
|
113
|
+
|
|
114
|
+
# UV
|
|
115
|
+
.uv/
|
|
116
|
+
uv.lock
|
|
117
|
+
|
|
118
|
+
# comP
|
|
119
|
+
.comp/
|
|
120
|
+
plan.md
|
magatama-0.5.0/PKG-INFO
ADDED
|
@@ -0,0 +1,143 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: magatama
|
|
3
|
+
Version: 0.5.0
|
|
4
|
+
Summary: MAGATAMA MCP Server - AI Coding Support via Model Context Protocol
|
|
5
|
+
Project-URL: Homepage, https://github.com/tsucky230/MAGATAMA
|
|
6
|
+
Project-URL: Repository, https://github.com/tsucky230/MAGATAMA
|
|
7
|
+
Project-URL: Documentation, https://github.com/tsucky230/MAGATAMA#readme
|
|
8
|
+
Project-URL: Issues, https://github.com/tsucky230/MAGATAMA/issues
|
|
9
|
+
Author: MAGATAMA Team
|
|
10
|
+
License: MIT
|
|
11
|
+
Keywords: ai-coding,claude,copilot,knowledge-graph,mcp,model-context-protocol
|
|
12
|
+
Classifier: Development Status :: 3 - Alpha
|
|
13
|
+
Classifier: Intended Audience :: Developers
|
|
14
|
+
Classifier: License :: OSI Approved :: MIT License
|
|
15
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
16
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
17
|
+
Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
|
|
18
|
+
Classifier: Topic :: Software Development :: Libraries :: Python Modules
|
|
19
|
+
Requires-Python: >=3.11
|
|
20
|
+
Requires-Dist: click>=8.1.0
|
|
21
|
+
Requires-Dist: httpx>=0.27.0
|
|
22
|
+
Requires-Dist: magatama-core
|
|
23
|
+
Requires-Dist: mcp>=1.0.0
|
|
24
|
+
Requires-Dist: rich>=13.7.0
|
|
25
|
+
Requires-Dist: uvicorn>=0.27.0
|
|
26
|
+
Requires-Dist: watchdog>=4.0.0
|
|
27
|
+
Provides-Extra: dev
|
|
28
|
+
Requires-Dist: mypy>=1.9.0; extra == 'dev'
|
|
29
|
+
Requires-Dist: pytest-asyncio>=0.23.0; extra == 'dev'
|
|
30
|
+
Requires-Dist: pytest-cov>=4.1.0; extra == 'dev'
|
|
31
|
+
Requires-Dist: pytest>=8.0.0; extra == 'dev'
|
|
32
|
+
Requires-Dist: ruff>=0.4.0; extra == 'dev'
|
|
33
|
+
Description-Content-Type: text/markdown
|
|
34
|
+
|
|
35
|
+
# magatama - AI Coding Support MCP Server
|
|
36
|
+
|
|
37
|
+
[](https://badge.fury.io/py/magatama)
|
|
38
|
+
[](https://www.python.org/downloads/)
|
|
39
|
+
[](https://opensource.org/licenses/MIT)
|
|
40
|
+
|
|
41
|
+
> [MAGATAMA](https://github.com/tsucky230/MAGATAMA)([YATA](https://github.com/nahisaho/YATA) のフォーク)の
|
|
42
|
+
> MCP サーバーパッケージです(PyPI 配布名 `magatama` / import 名 `magatama_mcp` / CLI コマンド `magatama`)。
|
|
43
|
+
|
|
44
|
+
Model Context Protocol (MCP) サーバーとして、AI コーディングツールに知識グラフコンテキストを提供します。
|
|
45
|
+
|
|
46
|
+
## 特徴
|
|
47
|
+
|
|
48
|
+
- 🤖 **MCP 完全対応**: 8 Tools, 3 Prompts, 1 Resource
|
|
49
|
+
- 🔌 **AI ツール連携**: Claude Desktop, GitHub Copilot, Cursor
|
|
50
|
+
- 📡 **複数トランスポート**: stdio / SSE
|
|
51
|
+
- 🔒 **プライバシー**: 完全ローカル実行
|
|
52
|
+
|
|
53
|
+
## インストール
|
|
54
|
+
|
|
55
|
+
```bash
|
|
56
|
+
pip install magatama
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
## 使用方法
|
|
60
|
+
|
|
61
|
+
### CLI コマンド
|
|
62
|
+
|
|
63
|
+
```bash
|
|
64
|
+
# ファイルを解析
|
|
65
|
+
magatama parse path/to/file.py
|
|
66
|
+
|
|
67
|
+
# ディレクトリを解析
|
|
68
|
+
magatama parse path/to/project --pattern "**/*.py"
|
|
69
|
+
|
|
70
|
+
# MCP サーバーを起動(stdio)
|
|
71
|
+
magatama serve
|
|
72
|
+
|
|
73
|
+
# MCP サーバーを起動(SSE)
|
|
74
|
+
magatama serve --transport sse --port 8080
|
|
75
|
+
|
|
76
|
+
# エンティティを検索
|
|
77
|
+
magatama query "function_name" --type function
|
|
78
|
+
|
|
79
|
+
# 統計情報を表示
|
|
80
|
+
magatama stats
|
|
81
|
+
|
|
82
|
+
# グラフの整合性を検証
|
|
83
|
+
magatama validate --graph graph.json --repair
|
|
84
|
+
```
|
|
85
|
+
|
|
86
|
+
### AI ツール設定
|
|
87
|
+
|
|
88
|
+
#### Claude Desktop
|
|
89
|
+
|
|
90
|
+
```json
|
|
91
|
+
{
|
|
92
|
+
"mcpServers": {
|
|
93
|
+
"magatama": {
|
|
94
|
+
"command": "magatama",
|
|
95
|
+
"args": ["serve"]
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
```
|
|
100
|
+
|
|
101
|
+
#### GitHub Copilot (VS Code)
|
|
102
|
+
|
|
103
|
+
`.vscode/mcp.json`:
|
|
104
|
+
|
|
105
|
+
```json
|
|
106
|
+
{
|
|
107
|
+
"mcpServers": {
|
|
108
|
+
"magatama": {
|
|
109
|
+
"command": "magatama",
|
|
110
|
+
"args": ["serve"]
|
|
111
|
+
}
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
```
|
|
115
|
+
|
|
116
|
+
## MCP Tools
|
|
117
|
+
|
|
118
|
+
| Tool | 説明 |
|
|
119
|
+
|------|------|
|
|
120
|
+
| `parse_file` | ソースファイルを解析してエンティティを抽出 |
|
|
121
|
+
| `parse_directory` | ディレクトリ内のファイルを一括解析 |
|
|
122
|
+
| `search_entities` | 名前や型でエンティティを検索 |
|
|
123
|
+
| `get_entity` | 特定エンティティの詳細を取得 |
|
|
124
|
+
| `get_related_entities` | 関連エンティティを取得 |
|
|
125
|
+
| `get_graph_stats` | 知識グラフの統計情報を取得 |
|
|
126
|
+
| `save_graph` | 知識グラフを JSON ファイルに保存 |
|
|
127
|
+
| `load_graph` | JSON ファイルから知識グラフを読み込み |
|
|
128
|
+
|
|
129
|
+
## MCP Prompts
|
|
130
|
+
|
|
131
|
+
| Prompt | 説明 |
|
|
132
|
+
|--------|------|
|
|
133
|
+
| `analyze_codebase` | コードベース構造を分析 |
|
|
134
|
+
| `explain_entity` | コードエンティティを説明 |
|
|
135
|
+
| `find_dependencies` | 依存関係を分析 |
|
|
136
|
+
|
|
137
|
+
## ライセンス
|
|
138
|
+
|
|
139
|
+
MIT License - 詳細は [LICENSE](../../LICENSE) を参照してください。
|
|
140
|
+
|
|
141
|
+
## 関連プロジェクト
|
|
142
|
+
|
|
143
|
+
- [magatama-core](https://github.com/tsucky230/MAGATAMA/tree/main/packages/magatama-core) - Knowledge Graph Engine
|
magatama-0.5.0/README.md
ADDED
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
# magatama - AI Coding Support MCP Server
|
|
2
|
+
|
|
3
|
+
[](https://badge.fury.io/py/magatama)
|
|
4
|
+
[](https://www.python.org/downloads/)
|
|
5
|
+
[](https://opensource.org/licenses/MIT)
|
|
6
|
+
|
|
7
|
+
> [MAGATAMA](https://github.com/tsucky230/MAGATAMA)([YATA](https://github.com/nahisaho/YATA) のフォーク)の
|
|
8
|
+
> MCP サーバーパッケージです(PyPI 配布名 `magatama` / import 名 `magatama_mcp` / CLI コマンド `magatama`)。
|
|
9
|
+
|
|
10
|
+
Model Context Protocol (MCP) サーバーとして、AI コーディングツールに知識グラフコンテキストを提供します。
|
|
11
|
+
|
|
12
|
+
## 特徴
|
|
13
|
+
|
|
14
|
+
- 🤖 **MCP 完全対応**: 8 Tools, 3 Prompts, 1 Resource
|
|
15
|
+
- 🔌 **AI ツール連携**: Claude Desktop, GitHub Copilot, Cursor
|
|
16
|
+
- 📡 **複数トランスポート**: stdio / SSE
|
|
17
|
+
- 🔒 **プライバシー**: 完全ローカル実行
|
|
18
|
+
|
|
19
|
+
## インストール
|
|
20
|
+
|
|
21
|
+
```bash
|
|
22
|
+
pip install magatama
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
## 使用方法
|
|
26
|
+
|
|
27
|
+
### CLI コマンド
|
|
28
|
+
|
|
29
|
+
```bash
|
|
30
|
+
# ファイルを解析
|
|
31
|
+
magatama parse path/to/file.py
|
|
32
|
+
|
|
33
|
+
# ディレクトリを解析
|
|
34
|
+
magatama parse path/to/project --pattern "**/*.py"
|
|
35
|
+
|
|
36
|
+
# MCP サーバーを起動(stdio)
|
|
37
|
+
magatama serve
|
|
38
|
+
|
|
39
|
+
# MCP サーバーを起動(SSE)
|
|
40
|
+
magatama serve --transport sse --port 8080
|
|
41
|
+
|
|
42
|
+
# エンティティを検索
|
|
43
|
+
magatama query "function_name" --type function
|
|
44
|
+
|
|
45
|
+
# 統計情報を表示
|
|
46
|
+
magatama stats
|
|
47
|
+
|
|
48
|
+
# グラフの整合性を検証
|
|
49
|
+
magatama validate --graph graph.json --repair
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
### AI ツール設定
|
|
53
|
+
|
|
54
|
+
#### Claude Desktop
|
|
55
|
+
|
|
56
|
+
```json
|
|
57
|
+
{
|
|
58
|
+
"mcpServers": {
|
|
59
|
+
"magatama": {
|
|
60
|
+
"command": "magatama",
|
|
61
|
+
"args": ["serve"]
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
```
|
|
66
|
+
|
|
67
|
+
#### GitHub Copilot (VS Code)
|
|
68
|
+
|
|
69
|
+
`.vscode/mcp.json`:
|
|
70
|
+
|
|
71
|
+
```json
|
|
72
|
+
{
|
|
73
|
+
"mcpServers": {
|
|
74
|
+
"magatama": {
|
|
75
|
+
"command": "magatama",
|
|
76
|
+
"args": ["serve"]
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
```
|
|
81
|
+
|
|
82
|
+
## MCP Tools
|
|
83
|
+
|
|
84
|
+
| Tool | 説明 |
|
|
85
|
+
|------|------|
|
|
86
|
+
| `parse_file` | ソースファイルを解析してエンティティを抽出 |
|
|
87
|
+
| `parse_directory` | ディレクトリ内のファイルを一括解析 |
|
|
88
|
+
| `search_entities` | 名前や型でエンティティを検索 |
|
|
89
|
+
| `get_entity` | 特定エンティティの詳細を取得 |
|
|
90
|
+
| `get_related_entities` | 関連エンティティを取得 |
|
|
91
|
+
| `get_graph_stats` | 知識グラフの統計情報を取得 |
|
|
92
|
+
| `save_graph` | 知識グラフを JSON ファイルに保存 |
|
|
93
|
+
| `load_graph` | JSON ファイルから知識グラフを読み込み |
|
|
94
|
+
|
|
95
|
+
## MCP Prompts
|
|
96
|
+
|
|
97
|
+
| Prompt | 説明 |
|
|
98
|
+
|--------|------|
|
|
99
|
+
| `analyze_codebase` | コードベース構造を分析 |
|
|
100
|
+
| `explain_entity` | コードエンティティを説明 |
|
|
101
|
+
| `find_dependencies` | 依存関係を分析 |
|
|
102
|
+
|
|
103
|
+
## ライセンス
|
|
104
|
+
|
|
105
|
+
MIT License - 詳細は [LICENSE](../../LICENSE) を参照してください。
|
|
106
|
+
|
|
107
|
+
## 関連プロジェクト
|
|
108
|
+
|
|
109
|
+
- [magatama-core](https://github.com/tsucky230/MAGATAMA/tree/main/packages/magatama-core) - Knowledge Graph Engine
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
# MAGATAMA - MCP Server Application (distribution name: "magatama")
|
|
2
|
+
# Lives in packages/magatama-mcp/ and imports as `magatama_mcp`.
|
|
3
|
+
# Depends on magatama-core library (Article I compliance)
|
|
4
|
+
|
|
5
|
+
[project]
|
|
6
|
+
name = "magatama"
|
|
7
|
+
version = "0.5.0"
|
|
8
|
+
description = "MAGATAMA MCP Server - AI Coding Support via Model Context Protocol"
|
|
9
|
+
readme = "README.md"
|
|
10
|
+
license = { text = "MIT" }
|
|
11
|
+
requires-python = ">=3.11"
|
|
12
|
+
authors = [{ name = "MAGATAMA Team" }]
|
|
13
|
+
keywords = ["mcp", "ai-coding", "claude", "copilot", "knowledge-graph", "model-context-protocol"]
|
|
14
|
+
classifiers = [
|
|
15
|
+
"Development Status :: 3 - Alpha",
|
|
16
|
+
"Intended Audience :: Developers",
|
|
17
|
+
"License :: OSI Approved :: MIT License",
|
|
18
|
+
"Programming Language :: Python :: 3.11",
|
|
19
|
+
"Programming Language :: Python :: 3.12",
|
|
20
|
+
"Topic :: Software Development :: Libraries :: Python Modules",
|
|
21
|
+
"Topic :: Scientific/Engineering :: Artificial Intelligence",
|
|
22
|
+
]
|
|
23
|
+
dependencies = [
|
|
24
|
+
# Core library (Article I: Library-First)
|
|
25
|
+
"magatama-core",
|
|
26
|
+
# MCP Protocol (ADR-002)
|
|
27
|
+
"mcp>=1.0.0",
|
|
28
|
+
# CLI Framework
|
|
29
|
+
"click>=8.1.0",
|
|
30
|
+
# HTTP Server (for SSE transport)
|
|
31
|
+
"uvicorn>=0.27.0",
|
|
32
|
+
"httpx>=0.27.0",
|
|
33
|
+
# Progress display
|
|
34
|
+
"rich>=13.7.0",
|
|
35
|
+
# File watching (for watch command)
|
|
36
|
+
"watchdog>=4.0.0",
|
|
37
|
+
]
|
|
38
|
+
|
|
39
|
+
[project.urls]
|
|
40
|
+
Homepage = "https://github.com/tsucky230/MAGATAMA"
|
|
41
|
+
Repository = "https://github.com/tsucky230/MAGATAMA"
|
|
42
|
+
Documentation = "https://github.com/tsucky230/MAGATAMA#readme"
|
|
43
|
+
Issues = "https://github.com/tsucky230/MAGATAMA/issues"
|
|
44
|
+
|
|
45
|
+
[project.optional-dependencies]
|
|
46
|
+
dev = [
|
|
47
|
+
"pytest>=8.0.0",
|
|
48
|
+
"pytest-cov>=4.1.0",
|
|
49
|
+
"pytest-asyncio>=0.23.0",
|
|
50
|
+
"ruff>=0.4.0",
|
|
51
|
+
"mypy>=1.9.0",
|
|
52
|
+
]
|
|
53
|
+
|
|
54
|
+
[project.scripts]
|
|
55
|
+
# Main CLI entry point (Article II compliance)
|
|
56
|
+
magatama = "magatama_mcp.cli:main"
|
|
57
|
+
|
|
58
|
+
[build-system]
|
|
59
|
+
requires = ["hatchling"]
|
|
60
|
+
build-backend = "hatchling.build"
|
|
61
|
+
|
|
62
|
+
[tool.hatch.build.targets.wheel]
|
|
63
|
+
packages = ["src/magatama_mcp"]
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
"""
|
|
2
|
+
MAGATAMA MCP - MCP Server for AI Coding Support
|
|
3
|
+
|
|
4
|
+
MAGATAMA (勾玉) provides knowledge graph context to AI coding assistants
|
|
5
|
+
via the Model Context Protocol (MCP).
|
|
6
|
+
|
|
7
|
+
This package depends on magatama-core (Article I compliance).
|
|
8
|
+
"""
|
|
9
|
+
|
|
10
|
+
__version__ = "0.1.0"
|