pyscn 1.1.0__py3-none-win_amd64.whl → 1.2.0__py3-none-win_amd64.whl

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.
Binary file
Binary file
pyscn/mcp_main.py ADDED
@@ -0,0 +1,96 @@
1
+ """
2
+ Entry point for pyscn-mcp MCP server.
3
+
4
+ This module provides a Python wrapper for the Go-implemented pyscn-mcp binary.
5
+ It automatically detects the platform and executes the appropriate MCP server binary.
6
+ """
7
+
8
+ import os
9
+ import sys
10
+ import platform
11
+ from pathlib import Path
12
+
13
+
14
+ def get_mcp_binary_path() -> str:
15
+ """
16
+ Get the path to the pyscn-mcp binary for the current platform.
17
+
18
+ Returns:
19
+ str: Path to the pyscn-mcp binary.
20
+
21
+ Raises:
22
+ FileNotFoundError: If the binary is not found for the current platform.
23
+ """
24
+ system = platform.system().lower()
25
+ machine = platform.machine().lower()
26
+
27
+ # Normalize architecture names
28
+ if machine in ('x86_64', 'amd64'):
29
+ machine = 'amd64'
30
+ elif machine in ('aarch64', 'arm64'):
31
+ machine = 'arm64'
32
+ else:
33
+ raise FileNotFoundError(
34
+ f"Unsupported architecture: {machine}. "
35
+ f"Supported architectures: amd64, arm64"
36
+ )
37
+
38
+ # Determine binary name
39
+ binary_name = f"pyscn-mcp-{system}-{machine}"
40
+ if system == "windows":
41
+ binary_name += ".exe"
42
+
43
+ # Binary path within the package
44
+ binary_path = Path(__file__).parent / "bin" / binary_name
45
+
46
+ if not binary_path.exists():
47
+ raise FileNotFoundError(
48
+ f"pyscn-mcp binary not found for platform {system}-{machine}.\n"
49
+ f"Expected location: {binary_path}\n"
50
+ f"Please check that the package was installed correctly."
51
+ )
52
+
53
+ return str(binary_path)
54
+
55
+
56
+ def main():
57
+ """
58
+ Main entry point for pyscn-mcp MCP server.
59
+
60
+ Replaces the current process with the Go-implemented MCP server binary.
61
+ This ensures proper stdio handling for MCP's JSON-RPC communication.
62
+ """
63
+ try:
64
+ binary_path = get_mcp_binary_path()
65
+
66
+ # Prepare arguments
67
+ args = [binary_path] + sys.argv[1:]
68
+
69
+ # Replace the current process with the MCP server binary
70
+ # This is critical for MCP servers as they need direct stdio access
71
+ # and proper signal handling without a Python wrapper layer
72
+ if sys.platform == "win32":
73
+ # Windows: use os.execv
74
+ os.execv(binary_path, args)
75
+ else:
76
+ # Unix-like: use os.execv
77
+ os.execv(binary_path, args)
78
+
79
+ except FileNotFoundError as e:
80
+ print(f"Error: {e}", file=sys.stderr)
81
+ print(
82
+ f"\nPlatform information:\n"
83
+ f" System: {platform.system()}\n"
84
+ f" Architecture: {platform.machine()}\n"
85
+ f" Python: {platform.python_version()}",
86
+ file=sys.stderr
87
+ )
88
+ sys.exit(1)
89
+
90
+ except Exception as e:
91
+ print(f"Unexpected error: {e}", file=sys.stderr)
92
+ sys.exit(1)
93
+
94
+
95
+ if __name__ == "__main__":
96
+ main()
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: pyscn
3
- Version: 1.1.0
3
+ Version: 1.2.0
4
4
  Summary: An intelligent Python code quality analyzer with architectural guidance
5
5
  Home-page: https://github.com/ludo-technologies/pyscn
6
6
  Author: DaisukeYoda
@@ -23,6 +23,7 @@ Description-Content-Type: text/markdown
23
23
 
24
24
  # pyscn - Python Code Quality Analyzer
25
25
 
