pyscn 1.1.1__py3-none-macosx_11_0_arm64.whl → 1.2.0__py3-none-macosx_11_0_arm64.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.

Potentially problematic release.


This version of pyscn might be problematic. Click here for more details.

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.1
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
@@ -55,6 +55,39 @@ https://github.com/user-attachments/assets/07f48070-c0dd-437b-9621-cb3963f863ff
55
55
 
56
56
  **100,000+ lines/sec** • Built with Go + tree-sitter
57
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
+
58
91
  ## Installation
59
92
 
60
93
  ```bash
@@ -0,0 +1,10 @@
1
+ pyscn-1.2.0.dist-info/METADATA,sha256=F7U651GZVB_EO3YTtUE4igP6VZjKJshqb8K-6HYj07w,5462
2
+ pyscn-1.2.0.dist-info/WHEEL,sha256=CYyQE2vHrYPvCU3b7nn-Hl7_xZMO7l2E38d23t5MbRM,104
3
+ pyscn-1.2.0.dist-info/entry_points.txt,sha256=b3uDJeuGfdioTYIV5vD_OLiCO_BPZ53Bqbe5jOurh4o,78
4
+ pyscn/__init__.py,sha256=2899qYVW2M1QljQ7xSvgLeHyf8yjzemZp62di19Baw8,431
5
+ pyscn/__main__.py,sha256=ctBTSh1ps0V8KJLus4fcg5NE2FCF1HEyfXmh1KCw0gs,120
6
+ pyscn/bin/pyscn-darwin-arm64,sha256=iCkjT-79x5I7GVSVhLNWhgfl-l9qf0rwxkYBVPIson8,11624338
7
+ pyscn/bin/pyscn-mcp-darwin-arm64,sha256=GYf20GxM--N-CQDD--hucLFCRfLl3bS4Sqs0fZRu04Q,7088898
8
+ pyscn/main.py,sha256=rtQdBLwQwLWAh8dvynOzilgWd0ayRoh7MaaycpfQcI8,2619
9
+ pyscn/mcp_main.py,sha256=pWy07VEsQzpsuaGyRrNPKUq_4TO538rFk7v7mMkqC1A,2755
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-1.1.1.dist-info/METADATA,sha256=0COfGoG74nT89qsiYgf8Z-ffDEVBKCk1cRYjcFjQSkE,4612
2
- pyscn-1.1.1.dist-info/WHEEL,sha256=CYyQE2vHrYPvCU3b7nn-Hl7_xZMO7l2E38d23t5MbRM,104
3
- pyscn-1.1.1.dist-info/entry_points.txt,sha256=Hq59HuLE4ipwZthGmgvAv7aQF3oiixtCLxivVoNil5w,46
4
- pyscn/__init__.py,sha256=2899qYVW2M1QljQ7xSvgLeHyf8yjzemZp62di19Baw8,431
5
- pyscn/__main__.py,sha256=ctBTSh1ps0V8KJLus4fcg5NE2FCF1HEyfXmh1KCw0gs,120
6
- pyscn/bin/pyscn-darwin-arm64,sha256=HTYn6WjCSdYCTZ4H-wSRnHP3G_ljHnLS290UDuTQsRk,11624338
7
- pyscn/main.py,sha256=rtQdBLwQwLWAh8dvynOzilgWd0ayRoh7MaaycpfQcI8,2619
8
- pyscn-1.1.1.dist-info/RECORD,,
File without changes