pyscn-mcp 1.5.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.
pyscn_mcp/__init__.py ADDED
@@ -0,0 +1,7 @@
1
+ """
2
+ pyscn-mcp: MCP (Model Context Protocol) server for pyscn Python code analyzer.
3
+
4
+ This package provides an MCP server interface to pyscn's code analysis capabilities.
5
+ """
6
+
7
+ __version__ = "0.0.0" # Will be set by setuptools_scm
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()
Binary file
@@ -0,0 +1,75 @@
1
+ Metadata-Version: 2.1
2
+ Name: pyscn-mcp
3
+ Version: 1.5.0
4
+ Summary: MCP (Model Context Protocol) server for pyscn Python code analyzer
5
+ Home-page: https://github.com/ludo-technologies/pyscn
6
+ Author: DaisukeYoda
7
+ Author-email: daisukeyoda@users.noreply.github.com
8
+ License: MIT
9
+ Classifier: Development Status :: 5 - Production/Stable
10
+ Classifier: Environment :: Console
11
+ Classifier: Intended Audience :: Developers
12
+ Classifier: License :: OSI Approved :: MIT License
13
+ Classifier: Operating System :: OS Independent
14
+ Classifier: Programming Language :: Python :: 3
15
+ Classifier: Programming Language :: Python :: 3.8
16
+ Classifier: Programming Language :: Python :: 3.9
17
+ Classifier: Programming Language :: Python :: 3.10
18
+ Classifier: Programming Language :: Python :: 3.11
19
+ Classifier: Programming Language :: Python :: 3.12
20
+ Classifier: Programming Language :: Python :: 3.13
21
+ Classifier: Topic :: Software Development :: Quality Assurance
22
+ Classifier: Typing :: Typed
23
+ Requires-Python: >=3.8
24
+ Description-Content-Type: text/markdown
25
+
26
+ # pyscn-mcp
27
+
28
+ MCP (Model Context Protocol) server for pyscn Python code analyzer.
29
+
30
+ ## Installation
31
+
32
+ ```bash
33
+ # Install via pipx (recommended)
34
+ pipx install pyscn-mcp
35
+
36
+ # Or with uv
37
+ uvx pyscn-mcp
38
+
39
+ # Or with pip
40
+ pip install pyscn-mcp
41
+ ```
42
+
43
+ ## Usage
44
+
45
+ ### As MCP Server
46
+
47
+ Configure in your MCP client (e.g., Claude Desktop):
48
+
49
+ ```json
50
+ {
51
+ "mcpServers": {
52
+ "pyscn-mcp": {
53
+ "command": "uvx",
54
+ "args": ["pyscn-mcp"],
55
+ "env": {
56
+ "PYSCN_CONFIG": "/path/to/.pyscn.toml"
57
+ }
58
+ }
59
+ }
60
+ }
61
+ ```
62
+
63
+ ### Standalone
64
+
65
+ ```bash
66
+ pyscn-mcp
67
+ ```
68
+
69
+ ## Documentation
70
+
71
+ For full documentation, visit the [pyscn repository](https://github.com/ludo-technologies/pyscn).
72
+
73
+ ## License
74
+
75
+ MIT License - see the [LICENSE](../../LICENSE) file for details.
@@ -0,0 +1,7 @@
1
+ pyscn_mcp-1.5.0.dist-info/METADATA,sha256=rkNw1DvDGmZLTMYvTRHe-E6PYoPL1wJnk1s2Q-iNOBU,1743
2
+ pyscn_mcp-1.5.0.dist-info/WHEEL,sha256=CYyQE2vHrYPvCU3b7nn-Hl7_xZMO7l2E38d23t5MbRM,104
3
+ pyscn_mcp-1.5.0.dist-info/entry_points.txt,sha256=GMYq1fzBLd4R5TDvXvK4btbGCULxMv-jTrPDjv7isbI,54
4
+ pyscn_mcp/__init__.py,sha256=FtEyK0p6UIanEK0Z6fJaegPs88lTgdHtd_I3kT2Kyaw,229
5
+ pyscn_mcp/__main__.py,sha256=pWy07VEsQzpsuaGyRrNPKUq_4TO538rFk7v7mMkqC1A,2755
6
+ pyscn_mcp/bin/pyscn-mcp-darwin-arm64,sha256=zk6yqZ2Jm_CHU_AxSGrBYKmS9DVd1RSdJ1bZ9ZHKzpA,6624290
7
+ pyscn_mcp-1.5.0.dist-info/RECORD,,
@@ -0,0 +1,4 @@
1
+ Wheel-Version: 1.0
2
+ Generator: pyscn-create-wheel
3
+ Root-Is-Purelib: false
4
+ Tag: py3-none-macosx_11_0_arm64
@@ -0,0 +1,2 @@
1
+ [console_scripts]
2
+ pyscn-mcp = pyscn_mcp.__main__:main