26
+ [![Article](https://img.shields.io/badge/dev.to-Article-0A0A0A?style=flat-square&logo=dev.to)](https://dev.to/daisukeyoda/pyscn-the-code-quality-analyzer-for-vibe-coders-18hk)
26
27
  [![PyPI](https://img.shields.io/pypi/v/pyscn?style=flat-square&logo=pypi)](https://pypi.org/project/pyscn/)
27
28
  [![Go](https://img.shields.io/badge/Go-1.24+-00ADD8?style=flat-square&logo=go)](https://go.dev/)
28
29
  [![License](https://img.shields.io/badge/License-MIT-blue.svg)](LICENSE)
@@ -54,6 +55,39 @@ https://github.com/user-attachments/assets/07f48070-c0dd-437b-9621-cb3963f863ff
54
55
 
55
56
  **100,000+ lines/sec** • Built with Go + tree-sitter
56
57
 
58
+ ## MCP Integration
59
+
60
+ Run pyscn analyses straight from AI coding assistants via the Model Context Protocol (MCP). The bundled `pyscn-mcp` server exposes the same tools used in the CLI to Claude Code, Cursor, ChatGPT, and other MCP clients.
61
+
62
+ ### Claude Code Setup
63
+
64
+ ```bash
65
+ # Add pyscn MCP server with one command
66
+ claude mcp add pyscn-mcp uvx -- pyscn-mcp
67
+ ```
68
+
69
+ ### Cursor / Claude Desktop Setup
70
+
71
+ Add to your MCP settings (`~/.config/claude-desktop/config.json` or Cursor settings):
72
+
73
+ ```json
74
+ {
75
+ "mcpServers": {
76
+ "pyscn-mcp": {
77
+ "command": "uvx",
78
+ "args": ["pyscn-mcp"],
79
+ "env": {
80
+ "PYSCN_CONFIG": "/path/to/.pyscn.toml"
81
+ }
82
+ }
83
+ }
84
+ }
85
+ ```
86
+
87
+ The instructions like "Analyze the code quality" trigger pyscn via MCP.
88
+
89
+ Dive deeper in `mcp/README.md` for setup walkthroughs and `docs/MCP_INTEGRATION.md` for architecture details.
90
+
57
91
  ## Installation
58
92
 
59
93
  ```bash
@@ -129,25 +163,19 @@ directory = "reports"
129
163
  ## CI/CD Integration
130
164
 
131
165
  ```yaml
132
- # .github/workflows/code-quality.yml
133
- name: Code Quality
134
- on: [push, pull_request]
135
-
136
- jobs:
137
- quality-check:
138
- runs-on: ubuntu-latest
139
- steps:
140
- - uses: actions/checkout@v4
141
- - run: pip install pyscn
142
- - name: Quick quality check
143
- run: pyscn check .
144
- - name: Generate detailed report
145
- run: pyscn analyze --json --select complexity,deadcode,deps src/
146
- - name: Upload report
147
- uses: actions/upload-artifact@v4
148
- with:
149
- name: code-quality-report
150
- path: .pyscn/reports/
166
+ # GitHub Actions
167
+ - uses: actions/checkout@v4
168
+ - run: pipx run pyscn check . # Fail on quality issues
169
+
170
+ # Pre-commit hook
171
+ - repo: local
172
+ hooks:
173
+ - id: pyscn
174
+ name: pyscn check
175
+ entry: pipx run pyscn check .
176
+ language: system
177
+ pass_filenames: false
178
+ types: [python]
151
179
  ```
152
180
 
153
181
  ---
@@ -0,0 +1,10 @@
1
+ pyscn/__init__.py,sha256=HRv-Oi427RyttzZalJBUupLHKNFFErBDK49mgM93614,450
2
+ pyscn/__main__.py,sha256=W7pj0bglX-7BEIwWDVdW8yafZYzEsAh7IljY0wzVl6I,127
3
+ pyscn/bin/pyscn-mcp-windows-amd64.exe,sha256=TG6n-uLK1Osr0KQm9hHh-vtzz8nl40sNr2ENq38aYG4,7733248
4
+ pyscn/bin/pyscn-windows-amd64.exe,sha256=H1oGAOcpcMf_ajtO3ar8Dm2J_ZqcBh4T725G3Ln6mLQ,12738048
5
+ pyscn/main.py,sha256=M_vLpulyfAZaM9gtI2HpY3DCFzHRM_ulv9FOdLQUqlE,2714
6
+ pyscn/mcp_main.py,sha256=WVY1sOB9HN1HmIceRgLlFAmvQg99PbrI1Ub-01z-AFQ,2851
7
+ pyscn-1.2.0.dist-info/entry_points.txt,sha256=b3uDJeuGfdioTYIV5vD_OLiCO_BPZ53Bqbe5jOurh4o,78
8
+ pyscn-1.2.0.dist-info/METADATA,sha256=L7W_Cr8Oc-ZrBaKZZB5TSoDnpe09yjQZ27TtnHaODKY,5636
9
+ pyscn-1.2.0.dist-info/WHEEL,sha256=ICN7qb8qrvTQybj9kVPKtBG-ipWcOAsdtIlsfZDPI74,96
10
+ pyscn-1.2.0.dist-info/RECORD,,
@@ -1,2 +1,3 @@
1
1
  [console_scripts]
2
2
  pyscn = pyscn.__main__:main
3
+ pyscn-mcp = pyscn.mcp_main:main
@@ -1,8 +0,0 @@
1
- pyscn/__init__.py,sha256=HRv-Oi427RyttzZalJBUupLHKNFFErBDK49mgM93614,450
2
- pyscn/__main__.py,sha256=W7pj0bglX-7BEIwWDVdW8yafZYzEsAh7IljY0wzVl6I,127
3
- pyscn/bin/pyscn-windows-amd64.exe,sha256=CbD_Hcw5je5BsQs6QFllZrM36Vwo4qu_TxRhZP9-QZc,12736512
4
- pyscn/main.py,sha256=M_vLpulyfAZaM9gtI2HpY3DCFzHRM_ulv9FOdLQUqlE,2714
5
- pyscn-1.1.0.dist-info/entry_points.txt,sha256=Hq59HuLE4ipwZthGmgvAv7aQF3oiixtCLxivVoNil5w,46
6
- pyscn-1.1.0.dist-info/METADATA,sha256=jA1Ulrjyi-Gv7TYAM7IaoPg7Z75kg0hCstC7tV-uZwI,4820
7
- pyscn-1.1.0.dist-info/WHEEL,sha256=ICN7qb8qrvTQybj9kVPKtBG-ipWcOAsdtIlsfZDPI74,96
8
- pyscn-1.1.0.dist-info/RECORD,,
File without changes