Skip to content

Fix packaging to support uvx installation#4

Open
sam-at-luther wants to merge 1 commit intoDEmodoriGatsuO:mainfrom
luthersystems:fix/uvx-packaging
Open

Fix packaging to support uvx installation#4
sam-at-luther wants to merge 1 commit intoDEmodoriGatsuO:mainfrom
luthersystems:fix/uvx-packaging

Conversation

@sam-at-luther
Copy link
Contributor

Summary

This PR fixes a packaging issue that prevents installation via uvx or pip from Git.

Problem

The current setup.py defines a console script entry point:

entry_points={
    "console_scripts": [
        "sharepoint-mcp=server:main",
    ],
},

However, the server.py file at the repository root is not properly packaged, causing:

ModuleNotFoundError: No module named 'server'

Solution

Add py_modules=['server'] to setup.py to explicitly include the root-level server.py file in the package.

Changes

     packages=find_packages(),
+    py_modules=['server'],
     classifiers=[

This is a one-line change that enables proper module resolution.

Testing

After this change, the package can be installed and run via:

# Install via uvx
uvx --from git+https://github.com/DEmodoriGatsuO/sharepoint-mcp sharepoint-mcp

# Or via pip
pip install git+https://github.com/DEmodoriGatsuO/sharepoint-mcp
sharepoint-mcp --help

Verified that the server starts successfully and can handle MCP protocol requests.

Benefits

✅ Enables installation via uvx for easy testing and deployment
✅ Makes the package pip-installable from Git
✅ No breaking changes to existing functionality
✅ Minimal, focused fix

References

Add py_modules=['server'] to setup.py to properly expose the server
module for installation via uvx/pip.

Without this, the console script entry point 'sharepoint-mcp=server:main'
fails with 'ModuleNotFoundError: No module named server' because the
server.py file at the repository root is not included in the package.

This enables installation via:
  uvx --from git+https://github.com/DEmodoriGatsuO/sharepoint-mcp sharepoint-mcp

Or standard pip installation:
  pip install git+https://github.com/DEmodoriGatsuO/sharepoint-mcp

Tested with:
  uvx --from . sharepoint-mcp --help
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant